From 02767f45f85262db5040218cef0492556d4104e9 Mon Sep 17 00:00:00 2001 From: HAHA Date: Fri, 17 Jun 2022 14:29:48 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E6=89=80=E5=B1=9E?= =?UTF-8?q?=E7=BD=91=E6=A0=BC=E4=BD=8D=E7=BD=AE=EF=BC=8C=E5=8E=BB=E9=99=A4?= =?UTF-8?q?=E6=9C=80=E5=90=8E=E4=B8=80=E5=B1=82=E4=B8=8B=E6=8B=89=E8=8F=9C?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/cabaseinfo/caloudong.vue | 33 ++++++++++++++------- src/views/modules/cabaseinfo/capingfang.vue | 33 ++++++++++++++------- src/views/modules/cabaseinfo/carental.vue | 33 ++++++++++++++------- src/views/modules/cabaseinfo/caresident.vue | 33 ++++++++++++++------- src/views/modules/cabaseinfo/carotators.vue | 33 ++++++++++++++------- 5 files changed, 110 insertions(+), 55 deletions(-) diff --git a/src/views/modules/cabaseinfo/caloudong.vue b/src/views/modules/cabaseinfo/caloudong.vue index e363467af..436786c80 100644 --- a/src/views/modules/cabaseinfo/caloudong.vue +++ b/src/views/modules/cabaseinfo/caloudong.vue @@ -2,6 +2,14 @@
+ + + + - - - - {{ $t("query") }} @@ -183,13 +183,24 @@ export default { getloudongOptions(){ this.$http.post(`/opendata/caLoudong/getLouDongCascade`).then(resp => { if(resp.data.code === 0){ - this.caLouDongOptions = resp.data.data + this.caLouDongOptions = this.removeEmptySubOrgList(resp.data.data) } }).catch(error => { this.$message.error(error) - }) - + }) }, + removeEmptySubOrgList (orgArray) { + orgArray.forEach((orgInfo) => { + if (orgInfo && orgInfo.children) { + if (orgInfo.children.length === 0) { + orgInfo.children = undefined + } else { + this.removeEmptySubOrgList(orgInfo.children) + } + } + }) + return orgArray; + }, handlePartyChange(val) { console.log('val------pp', val) this.dataForm.gridId = val[val.length - 1] diff --git a/src/views/modules/cabaseinfo/capingfang.vue b/src/views/modules/cabaseinfo/capingfang.vue index b0d8df759..4e778ecd7 100644 --- a/src/views/modules/cabaseinfo/capingfang.vue +++ b/src/views/modules/cabaseinfo/capingfang.vue @@ -2,6 +2,14 @@
+ + + + - - - - {{ $t("query") }} @@ -183,13 +183,24 @@ export default { getloudongOptions(){ this.$http.post(`/opendata/caLoudong/getLouDongCascade`).then(resp => { if(resp.data.code === 0){ - this.caLouDongOptions = resp.data.data + this.caLouDongOptions = this.removeEmptySubOrgList(resp.data.data) } }).catch(error => { this.$message.error(error) - }) - + }) }, + removeEmptySubOrgList (orgArray) { + orgArray.forEach((orgInfo) => { + if (orgInfo && orgInfo.children) { + if (orgInfo.children.length === 0) { + orgInfo.children = undefined + } else { + this.removeEmptySubOrgList(orgInfo.children) + } + } + }) + return orgArray; + }, handlePartyChange(val) { console.log('val------pp', val) this.dataForm.gridId = val[val.length - 1] diff --git a/src/views/modules/cabaseinfo/carental.vue b/src/views/modules/cabaseinfo/carental.vue index bb79ac5a8..16b6927d7 100644 --- a/src/views/modules/cabaseinfo/carental.vue +++ b/src/views/modules/cabaseinfo/carental.vue @@ -2,6 +2,14 @@
+ + + + - - - - {{ $t("query") }} @@ -184,13 +184,24 @@ export default { getloudongOptions(){ this.$http.post(`/opendata/caLoudong/getLouDongCascade`).then(resp => { if(resp.data.code === 0){ - this.caLouDongOptions = resp.data.data + this.caLouDongOptions = this.removeEmptySubOrgList(resp.data.data) } }).catch(error => { this.$message.error(error) - }) - + }) }, + removeEmptySubOrgList (orgArray) { + orgArray.forEach((orgInfo) => { + if (orgInfo && orgInfo.children) { + if (orgInfo.children.length === 0) { + orgInfo.children = undefined + } else { + this.removeEmptySubOrgList(orgInfo.children) + } + } + }) + return orgArray; + }, handlePartyChange(val) { console.log('val------pp', val) this.dataForm.gridId = val[val.length - 1] diff --git a/src/views/modules/cabaseinfo/caresident.vue b/src/views/modules/cabaseinfo/caresident.vue index c1a5d8816..a875af483 100644 --- a/src/views/modules/cabaseinfo/caresident.vue +++ b/src/views/modules/cabaseinfo/caresident.vue @@ -2,6 +2,14 @@
+ + + + @@ -19,14 +27,6 @@ clearable > - - - - {{ $t("query") }} @@ -175,13 +175,24 @@ export default { getloudongOptions(){ this.$http.post(`/opendata/caLoudong/getLouDongCascade`).then(resp => { if(resp.data.code === 0){ - this.caLouDongOptions = resp.data.data + this.caLouDongOptions = this.removeEmptySubOrgList(resp.data.data) } }).catch(error => { this.$message.error(error) - }) - + }) }, + removeEmptySubOrgList (orgArray) { + orgArray.forEach((orgInfo) => { + if (orgInfo && orgInfo.children) { + if (orgInfo.children.length === 0) { + orgInfo.children = undefined + } else { + this.removeEmptySubOrgList(orgInfo.children) + } + } + }) + return orgArray; + }, handlePartyChange(val) { console.log('val------pp', val) this.dataForm.gridId = val[val.length - 1] diff --git a/src/views/modules/cabaseinfo/carotators.vue b/src/views/modules/cabaseinfo/carotators.vue index 8de489c5b..07683cccf 100644 --- a/src/views/modules/cabaseinfo/carotators.vue +++ b/src/views/modules/cabaseinfo/carotators.vue @@ -2,6 +2,14 @@
+ + + + @@ -18,14 +26,6 @@ placeholder="联系方式" clearable > - - - - {{ $t("query") }} @@ -169,13 +169,24 @@ export default { getloudongOptions(){ this.$http.post(`/opendata/caLoudong/getLouDongCascade`).then(resp => { if(resp.data.code === 0){ - this.caLouDongOptions = resp.data.data + this.caLouDongOptions = this.removeEmptySubOrgList(resp.data.data) } }).catch(error => { this.$message.error(error) - }) - + }) }, + removeEmptySubOrgList (orgArray) { + orgArray.forEach((orgInfo) => { + if (orgInfo && orgInfo.children) { + if (orgInfo.children.length === 0) { + orgInfo.children = undefined + } else { + this.removeEmptySubOrgList(orgInfo.children) + } + } + }) + return orgArray; + }, handlePartyChange(val) { console.log('val------pp', val) this.dataForm.gridId = val[val.length - 1] From c45afba188f7346f36790fefef1c74d370159a7f Mon Sep 17 00:00:00 2001 From: HAHA Date: Fri, 17 Jun 2022 14:31:03 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/cabaseinfo/caloudong.vue | 2 +- src/views/modules/cabaseinfo/capingfang.vue | 2 +- src/views/modules/cabaseinfo/carental.vue | 2 +- src/views/modules/cabaseinfo/caresident.vue | 2 +- src/views/modules/cabaseinfo/carotators.vue | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/views/modules/cabaseinfo/caloudong.vue b/src/views/modules/cabaseinfo/caloudong.vue index 436786c80..5d4f74ad1 100644 --- a/src/views/modules/cabaseinfo/caloudong.vue +++ b/src/views/modules/cabaseinfo/caloudong.vue @@ -181,7 +181,7 @@ export default { }, methods:{ getloudongOptions(){ - this.$http.post(`/opendata/caLoudong/getLouDongCascade`).then(resp => { + this.$http.post(`/opendata/cabmGrid/getCascadeMenu`).then(resp => { if(resp.data.code === 0){ this.caLouDongOptions = this.removeEmptySubOrgList(resp.data.data) } diff --git a/src/views/modules/cabaseinfo/capingfang.vue b/src/views/modules/cabaseinfo/capingfang.vue index 4e778ecd7..4226a1aa6 100644 --- a/src/views/modules/cabaseinfo/capingfang.vue +++ b/src/views/modules/cabaseinfo/capingfang.vue @@ -181,7 +181,7 @@ export default { }, methods:{ getloudongOptions(){ - this.$http.post(`/opendata/caLoudong/getLouDongCascade`).then(resp => { + this.$http.post(`/opendata/cabmGrid/getCascadeMenu`).then(resp => { if(resp.data.code === 0){ this.caLouDongOptions = this.removeEmptySubOrgList(resp.data.data) } diff --git a/src/views/modules/cabaseinfo/carental.vue b/src/views/modules/cabaseinfo/carental.vue index 16b6927d7..47a0c4236 100644 --- a/src/views/modules/cabaseinfo/carental.vue +++ b/src/views/modules/cabaseinfo/carental.vue @@ -182,7 +182,7 @@ export default { }, methods:{ getloudongOptions(){ - this.$http.post(`/opendata/caLoudong/getLouDongCascade`).then(resp => { + this.$http.post(`/opendata/cabmGrid/getCascadeMenu`).then(resp => { if(resp.data.code === 0){ this.caLouDongOptions = this.removeEmptySubOrgList(resp.data.data) } diff --git a/src/views/modules/cabaseinfo/caresident.vue b/src/views/modules/cabaseinfo/caresident.vue index a875af483..2b08a8e3b 100644 --- a/src/views/modules/cabaseinfo/caresident.vue +++ b/src/views/modules/cabaseinfo/caresident.vue @@ -173,7 +173,7 @@ export default { }, methods:{ getloudongOptions(){ - this.$http.post(`/opendata/caLoudong/getLouDongCascade`).then(resp => { + this.$http.post(`/opendata/cabmGrid/getCascadeMenu`).then(resp => { if(resp.data.code === 0){ this.caLouDongOptions = this.removeEmptySubOrgList(resp.data.data) } diff --git a/src/views/modules/cabaseinfo/carotators.vue b/src/views/modules/cabaseinfo/carotators.vue index 07683cccf..330a848af 100644 --- a/src/views/modules/cabaseinfo/carotators.vue +++ b/src/views/modules/cabaseinfo/carotators.vue @@ -167,7 +167,7 @@ export default { }, methods:{ getloudongOptions(){ - this.$http.post(`/opendata/caLoudong/getLouDongCascade`).then(resp => { + this.$http.post(`/opendata/cabmGrid/getCascadeMenu`).then(resp => { if(resp.data.code === 0){ this.caLouDongOptions = this.removeEmptySubOrgList(resp.data.data) }