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 xylProportion = parseFloat(this.xylProportion) || 0;
const evaluationProportion = parseFloat(this.evaluationProportion) || 0; const evaluationProportion = parseFloat(this.evaluationProportion) || 0;
const resolveProportion = parseFloat(this.resolveProportion) || 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() await this.getPieChart()
} catch (error) { } catch (error) {
console.error('Error fetching data:', error); console.error('Error fetching data:', error);

16
src/views/screenRight/right3.vue

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

Loading…
Cancel
Save