From ba1c64abd86416f2c70d37c709ec5853a7d6199e Mon Sep 17 00:00:00 2001 From: mk <2403457699@qq.com> Date: Thu, 30 Nov 2023 18:18:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=8D=E6=94=B9=E4=B8=A4=E4=B8=AAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/screenRight/right2.vue | 2 +- src/views/screenRight/right3.vue | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/views/screenRight/right2.vue b/src/views/screenRight/right2.vue index 521ab5c..3ee88a3 100644 --- a/src/views/screenRight/right2.vue +++ b/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); diff --git a/src/views/screenRight/right3.vue b/src/views/screenRight/right3.vue index 83b74fa..1d70e8e 100644 --- a/src/views/screenRight/right3.vue +++ b/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); }, } }