From 694dfbd64ef59c64ea1be59069e016a0ee5bbad0 Mon Sep 17 00:00:00 2001 From: jiangyy Date: Thu, 12 May 2022 15:56:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AF=E8=A7=86=E5=8C=96=E5=B9=B3=E5=8F=B0-?= =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E6=B2=BB=E7=90=86-=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E6=A1=86=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../visual/communityGovern/processAnalyze.vue | 47 +++++++++---------- .../visual/communityGovern/typeAnalyze.vue | 6 ++- 2 files changed, 25 insertions(+), 28 deletions(-) diff --git a/src/views/modules/visual/communityGovern/processAnalyze.vue b/src/views/modules/visual/communityGovern/processAnalyze.vue index 7c2c3276..186b05bd 100644 --- a/src/views/modules/visual/communityGovern/processAnalyze.vue +++ b/src/views/modules/visual/communityGovern/processAnalyze.vue @@ -183,26 +183,7 @@ export default { status: 'pending',//状态:待处理 pending,结案closed agencyInfo: {}, projectList: [], - projectList1: [ - { - agencyId: '', - projectId: '', - origin: '', - status: 'pending', - title: '南宁第二网格南宁第二网格', - latitude: 36.062227, - longitude: 120.389455, - }, - { - agencyId: '', - projectId: '', - origin: '', - status: 'closed', - latitude: 36.082227, - longitude: 120.389455, - title: "南宁第二网格", - } - ], + iconUrlArray: [], iconTextStyle: {}, @@ -212,6 +193,7 @@ export default { customerList: [], iscascaderShow: 0, + optionProps: { multiple: false, value: 'agencyId', @@ -273,6 +255,13 @@ export default { const { data, code, msg } = await requestPost(url, params); if (code === 0) { + let treeData = [] + console.log(this.treeData) + treeData.push(data) + //重构树,去除网格 + let treeDataNew + treeDataNew = this.filterTree(treeData) + this.agencyInfo = data this.agencyId = this.agencyInfo.agencyId if (!this.agencyInfo.latitude) { @@ -291,7 +280,7 @@ export default { this.agencyIdArray.length = [] if (data) { - this.casOptions.push(data) + this.casOptions = treeDataNew this.agencyIdArray.push(this.agencyId) } @@ -301,6 +290,17 @@ export default { }, + //重构树,去除网格 + filterTree (treeData) { + + let newTree = treeData.filter(x => x.level !== 'grid') + newTree.forEach(x => x.subAgencyList && (x.subAgencyList = this.filterTree(x.subAgencyList))) + return newTree + + }, + + + //加载项目 async getProjectTotal () { if (this.$refs.pieChart) { @@ -370,12 +370,7 @@ export default { if (code === 0) { this.projectList = [...data] - // if (this.status === 'closed') { - // this.projectList = this.projectList1 - // } else { - // this.projectList = this.projectList2 - // } this.projectList.forEach(item => { item.values_ = { name: item.title diff --git a/src/views/modules/visual/communityGovern/typeAnalyze.vue b/src/views/modules/visual/communityGovern/typeAnalyze.vue index d5ec1516..32c4c41d 100644 --- a/src/views/modules/visual/communityGovern/typeAnalyze.vue +++ b/src/views/modules/visual/communityGovern/typeAnalyze.vue @@ -210,12 +210,14 @@ export default { // 获取当前登录人员信息及组织信息 async getAgencylist () { - const url = "/gov/org/customeragency/agencygridtree"; + // const url = "/gov/org/customeragency/agencygridtree"; + const url = '/gov/org/customeragency/agencylist' let params = {}; const { data, code, msg } = await requestPost(url, params); if (code === 0) { + this.agencyInfo = data this.agencyId = this.agencyInfo.agencyId if (!this.agencyInfo.latitude) { @@ -389,7 +391,7 @@ export default { }, async handleChangeAgency (value) { - + this.demand.list = [] this.agencyName = this.$refs["myCascader"].getCheckedNodes()[0].label this.agencyId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : '' await this.getPieChart()