Browse Source

再改两个bug

master
mk 2 years ago
parent
commit
ba1c64abd8
  1. 2
      src/views/screenRight/right2.vue
  2. 16
      src/views/screenRight/right3.vue

2
src/views/screenRight/right2.vue

@ -254,7 +254,7 @@ export default {
const xylProportion = parseFloat(this.xylProportion) || 0;
const evaluationProportion = parseFloat(this.evaluationProportion) || 0;
const resolveProportion = parseFloat(this.resolveProportion) || 0;
this.proportion = (hflProportion + xylProportion + evaluationProportion + resolveProportion) / 4;
this.proportion = ((hflProportion + xylProportion + evaluationProportion + resolveProportion) / 4).toFixed(2);
await this.getPieChart()
} catch (error) {
console.error('Error fetching data:', error);

16
src/views/screenRight/right3.vue

@ -179,7 +179,6 @@ export default {
_this.$nextTick(function () {
this.renderChart()
this.renderCharts()
this.initList()
});
},
watch: {
@ -201,7 +200,6 @@ export default {
this.getCategoryAnalysis()
this.getEventStat()
this.getEvaluationTotal()
this.initList()
this.renderChart()
this.renderCharts()
}
@ -243,6 +241,7 @@ export default {
let { data, code, msg } = await getEventStat(parm)
if (code == 0) {
this.eventStatList = data
this.initList(data)
if(this.eventStatList.length === 0){
this.noData = true
}
@ -502,27 +501,28 @@ export default {
}
}, 5000)
},
initList() {
initList(data) {
//
if(this.eventStatList.length === 0)return
this.totalLivelihoodCount = this.eventStatList.reduce((sum, element) => {
if(data.length === 0) return
this.totalLivelihoodCount = data.reduce((sum, element) => {
return sum + element.livelihoodCount;
}, 0);
//
this.developCountTotal = this.eventStatList.reduce((sum, element) => {
this.developCountTotal = data.reduce((sum, element) => {
return sum + element.developCount;
}, 0);
//
this.lawCountCountTotal = this.eventStatList.reduce((sum, element) => {
this.lawCountCountTotal = data.reduce((sum, element) => {
return sum + element.lawCount;
}, 0);
this.eventStatList = this.eventStatList.map(element => [
this.eventStatList = data.map(element => [
element.deptName,
element.eventCount,
element.livelihoodCount,
element.developCount,
element.lawCount,
]);
console.log(this.eventStatList);
},
}
}

Loading…
Cancel
Save