|
@@ -103,21 +103,18 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.initChart();
|
|
|
- })
|
|
|
},
|
|
|
watch: {
|
|
|
statistics: {
|
|
|
deep: true,
|
|
|
immediate: true, // 监听到后,立即执行 handler方法
|
|
|
handler: function (newVal, oldVal) {
|
|
|
- this.statisticsList = newVal
|
|
|
+ this.statistics = newVal
|
|
|
this.option.series[0].data=[];
|
|
|
this.option.series[1].data=[];
|
|
|
this.option.series[2].data=[];
|
|
|
this.option.yAxis.data=[];
|
|
|
- this.statisticsList.forEach(item => {
|
|
|
+ this.statistics.forEach(item => {
|
|
|
if (item.plantName != '合计') {
|
|
|
this.option.series[0].data.push(item.yzxlCount);
|
|
|
this.option.series[1].data.push(item.ybxlCount);
|
|
@@ -125,7 +122,9 @@ export default {
|
|
|
this.option.yAxis.data.push(item.plantName);
|
|
|
}
|
|
|
})
|
|
|
- this.initChart();
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.initChart()
|
|
|
+ })
|
|
|
},
|
|
|
}
|
|
|
},
|