From 1781b983e13f5efc441effd180ce04967b7b055f Mon Sep 17 00:00:00 2001 From: tianq Date: Fri, 7 Apr 2023 15:50:14 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=8E=A5=E5=8F=A3=E4=B8=89?= =?UTF-8?q?=E4=BB=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../census/census-accountActiveList.vue | 5 +- .../modules/census/census-accountList.vue | 5 +- src/views/modules/census/census-houseList.vue | 107 +++++++++--------- 3 files changed, 61 insertions(+), 56 deletions(-) diff --git a/src/views/modules/census/census-accountActiveList.vue b/src/views/modules/census/census-accountActiveList.vue index 8274a9b44..42cc3b41e 100644 --- a/src/views/modules/census/census-accountActiveList.vue +++ b/src/views/modules/census/census-accountActiveList.vue @@ -221,8 +221,9 @@ export default { return this.$message.error(res.msg); } else { console.log('获取组织树成功', res.data); - this.orgOptions = []; - this.orgOptions.push(res.data); + let { agencyList, subAgencyList } = res.data; + const _arr = [{ ...agencyList, subAgencyList: [...subAgencyList] }]; + this.orgOptions = this.deepTree(_arr); } }) .catch(() => { diff --git a/src/views/modules/census/census-accountList.vue b/src/views/modules/census/census-accountList.vue index d54ad3776..17b19441c 100644 --- a/src/views/modules/census/census-accountList.vue +++ b/src/views/modules/census/census-accountList.vue @@ -352,8 +352,9 @@ export default { return this.$message.error(res.msg); } else { console.log('获取组织树成功', res.data); - this.orgOptions = []; - this.orgOptions.push(res.data); + let { agencyList, subAgencyList } = res.data; + const _arr = [{ ...agencyList, subAgencyList: [...subAgencyList] }]; + this.orgOptions = this.deepTree(_arr); } }) .catch(() => { diff --git a/src/views/modules/census/census-houseList.vue b/src/views/modules/census/census-houseList.vue index 25186a60c..b1927e305 100644 --- a/src/views/modules/census/census-houseList.vue +++ b/src/views/modules/census/census-houseList.vue @@ -48,29 +48,32 @@
房屋用途统计
-
- -
+ +
+ +
+
-
房屋状态统计
-
- -
+ +
+ +
+
@@ -167,10 +170,10 @@ export default { checkStrictly: true }, TableHeight: '', - pieInitState:false, - pieInitState2:false, - pieOption:[], - pieOption2:[] + pieInitState: false, + pieInitState2: false, + pieOption: [], + pieOption2: [] }; }, computed: { @@ -195,6 +198,7 @@ export default { this.getOrgTreeList(); this.getTableData(); this.getPie(); + this.getPie2(); }, methods: { handleSearch(val) { @@ -260,8 +264,9 @@ export default { this.pieInitState = true; }, pieInitOk2() { - console.log("2333erwewrwe33333") + console.log('2333erwewrwe33333', this.pieInitState2); this.pieInitState2 = true; + console.log('2333erwewrwe333335476754765', this.pieInitState2); }, getPie() { if (this.pieInitState) { @@ -274,7 +279,7 @@ export default { }, getPie2() { if (this.pieInitState2) { - console.log("233333333") + console.log('233333333'); this.setPieData2(); } else { setTimeout(() => { @@ -300,10 +305,9 @@ export default { // }); console.log('chartData', chartData); this.iniPieChart(chartData); - }, setPieData2() { - console.log("dddddddddddd") + console.log('dddddddddddd'); // let data = [...this.pieData]; // console.log('data', data); let chartData = { @@ -321,7 +325,6 @@ export default { // }); console.log('chartData', chartData); this.iniPieChart2(chartData); - }, // 获取饼状图 async iniPieChart(chartData) { @@ -426,11 +429,10 @@ export default { this.$refs.pieChart.setOption(this.pieOption); }, async iniPieChart2(chartData) { - console.log("dddddddddddd") + console.log('dddddddddddd'); this.$refs.pieChart2.clear(); // 获取pieChart配置 this.pieOption2 = { - color: ['#3C94FE', '#A17AFA', '#A19FFF', '#22C1C3', '#6FC364', '#FEB349', '#FE6252'], title: { text: '12345', @@ -447,8 +449,28 @@ export default { color: '#333333' } }, - + series: [ + { + type: 'pie', + radius: ['65%', '80%'], + avoidLabelOverlap: false, + label: { + show: false, + position: 'center' + }, + tooltip: { + show: true + }, + z: 9999, + data: [ + { value: 1048, name: 'Search Engine' }, + { value: 735, name: 'Direct' }, + { value: 580, name: 'Email' }, + { value: 484, name: 'Union Ads' }, + { value: 300, name: 'Video Ads' } + ] + }, { type: 'pie', radius: ['60%', '85%'], @@ -475,26 +497,6 @@ export default { color: '#f7f7f7' } } - }, - - { - type: 'pie', - radius: ['65%', '80%'], - avoidLabelOverlap: false, - label: { - show: false, - position: 'center' - }, - tooltip: { - show: true - }, - data: [ - { value: 1048, name: 'Search Engine' }, - { value: 735, name: 'Direct' }, - { value: 580, name: 'Email' }, - { value: 484, name: 'Union Ads' }, - { value: 300, name: 'Video Ads' } - ] } ] }; @@ -524,7 +526,7 @@ export default { if (param.data.level == 'street') { this.orgType = 'community'; } - + this.orgId = param.data.id; this.orgName = param.data.name; this.pageNo = 1; @@ -573,8 +575,9 @@ export default { return this.$message.error(res.msg); } else { console.log('获取组织树成功', res.data); - this.orgOptions = []; - this.orgOptions.push(res.data); + let { agencyList, subAgencyList } = res.data; + const _arr = [{ ...agencyList, subAgencyList: [...subAgencyList] }]; + this.orgOptions = this.deepTree(_arr); } }) .catch(() => {