This commit is contained in:
yanran200730
2022-09-09 10:06:51 +08:00
parent f6ab2c9306
commit 6f129181f3

View File

@@ -139,7 +139,7 @@
<div class="item-wrapper">
<div class="item-top__item">
<h2>{{ girdInfo['村民警员'] || 0 }}</h2>
<p>村民警</p>
<p>民警</p>
</div>
<div class="item-top__item">
<h2>{{ girdInfo['居民群'] || 0 }}</h2>
@@ -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 = []
}
}
})