From f2807e77d3eb0d5876eff809cfbb15ca0cadae42 Mon Sep 17 00:00:00 2001 From: shijingjing <1789544664@qq.com> Date: Thu, 22 Dec 2022 15:31:49 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AppDataStatistics/components/message.vue | 47 +++++++++++++++--- .../AppDataStatistics/components/resident.vue | 23 +++++---- .../AppDataStatistics/components/wechat.vue | 49 +++++++++++++++---- 3 files changed, 92 insertions(+), 27 deletions(-) diff --git a/src/project/saas/AppDataStatistics/components/message.vue b/src/project/saas/AppDataStatistics/components/message.vue index 136cd589..81479f8c 100644 --- a/src/project/saas/AppDataStatistics/components/message.vue +++ b/src/project/saas/AppDataStatistics/components/message.vue @@ -16,12 +16,14 @@
-
居民好友
-
{{ (235625).toLocaleString('en-US') }}
+
单聊会话
+
{{ Number(privateCard.chatCnt).toLocaleString('en-US') }}
+
0
单聊消息
-
235
+
{{ Number(privateCard.messageCnt).toLocaleString('en-US') }}
+
0
@@ -36,15 +38,18 @@
活跃群聊
-
111
+
{{ Number(groupCard.chatHasMsg).toLocaleString('en-US') }}
+
0
活跃群成员
-
235
+
{{ Number(groupCard.memberHasMsg).toLocaleString('en-US') }}
+
0
群聊消息
-
{{ (235625).toLocaleString('en-US') }}
+
{{ Number(groupCard.msgTotal).toLocaleString('en-US') }}
+
0
@@ -61,9 +66,15 @@ export default { name: 'message', data() { return { - + privateCard: {}, + privateData: [], + groupCard: {}, + groupData: [], } }, + created() { + this.getData() + }, mounted() { this.getEcharts1() this.getEcharts2() @@ -72,6 +83,28 @@ export default { this.getGroupChat() }, methods: { + getData() { + // 回复率 + this.$http.post(`/app/wxgroupstatistic/replyPercentage`).then(res=> { + if(res?.data) { + console.log(res); + } + }) + // 单聊统计 + this.$http.post('/app/wxgroupstatistic/getUserChatNumber').then(res=> { + if(res?.data) { + this.privateCard = res.data.单聊总和 + this.privateData = res.data.条形统计 + } + }) + // 群聊统计 + this.$http.post('/app/wxgroupstatistic/getgroupChatNumber').then(res=> { + if(res?.data) { + this.groupCard = res.data.群聊总和 + this.groupData = res.data.条形统计 + } + }) + }, getEcharts1() { let echarts1 = document.getElementById('echarts1'); let myChart = echarts.init(echarts1); diff --git a/src/project/saas/AppDataStatistics/components/resident.vue b/src/project/saas/AppDataStatistics/components/resident.vue index 340942f9..8b6a6cb8 100644 --- a/src/project/saas/AppDataStatistics/components/resident.vue +++ b/src/project/saas/AppDataStatistics/components/resident.vue @@ -19,7 +19,8 @@

年龄分布

-
+
+
@@ -44,6 +45,7 @@ export default { specialPeople: {}, specialFlag: true, ageArray: [], + ageFlag: true, sexArray: [], sexFlag: true, cardArray: ['居民总数','本地居民','流动人口'] @@ -68,8 +70,10 @@ export default { this.specialFlag = false } } - this.ageArray = res.data.年龄层次 - this.aexArray = res.data.男女比例 + this.ageArray = res.data.年龄层次.map(v=> v.v2) + this.ageFlag = !this.ageArray.every(e=> e==0) + this.sexArray = res.data.男女比例.map(v=> v.v2) + this.sexFlag = !this.sexArray.every(e=> e==0) } }) }, @@ -159,16 +163,15 @@ export default { }, series: [ { - data: [136, 195, 162, 138, { - value: 98, - itemStyle: { - color: '#F3A963' - } - }], + data: this.ageArray, type: 'bar', itemStyle: { normal: { - color: "#3975C6", + // 每个柱子的颜色 + color: function(params) { + var colorList = ['#3975C6','#3975C6', '#3975C6', '#3975C6', '#F3A963',]; + return colorList[params.dataIndex] + }, label: { show: true, //开启显示 position: 'top', //在上方显示 diff --git a/src/project/saas/AppDataStatistics/components/wechat.vue b/src/project/saas/AppDataStatistics/components/wechat.vue index 6b6f59f2..8e10499b 100644 --- a/src/project/saas/AppDataStatistics/components/wechat.vue +++ b/src/project/saas/AppDataStatistics/components/wechat.vue @@ -7,20 +7,24 @@
居民好友
-
{{ (235625).toLocaleString('en-US') }}
+
{{ Number(friendsCard.customerTotal).toLocaleString('en-US') }}
昨日新增
-
235
+
{{ Number(friendsCard.addCustomerCount).toLocaleString('en-US') }} + +
昨日流失
-
18
+
{{ Number(friendsCard.removeCustomerCount).toLocaleString('en-US') }} +
-
+
+
@@ -30,24 +34,27 @@
居民群
-
{{ (5230).toLocaleString('en-US') }}
+
{{ Number(groupsCard.groupSum).toLocaleString('en-US') }}
群成员
-
235
+
{{ Number(groupsCard.totalSum).toLocaleString('en-US') }}
昨日新增
-
18
+
{{ Number(groupsCard.increaseSum).toLocaleString('en-US') }} +
昨日流失
-
18
+
{{ Number(groupsCard.decreaseSum).toLocaleString('en-US') }} +
-
+
+
@@ -58,14 +65,36 @@ export default { name: "wechat", data() { return { - + friendsCard: {}, + friendsData: [], + groupsCard: {}, + groupsData: [], } }, + created() { + this.getData() + }, mounted() { this.getFriendsEcharts() this.getGroupsEcharts() }, methods: { + getData() { + // 居民好友 + this.$http.post(`/app/wxgroupstatistic/getCustommerNumber`).then(res=> { + if(res?.data) { + this.friendsCard = res.data.居民统计 + this.friendsData = res.data.居民好友数 + } + }) + // 居民群 + this.$http.post(`/app/wxgroupstatistic/getGroupNumber`).then(res=> { + if(res?.data) { + this.groupsCard = res.data.居民群统计 + this.groupsData = res.data.群成员数 + } + }) + }, getFriendsEcharts() { let friendsDom = document.getElementById('friends'); let myChart = echarts.init(friendsDom);