{{ item.name }}
@@ -91,7 +91,7 @@
-
+
@@ -242,7 +242,9 @@ export default {
orgId: '',
purpose: '',
rentFlag: '',
- orgIdPath: ''
+ orgIdPath: '',
+ chartDataData:[],
+ chartData2Data:[]
};
},
computed: {
@@ -413,6 +415,7 @@ export default {
radio: item.count == 0 ? '0' : ((item.count / this.pieData.total) * 100).toFixed(2)
};
});
+ this.chartDataData=this.chartData.data ;
this.$forceUpdate();
this.iniPieChart(this.chartData);
},
@@ -433,6 +436,7 @@ export default {
radio: item.count == 0 ? '0' : ((item.count / this.pieData2.total) * 100).toFixed(2)
};
});
+ this.chartData2Data=this.chartData2.data ;
this.$forceUpdate();
this.iniPieChart2(this.chartData2);
},
diff --git a/src/views/modules/census/census-residentList.vue b/src/views/modules/census/census-residentList.vue
index a6368f6a3..68b23a91a 100644
--- a/src/views/modules/census/census-residentList.vue
+++ b/src/views/modules/census/census-residentList.vue
@@ -40,7 +40,7 @@



-
+
{{ item.name }}
@@ -69,7 +69,7 @@
-
+
{{ item.name }}
@@ -211,7 +211,9 @@ export default {
code: '',
pieDatatotal: 0,
pieDatatotal2: 0,
- codeType: 'education'
+ codeType: 'education',
+ chartDataData: [],
+ chartData2Data: []
};
},
computed: {
@@ -362,34 +364,35 @@ export default {
}
},
setPieData() {
- let data = [...this.pieData];
- this.pieDatatotal = data
- .map(item => item.totalResi)
- .reduce(function(prev, cur, index, arr) {
- console.log(prev, cur, index);
- return prev + cur;
- });
+ let data = [...this.pieData.list];
+ // this.pieDatatotal = data
+ // .map(item => item.totalResi)
+ // .reduce(function(prev, cur, index, arr) {
+ // console.log(prev, cur, index);
+ // return prev + cur;
+ // });
this.chartData.name = data.map(item => item.codeName);
this.chartData.data = data.map(item => {
return {
value: item.totalResi,
name: item.codeName,
code: item.code,
- radio: item.totalResi == 0 ? '0' : ((item.totalResi / this.pieDatatotal) * 100).toFixed(2)
+ radio: item.totalResi == 0 ? '0' : ((item.totalResi / this.pieData.total) * 100).toFixed(2)
};
});
+ this.chartDataData = this.chartData.data;
console.log('chartData', this.chartData);
this.iniPieChart(this.chartData);
},
setPieData2() {
- let data = [...this.pieData2];
+ let data = [...this.pieData2.list];
- this.pieDatatotal2 = data
- .map(item => item.totalResi)
- .reduce(function(prev, cur, index, arr) {
- console.log(prev, cur, index);
- return prev + cur;
- });
+ // this.pieDatatotal2 = data
+ // .map(item => item.totalResi)
+ // .reduce(function(prev, cur, index, arr) {
+ // console.log(prev, cur, index);
+ // return prev + cur;
+ // });
this.chartData2.name = data.map(item => item.codeName);
this.chartData2.data = data.map(item => {
@@ -397,10 +400,10 @@ export default {
value: item.totalResi,
name: item.codeName,
code: item.code,
- radio: item.totalResi == 0 ? '0' : ((item.totalResi / this.pieDatatotal2) * 100).toFixed(2)
+ radio: item.totalResi == 0 ? '0' : ((item.totalResi / this.pieData2.total) * 100).toFixed(2)
};
});
-
+ this.chartData2Data = this.chartData2.data;
console.log('chartData', this.chartData2);
this.iniPieChart2(this.chartData2);
},
@@ -420,7 +423,7 @@ export default {
},
color: this.color,
title: {
- text: this.pieDatatotal,
+ text: this.pieData.total,
subtext: '总数',
x: 'center',
y: 'center',
@@ -530,7 +533,7 @@ export default {
},
color: this.color,
title: {
- text: this.pieDatatotal2,
+ text: this.pieData2.total,
subtext: '总数',
x: 'center',
y: 'center',
diff --git a/src/views/modules/communityParty/dyhx/party.vue b/src/views/modules/communityParty/dyhx/party.vue
index 46555b69e..87f84974f 100644
--- a/src/views/modules/communityParty/dyhx/party.vue
+++ b/src/views/modules/communityParty/dyhx/party.vue
@@ -37,7 +37,7 @@
-
+
{{ item.name }}
@@ -103,7 +103,7 @@
-
+
{{ item.name }}
@@ -269,7 +269,9 @@ export default {
pieEduOptions: null,
formData: {
orgId: ''
- }
+ },
+ chartDataData: [],
+ chartData2Data: []
};
},
computed: {
@@ -671,7 +673,7 @@ export default {
console.log(prev, cur, index);
return prev + cur;
});
- console.log('this.pieDatatotal',this.pieDatatotal);
+ console.log('this.pieDatatotal', this.pieDatatotal);
this.chartData.name = data.map(item => item.value);
this.chartData.data = data.map(item => {
return {
@@ -681,6 +683,7 @@ export default {
radio: item.radio
};
});
+ this.chartDataData = this.chartData.data;
console.log('chartData', this.chartData);
this.$forceUpdate();
this.initAgeCharts(this.chartData);
@@ -705,7 +708,7 @@ export default {
radio: item.radio
};
});
-
+ this.chartData2Data = this.chartData2.data;
console.log('chartData', this.chartData2);
this.$forceUpdate();
this.initEduCharts(this.chartData2);
@@ -1026,5 +1029,4 @@ export default {
}
}
}
-