From 7bbb657379c80dc71be00cb0438d74273e984464 Mon Sep 17 00:00:00 2001 From: Yer <17633066053@163.com> Date: Thu, 10 Aug 2023 11:29:57 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20:zap:=20=E4=BC=98=E5=8C=96=E5=9C=B0?= =?UTF-8?q?=E5=8C=BA=E9=80=89=E6=8B=A9=E5=99=A8=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buyer/src/components/map/multiple-map.vue | 8 ++++++++ manager/src/components/map/multiple-map.vue | 10 +++++++++- seller/src/views/my-components/map/multiple-map.vue | 8 ++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/buyer/src/components/map/multiple-map.vue b/buyer/src/components/map/multiple-map.vue index 9e164efa..89153cfa 100644 --- a/buyer/src/components/map/multiple-map.vue +++ b/buyer/src/components/map/multiple-map.vue @@ -75,13 +75,21 @@ export default { if (res.result.length && val.id !== 0) { this.chiosend[index] = val } + else if(!res.result.length){ + this.chiosend[index] = val + } this.data[level] = res.result; if (level == 'city') { this.data.area = [] this.data.street = [] + this.chiosend.splice(1, 3, "","",""); } if (level == 'area') { this.data.street = [] + this.chiosend.splice(2, 2, "",""); + } + if (level == 'street') { + this.chiosend.splice(3, 1, ""); } }); } diff --git a/manager/src/components/map/multiple-map.vue b/manager/src/components/map/multiple-map.vue index 41d62a59..a3d34b75 100644 --- a/manager/src/components/map/multiple-map.vue +++ b/manager/src/components/map/multiple-map.vue @@ -72,16 +72,24 @@ export default { } else { API_Setup.getChildRegion(val.id).then((res) => { - if ( val.id !== 0) { + if (res.result.length && val.id !== 0) { + this.chiosend[index] = val + } + else if(!res.result.length){ this.chiosend[index] = val } this.data[level] = res.result; if (level == 'city') { this.data.area = [] this.data.street = [] + this.chiosend.splice(1, 3, "","",""); } if (level == 'area') { this.data.street = [] + this.chiosend.splice(2, 2, "",""); + } + if (level == 'street') { + this.chiosend.splice(3, 1, ""); } }); } diff --git a/seller/src/views/my-components/map/multiple-map.vue b/seller/src/views/my-components/map/multiple-map.vue index 9e28a28f..c0969efb 100644 --- a/seller/src/views/my-components/map/multiple-map.vue +++ b/seller/src/views/my-components/map/multiple-map.vue @@ -75,13 +75,21 @@ export default { if (res.result.length && val.id !== 0) { this.chiosend[index] = val } + else if(!res.result.length){ + this.chiosend[index] = val + } this.data[level] = res.result; if (level == 'city') { this.data.area = [] this.data.street = [] + this.chiosend.splice(1, 3, "","",""); } if (level == 'area') { this.data.street = [] + this.chiosend.splice(2, 2, "",""); + } + if (level == 'street') { + this.chiosend.splice(3, 1, ""); } }); }