From 30f0cc32285dbbf79a179037f3a82a6a8a7f56a0 Mon Sep 17 00:00:00 2001 From: 13176889840 <13176889840@163.com> Date: Fri, 10 Dec 2021 09:52:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E6=8E=AA=E6=96=BD=E7=AE=A1?= =?UTF-8?q?=E7=90=86-=E9=9C=80=E6=B1=82=E7=A6=81=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/communityService/measure/index.vue | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/views/modules/communityService/measure/index.vue b/src/views/modules/communityService/measure/index.vue index a249a953..2582b929 100644 --- a/src/views/modules/communityService/measure/index.vue +++ b/src/views/modules/communityService/measure/index.vue @@ -17,7 +17,7 @@ @@ -448,6 +448,7 @@ export default { ], reportOptions: [], demandOptions: [], + searchdemandOptions: [], demandUserList: [], optionsG: [], optionsEditG: [], @@ -918,6 +919,16 @@ export default { }) return arr }, + getFlagData(data, flag) { + if (!Array.isArray(data)) return [] + let arr1 = data.filter(item => item[flag]) + let arr2 = arr1.map(item => { + if (item.children) return { ...item, children: this.getFlagData(item.children, flag) } + else return item + }) + // console.log('arrr-oppp', arr2) + return arr2 + }, async getGridList(type, agencyId) { const { user } = await this.$store.state console.log('user---ppp', user) @@ -969,7 +980,8 @@ export default { if (res.code !== 0) { return this.$message.error(res.msg) } else { - this.demandOptions = this.getTreeData(res.data) + this.searchdemandOptions = this.getTreeData(res.data) + this.demandOptions = this.getFlagData(this.getTreeData(res.data), 'usableFlag') } }) .catch(() => {