From b2d039a090ab8a84ec87904213b5e714d23aaf62 Mon Sep 17 00:00:00 2001 From: jiangyy Date: Mon, 25 Apr 2022 11:05:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E6=88=BF=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scss/modules/visual/houseStatic.scss | 26 +++- .../basicinfo/houseStatic/houseStatic.vue | 146 +++++++++++++----- .../visual/basicinfo/houseStatic/options.js | 6 +- .../basicinfo/houseStatic/userOptions.js | 6 +- 4 files changed, 139 insertions(+), 45 deletions(-) diff --git a/src/assets/scss/modules/visual/houseStatic.scss b/src/assets/scss/modules/visual/houseStatic.scss index b2985d0a..4d9c6da6 100644 --- a/src/assets/scss/modules/visual/houseStatic.scss +++ b/src/assets/scss/modules/visual/houseStatic.scss @@ -1,3 +1,11 @@ +.warning-box{ + padding: 0 21px 20px 24px +} +.no-data{ + margin-top:50px; + display:flex; + justify-content: center; +} .card-title { display: flex; @@ -205,7 +213,7 @@ width: 100%; display: flex; justify-content: center; - margin-top: 500px; + margin-top: 200px; } @@ -247,12 +255,16 @@ align-items: center; display: flex; justify-content: space-around; + flex-grow:0; + flex-shrink:0; } .item_right{ align-items: center; display: flex; justify-content: space-around; + flex-grow:0; + flex-shrink:0; // margin-left:250px; } @@ -265,8 +277,9 @@ } .pie-table-total{ - margin-left:60px; + margin-left:40px; .pie-table-total-count{ + min-width: 98px; text-align: center; font-size: 40px; font-family: PingFang SC; @@ -295,6 +308,13 @@ color: #2865FA; } + .colorwhite{ + font-size: 35px; + font-family: PingFang SC; + font-weight: bold; + color: #ffffff; + } + .pie-table-title{ margin-top:7px; text-align: center; @@ -311,7 +331,7 @@ } .pie-table-line{ - margin-left:60px; + margin-left:40px; height:30px; width:1px; background-color: #1797FF; diff --git a/src/views/modules/visual/basicinfo/houseStatic/houseStatic.vue b/src/views/modules/visual/basicinfo/houseStatic/houseStatic.vue index 4ca90aff..85b3c7f9 100644 --- a/src/views/modules/visual/basicinfo/houseStatic/houseStatic.vue +++ b/src/views/modules/visual/basicinfo/houseStatic/houseStatic.vue @@ -1,5 +1,17 @@ @@ -192,6 +211,9 @@ export default { dataLoading: true, orgId: '', orgType: '', + orgName: this.$store.state.user.agencyName, + // orgShowName: this.$store.state.user.agencyName,//面包屑显示当前组织名称 + housePieChartS: null, housePieChart: '', @@ -243,11 +265,15 @@ export default { userColorArray: ['#1B51FF', '#00E5ED'], userPieData: [], - subList: [ - { - orgId: '', - } - ] + subList: [], + + //下钻层级记录 + runNum: 0, + runAgencyArray: [], + selUserId: '', + center: [], + zoom: null, + parentPolygon: [], }; }, @@ -286,15 +312,15 @@ export default { this.$refs.housePieChart.showLoading() } - const url = "http://yapi.elinkservice.cn/mock/245/gov/org/house/housechart"; - // const url = '/gov/org/house/housechart' + // const url = "http://yapi.elinkservice.cn/mock/245/gov/org/house/housechart"; + const url = '/gov/org/house/housechart' let params = { orgId: this.orgId, orgType: this.orgType }; const { data, code, msg } = await requestPost(url, params); if (code === 0) { - // this.houseData = data + this.houseData = data if (this.$refs.housePieChart) { this.$refs.housePieChart.hideLoading() } @@ -315,6 +341,7 @@ export default { }, 500) } }, + assignHousePieChart () { if (this.houseData) { @@ -330,16 +357,16 @@ export default { let obj1 = { name: '自住房屋数', - value: 20.1, + value: this.houseData.zzHouseRatio, selected: true } let obj2 = { name: '出租房屋数', - value: 20.3 + value: this.houseData.czHouseRatio } let obj3 = { name: '闲置房屋数', - value: 20 + value: this.houseData.xzHouseRatio } this.housePieData.push(obj1) @@ -368,15 +395,15 @@ export default { if (this.$refs.userPieChart) { this.$refs.userPieChart.showLoading() } - const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/icresiuser/userchart"; - // const url = '/epmetuser/icresiuser/userchart' + // const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/icresiuser/userchart"; + const url = '/epmetuser/icresiuser/userchart' let params = { orgId: this.orgId, orgType: this.orgType }; const { data, code, msg } = await requestPost(url, params); if (code === 0) { - // this.userData = data + this.userData = data if (this.$refs.userPieChart) { this.$refs.userPieChart.hideLoading() } @@ -395,6 +422,7 @@ export default { }, 500) } }, + assignUserPieChart () { if (this.userData) { @@ -410,12 +438,12 @@ export default { let obj1 = { name: '常住人口数', - value: 20.1, + value: this.userData.czUserRatio, selected: true } let obj2 = { name: '流动人口树', - value: 20.3 + value: this.userData.ldUserRatio } this.userPieData.push(obj1) @@ -440,8 +468,8 @@ export default { }, async getSubuserhouselist (node, resolve) { - const url = "http://yapi.elinkservice.cn/mock/245/gov/org/house/subuserhouselist"; - // const url = '/gov/org/house/subuserhouselist' + // const url = "http://yapi.elinkservice.cn/mock/245/gov/org/house/subuserhouselist"; + const url = '/gov/org/house/subuserhouselist' let params = { orgId: this.orgId, orgType: this.orgType @@ -493,6 +521,7 @@ export default { }, + async clickUserPie (seriesIndex) { this.userPieData.forEach((element, index) => { if (index === seriesIndex) { @@ -532,15 +561,55 @@ export default { // this.getTable() }, - hancleToSubAgency (item) { + handleToSubAgency (item) { + + this.toSubAgency(item) + + + this.getApiData() + + }, + + //下钻到下一级 type点击的类型:polygon 点击多边形(分为点击组织/小区) people 点击详情 + async toSubAgency (item) { + + this.runNum++ + let obj = { + orgId: this.orgId, + orgType: this.orgType, + orgName: this.orgName, + } + + this.runAgencyArray.push(obj) this.orgId = item.orgId this.orgType = item.orgType - this.getApiData() + this.orgName = item.orgName + + + }, + + + //返回所选组织 + handleClickAgency (index) { + + const cutNum = this.runAgencyArray.length - index//要减去的长度 + this.runNum = this.runNum - cutNum - } + let orgData = this.runAgencyArray[index] + + for (let i = 0; i < cutNum; i++) { + this.runAgencyArray.pop() + } + + this.orgId = orgData.id + this.orgType = orgData.orgType + this.orgName = orgData.orgName + + this.getApiData() + }, }, }; @@ -551,6 +620,11 @@ export default { src="@/assets/scss/modules/visual/warning.scss" scoped > +