From 6f129181f390d0a81f1d7d848ac489eca5020a9c Mon Sep 17 00:00:00 2001 From: yanran200730 Date: Fri, 9 Sep 2022 10:06:51 +0800 Subject: [PATCH] bug --- packages/bigscreen/dv/AppXyDv.vue | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/bigscreen/dv/AppXyDv.vue b/packages/bigscreen/dv/AppXyDv.vue index 4694b9b3..0386f822 100644 --- a/packages/bigscreen/dv/AppXyDv.vue +++ b/packages/bigscreen/dv/AppXyDv.vue @@ -139,7 +139,7 @@

{{ girdInfo['村民警员'] || 0 }}

-

村民警员

+

村区民警

{{ girdInfo['居民群'] || 0 }}

@@ -344,7 +344,7 @@ this.initLineChart('.chart2', { x: res.data['群成员数'].map(v => v.month), value: res.data['群成员数'].map(v => v.totalNumber), - name: '居民群' + name: '群成员' }) } }) @@ -427,10 +427,12 @@ this.list = list.map(v => { return { ...v, - rate1: (v['居民群'] / v1 * 100).toFixed(0) + '%', - rate2: (v['群成员'] / v2 * 100).toFixed(0) + '%' + rate1: v1 === 0 ? '0%' : (v['居民群'] / v1 * 100).toFixed(0) + '%', + rate2: v2 === 0 ? '0%' : (v['群成员'] / v2 * 100).toFixed(0) + '%' } }) + } else { + this.list = [] } } }) @@ -440,7 +442,7 @@ if (res.code === 0) { this.girdInfo = res.data.countInfo this.gridList = res.data.groupList - if (res.data.typeInfo) { + if (res.data.typeInfo.length) { this.total = res.data.typeInfo.map(v => v.c).reduce((x, y) => x + y) this.typeList = res.data.typeInfo.map(v => { return { @@ -449,6 +451,9 @@ } }) this.initChart5('.chart10', this.typeList) + } else { + this.total = 0 + this.typeList = [] } } })