Browse Source

dd

shibei_master
13176889840 3 years ago
parent
commit
ea7cee4927
  1. 7
      src/views/modules/visual/communityParty/community.vue
  2. 127
      src/views/modules/visual/communityParty/party.vue

7
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
}

127
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"; //returnlegend
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

Loading…
Cancel
Save