From ea7cee49272469f9c2f7936185daa72723ce78d9 Mon Sep 17 00:00:00 2001 From: 13176889840 <13176889840@163.com> Date: Tue, 14 Jun 2022 13:25:40 +0800 Subject: [PATCH] dd --- .../visual/communityParty/community.vue | 7 +- .../modules/visual/communityParty/party.vue | 129 +----------------- 2 files changed, 7 insertions(+), 129 deletions(-) diff --git a/src/views/modules/visual/communityParty/community.vue b/src/views/modules/visual/communityParty/community.vue index 6ae4a114..fcd81bc4 100644 --- a/src/views/modules/visual/communityParty/community.vue +++ b/src/views/modules/visual/communityParty/community.vue @@ -363,7 +363,7 @@ export default { console.log('params------c', params) if (params.seriesIndex == 0 || params.seriesIndex == 2) { this.unitType = '' - // this.getUnitList(this.agencyId) + this.getUnitList(this.agencyId) this.$refs.eduChart.clear() this.noInit = false this.clickEduPie(0) @@ -621,7 +621,7 @@ export default { return { ...item, color: "#00E5ED", - fillColor: "rgba(0, 229, 237, 0.16)" + fillColor: "rgba(0, 229, 237, 0)" } }) @@ -836,7 +836,8 @@ export default { url, params, (data, rspMsg) => { - this.agencyInfo = data + // this.agencyInfo = data + this.agencyInfo = { ...data, agencyLevel: data.level} if (!data.latitude) { this.agencyInfo.latitude = 36.072227 } diff --git a/src/views/modules/visual/communityParty/party.vue b/src/views/modules/visual/communityParty/party.vue index 1530f4f5..016d7e59 100644 --- a/src/views/modules/visual/communityParty/party.vue +++ b/src/views/modules/visual/communityParty/party.vue @@ -319,6 +319,7 @@ export default { if (params.seriesIndex == 0 || params.seriesIndex == 2) { this.ageCode = '' // this.getUnitList(this.agencyId) + this.getAgeList() this.$refs.ageChart.clear() this.noInit = false this.clickAgePie(0) @@ -380,7 +381,7 @@ export default { this.clickEduPie(params.dataIndex) if (params.seriesIndex == 0 || params.seriesIndex == 2) { this.eduCode = '' - // this.getUnitList(this.agencyId) + this.getEduList() this.$refs.eduChart.clear() this.noEduInit = false this.clickEduPie(0) @@ -392,131 +393,7 @@ export default { // option && this.$refs.pieChart.setOption(option); }, - initChartType() { - const eId = document.getElementById('echartType') - let _charts = echarts.init(eId) - - let option = { - tooltip: { - trigger: 'item' - }, - legend: { - show: true, - orient: 'vertical', - top: '20%', - right: 0, - textStyle: { - width: 90, - color: '#fff', - rich: { - a: { - width: 90 - } - } - }, - formatter: name => { - for (let a = 0; a < this.eduItem.length; a++) { - // this.data 这个数据中有名称和次数 - if (this.eduItem[a].name === name) { - //两个名称进行对比,取出对应的次数 - let params1 = name + "\n"; //然后return你需要的legend格式即可 - console.log(params1); - let tmp = params1.split("\n"); - let res = "" + params1; - for (let i in tmp) { - res = res.replace(tmp[i], ""); - } - return res + params1; - } - } - } - }, - title: { - text: '12000', //图形标题,配置在中间对应效果图的80% - subtext: '总数', - left: 196, - top: "center", - textAlign: 'center', - textStyle: { - color: "#fff", - fontSize: 28, - align: "center" - }, - subtextStyle: { - fontSize: 16, - color: '#fff', - align: 'center' - } - }, - series: [ - { - // name: 'Access From', - type: 'pie', - // center: ['50%', '50%'], - radius: ['40%', '60%'], - avoidLabelOverlap: true, - // top: top + '%', - // height: '80%', - // left: 0, - width: 400, - label: { - position: 'outside', - alignTo: 'edge', - formatter: '{a|{c}}\n{r|}\n{name|{b}}', - minMargin: 5, - edgeDistance: 20, - lineHeight: 15, - color: '#fff', - fontSize: 15, - rich: { - name: { - padding: [0, 6, 0, 6] - }, - a: { - fontSize: 15, - color: '#fff', - padding: [0, 6, 0, 6] - }, - r: { - backgroundColor: 'auto', - borderRadius: 6, - width: 6, - height: 6, - // padding: [3, 3, 0, -12] - } - } - }, - emphasis: { - label: { - show: true, - fontSize: '14', - fontWeight: 'bold' - } - }, - labelLine: { - show: true, - length: 20, - length2: 0, - maxSurfaceAngle: 80 - }, - labelLayout: function (params) { - const isLeft = params.labelRect.x < _charts.getWidth() / 2; - const points = params.labelLinePoints; - // Update the end point. - points[2][0] = isLeft - ? params.labelRect.x - : params.labelRect.x + params.labelRect.width; - return { - labelLinePoints: points - }; - }, - data: this.eduItem - } - ] - } - option && _charts.setOption(option); - - }, + clickAgePie (seriesIndex) { let _code = '' let isClick = false