From 7efdfe151b0c5ca5518f8c15bc024a13b530e3c6 Mon Sep 17 00:00:00 2001 From: tianq Date: Tue, 11 Apr 2023 13:38:18 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=A7=E8=81=94bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../census/census-accountActiveList.vue | 18 ++++--- .../modules/census/census-accountList.vue | 12 ++--- src/views/modules/census/census-nineList.vue | 47 +++++++++++-------- 3 files changed, 45 insertions(+), 32 deletions(-) diff --git a/src/views/modules/census/census-accountActiveList.vue b/src/views/modules/census/census-accountActiveList.vue index a85ee01d9..53800b18b 100644 --- a/src/views/modules/census/census-accountActiveList.vue +++ b/src/views/modules/census/census-accountActiveList.vue @@ -6,16 +6,15 @@
+ />
- + + :show-all-levels="false" + /> nowData; }; return { + optionsA: [], pieChart: '', pieOption: {}, pieInitState: false, @@ -202,6 +202,7 @@ export default { orgOptionProps: { multiple: false, value: 'agencyId', + emitPath: false, label: 'agencyName', children: 'subAgencyList', checkStrictly: true @@ -341,7 +342,6 @@ export default { handleChangeAgency(val) { let obj = this.$refs['myCascader'].getCheckedNodes()[0].data; console.log(obj); - this.formData.orgId = obj.agencyId; this.formData.level = obj.level; }, getOrgTreeList() { diff --git a/src/views/modules/census/census-nineList.vue b/src/views/modules/census/census-nineList.vue index 7a0c2280e..aea5cb4f9 100644 --- a/src/views/modules/census/census-nineList.vue +++ b/src/views/modules/census/census-nineList.vue @@ -4,11 +4,10 @@
@@ -125,7 +124,6 @@ :detailId="detailId" :detailData="detailData" @handleClose="handleClose" - />
@@ -160,7 +158,8 @@ export default { return time.getTime() > nowData; }; return { - orgType:"agency", + orgId: '', + orgType: 'agency', dialogVisible: false, detailId: '', detailData: {}, @@ -169,7 +168,9 @@ export default { user: {}, gridList: [], //所属网格list--场所区域 tableData: [], - formData: {}, + formData: { + orgId: '' + }, pageNo: 1, pageSize: window.localStorage.getItem('pageSize') || 20, total: 1, @@ -190,6 +191,7 @@ export default { value: 'agencyId', label: 'agencyName', children: 'subAgencyList', + emitPath: false, checkStrictly: true }, TableHeight: '', @@ -241,11 +243,11 @@ export default { this.getTableData(); }, handleSearch(val) { - console.log("val",val); - if(this.formData.orgId.length==0){ - this.formData.orgId=""; + let tmp = this.formData.orgId; + if (!tmp && typeof tmp != 'undefined' && tmp != 0) { + this.formData.orgId = ''; } - console.log(this.formData); + this.pageNo = 1; this.placeType = ''; this.getTableData(); @@ -288,7 +290,7 @@ export default { this.getTableData(); }, async getsubData() { - console.log("this.orgType",this.orgType) + console.log('this.orgType', this.orgType); this.$refs.pieChart.showLoading(); let url = '/gov/org/enterprise/count-type'; let param = { @@ -327,7 +329,14 @@ export default { let data = [...this.pieData.list]; this.chartData.name = data.map(item => item.placeTypeName); this.chartData.data = data.map(item => { - return { value: item.total, id: item.agencyId, placeType: item.placeType, name: item.placeTypeName }; + return { + value: item.total, + id: item.agencyId, + placeType: item.placeType, + name: item.placeTypeName, + radio: item.total == 0 ? '0' : ((item.total / this.pieData.total) * 100).toFixed(2) + }; + console.log(item, this.pieData.total); }); console.log('chartData', this.chartData); @@ -444,7 +453,9 @@ export default { data: { pageSize, pageNo, - ...formData + orgId: this.formData.orgId, + orgType: this.orgType, + placeType: this.placeType }, responseType: 'blob' }) @@ -475,7 +486,7 @@ export default { if (res.code !== 0) { return this.$message.error(res.msg); } else { - // console.log('获取组织树成功', res.data); + console.log('获取组织树成功', res.data); // let { agencyList, subAgencyList } = res.data; // const _arr = [{ ...agencyList, subAgencyList: [...subAgencyList] }]; // this.orgOptions = this.deepTree(_arr); @@ -489,12 +500,10 @@ export default { }, handleChangeAgency(val) { let obj = this.$refs['myCascader'].getCheckedNodes()[0].data; - console.log(obj); - this.formData.orgId = obj.agencyId; - if (obj.level == 'grid') { - this.orgType = 'grid'; + if (obj) { + this.orgType = obj.level === 'grid' ? 'grid' : 'agency'; } else { - this.orgType = "agency"; + this.orgType = ''; } }, deepTree(arr) {