From ad47713c9403185a1e01c2823d5694a7146e4dec Mon Sep 17 00:00:00 2001 From: admin-lmm <2497833386@QQ.com> Date: Thu, 3 Aug 2023 12:11:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E6=9F=A5=E6=89=BE=E4=B8=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/pile/station/components/SiteInfo.vue | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/jsowell-ui/src/views/pile/station/components/SiteInfo.vue b/jsowell-ui/src/views/pile/station/components/SiteInfo.vue index c6ff9d2b7..0f075a289 100644 --- a/jsowell-ui/src/views/pile/station/components/SiteInfo.vue +++ b/jsowell-ui/src/views/pile/station/components/SiteInfo.vue @@ -485,7 +485,7 @@ export default { // console.log("data", data); // data就是它传过来的值 // console.log("原始this.station", this.station); // 地址 - this.detailedAddress = data.address; + // this.detailedAddress = data.address; // console.log("详细地址", data.address); var adcode = data.adcode; var areaCode = []; @@ -498,14 +498,15 @@ export default { this.station.stationLng = String(data.pos[0]); this.station.stationLat = String(data.pos[1]); // console.log("修改后this.station", this.station); - + console.log(data.address,'data.address') + this.station.address = data.address.includes('区') ? data.address.replace(/区/, ' ').split(' ')[1] : data.address // 优化之后 - let newAddress2 = this.detailedAddress - .replace(/(?<=[省市区])/g, "$&,") - .split(","); - let end = newAddress2.pop(); - console.log("详细地址", end); - this.station.address = end; + // let newAddress2 = this.detailedAddress + // .replace(/(?<=[省市区])/g, "$&,") + // .split(","); + // let end = newAddress2.pop(); + // console.log("详细地址",this.station.areaCode,newAddress2); + // this.station.address = newAddress2; }); }, computed: {