diff --git a/src/apps/AppResidentFile/AppResidentFile.vue b/src/apps/AppResidentFile/AppResidentFile.vue index 768a4302..d737c6f1 100644 --- a/src/apps/AppResidentFile/AppResidentFile.vue +++ b/src/apps/AppResidentFile/AppResidentFile.vue @@ -14,17 +14,17 @@
- {{ counts }} + {{ todayList1.total }} 群成员总数
- {{ todayList.increase }} + {{ todayList1.increase }} 今日入群
- {{ todayList.decrease }} + {{ todayList1.decrease }} 今日退群
@@ -39,17 +39,17 @@
- {{ nums }} + {{ todayList2.total }} 居民总数
- 0 + {{ todayList2.increase }} 今日新增
- 0 + {{ todayList2.decrease }} 今日流失
@@ -162,10 +162,10 @@ export default { currentTabs: 0, tabList: [ { - name: '居民群管理', + name: '居民群统计', }, { - name: '居民管理', + name: '居民统计', }, ], Echarts1: null, @@ -188,9 +188,10 @@ export default { list: [], weekList: [], groupSum: '', - todayList: [], - nums: '', - counts: '', + todayList1: [], + todayList2: [], + counts1: '', + counts2: '', } }, computed: { @@ -261,36 +262,139 @@ export default { getEchart1() { this.$http.post(`/app/wxcp/wxgroup/groupStatistic`).then((res) => { if (res.code === 0) { - this.initEcharts1(res.data.list) this.weekList = res.data.list + this.initEcharts1(this.weekList) this.groupSum = res.data.groupSum - this.todayList = res.data.today - this.counts = Object.values(this.weekList) - .filter((item) => item.total) - .reduce((v, item) => (v += item.total * 1), 0) + this.todayList1 = res.data.today } }) }, // 居民统计 getEchart2() { - this.$http.post(`/app/appresident/queryCustInfoByAreaId?areaId=${this.user.areaId}`).then((res) => { + this.$http.post(`/app/wxcp/wxcustomerlog/customerStatistic?areaId=${this.user.areaId}`).then((res) => { if (res.code === 0) { - this.initEcharts2(res.data['年龄层次']) - this.$nextTick(() => { - this.nums = res.data['总人数'] - }) + this.initEcharts2(res.data.list) + this.todayList2 = res.data.today } }) }, initEcharts1(data) { var option = { + legend: { + data: ['群成员总数', '入群人数', '退群人数'], + y: 'bottom', + }, + color: ['#4A86FD', '#32C5FF', '#FFAA44'], + tooltip: { + trigger: 'axis', + }, grid: { top: '9%', left: '6%', right: '8%', - bottom: '6%', + bottom: '9%', + containLabel: true, + }, + xAxis: { + type: 'category', + data: Object.keys(data).map((e) => e.substring(e.length - 5, e.length)), + axisLine: { + show: true, + lineStyle: { color: '#666' }, + }, + axisLabel: { + show: true, + interval: 0, + }, + axisTick: { + show: false, + }, + }, + yAxis: { + type: 'value', + axisLine: { + show: false, + }, + splitLine: { + show: true, + lineStyle: { + color: '#D8DDE6', + }, + }, + axisLabel: { + show: true, + interval: 0, + }, + axisTick: { + show: false, + }, + }, + series: [ + { + lineStyle: { + normal: { + lineStyle: { + color: '#4A86FD', + }, + }, + }, + color: '#4A86FD', + name: '群成员总数', + type: 'line', + stack: 'Total', + data: Object.values(data).map((e) => e.total), + }, + { + lineStyle: { + normal: { + lineStyle: { + color: '#32C5FF', + }, + }, + }, + color: '#32C5FF', + name: '入群人数', + type: 'line', + stack: 'Total', + data: Object.values(data).map((e) => e.increase), + }, + { + lineStyle: { + normal: { + lineStyle: { + color: '#FFAA44', + }, + }, + }, + color: '#FFAA44', + name: '退群人数', + type: 'line', + stack: 'Total', + data: Object.values(data).map((e) => e.decrease), + }, + ], + } + + option && this.Echarts1.setOption(option) + }, + + initEcharts2(data) { + var options = { + legend: { + data: ['居民总数', '新增居民数', '流失居民数'], + y: 'bottom', + }, + color: ['#4A86FD', '#32C5FF', '#FFAA44'], + tooltip: { + trigger: 'axis', + }, + grid: { + top: '9%', + left: '6%', + right: '8%', + bottom: '9%', containLabel: true, }, xAxis: { @@ -304,15 +408,13 @@ export default { interval: 0, }, axisTick: { - interval: 'auto', + show: false, }, }, yAxis: { type: 'value', axisLine: { - lineStyle: { - color: '#666', - }, + show: false, }, splitLine: { show: true, @@ -324,67 +426,52 @@ export default { show: true, interval: 0, }, - }, - series: [ - { - color: '#0072FF', - barWidth: 30, - data: Object.values(data).map((e) => e.total), - type: 'line', - }, - ], - } - - option && this.Echarts1.setOption(option) - }, - - initEcharts2(data) { - var options = { - grid: { - top: '9%', - left: '6%', - right: '8%', - bottom: '6%', - containLabel: true, - }, - xAxis: { - type: 'category', - data: data.map((v) => v.v1), - axisLine: { - lineStyle: { color: '#157EFF' }, - }, - axisLabel: { - show: true, - interval: 0, - }, axisTick: { - interval: 'auto', - }, - }, - yAxis: { - type: 'value', - axisLine: { - lineStyle: { - color: '#666', - }, - }, - splitLine: { - show: true, - lineStyle: { - color: '#D8DDE6', - }, - }, - axisLabel: { - show: true, - interval: 0, + show: false, }, }, series: [ { - color: '#0072FF', - barWidth: 30, - data: data.map((v) => v.v2), + lineStyle: { + normal: { + lineStyle: { + color: '#4A86FD', + }, + }, + }, + color: '#4A86FD', + name: '居民总数', type: 'line', + stack: 'Total', + data: Object.values(data).map((e) => e.total), + }, + { + lineStyle: { + normal: { + lineStyle: { + color: '#32C5FF', + }, + }, + }, + color: '#32C5FF', + name: '新增居民数', + type: 'line', + stack: 'Total', + data: Object.values(data).map((e) => e.increase), + }, + { + lineStyle: { + normal: { + lineStyle: { + color: '#FFAA44', + }, + }, + }, + color: '#FFAA44', + name: '流失居民数', + type: 'line', + stack: 'Total', + data: Object.values(data).map((e) => e.decrease), }, ], } @@ -524,6 +611,7 @@ uni-page-body { .echartes { margin-top: 64px; + padding-bottom: 20px; height: 616px; background: #fff; box-sizing: border-box; diff --git a/src/apps/AppVideoSurveillance/AppVideoSurveillance.vue b/src/apps/AppVideoSurveillance/AppVideoSurveillance.vue index 2915dd85..070b7d37 100644 --- a/src/apps/AppVideoSurveillance/AppVideoSurveillance.vue +++ b/src/apps/AppVideoSurveillance/AppVideoSurveillance.vue @@ -15,11 +15,27 @@
-
- 在线 {{count.online || 0}} - 离线 {{count.sum - count.online || 0}} -
+
+ +
+
+ +
+
+

{{count.online || 0}}

+

在线

+
+
+

{{count.sum - count.online || 0}}

+

离线

+
+
+

{{onlineRate*100 || 0}}%

+

在线率

+
+