消息统计

This commit is contained in:
shijingjing
2023-01-04 14:15:44 +08:00
parent 87b0fa4440
commit 5300fa6f08
2 changed files with 28 additions and 16 deletions

View File

@@ -28,7 +28,7 @@
</div>
<div class="privateChat_box">
<div id="privateChat" v-if="privateData.length"></div>
<div id="privateChat" v-if="privateData.length > 0"></div>
<AiEmpty style="padding-top: 10px;" description="暂无数据" v-else></AiEmpty>
</div>
@@ -55,7 +55,7 @@
</div>
<div class="groupChat_box">
<div id="groupChat" v-if="groupData.length"></div>
<div id="groupChat" v-if="groupData.length > 0"></div>
<AiEmpty style="padding-top: 10px;" description="暂无数据" v-else></AiEmpty>
</div>
@@ -84,10 +84,6 @@ export default {
created() {
this.getData()
},
mounted() {
this.getPrivateChat()
this.getGroupChat()
},
methods: {
getData() {
// 回复率
@@ -114,6 +110,9 @@ export default {
} else if(this.privateCurrent == 1) {
this.privateMsg = this.privateData?.map(v=> v.messageCnt)
}
this.$nextTick(()=> {
this.getPrivateChat(this.privateDate,this.privateMsg)
})
}
})
},
@@ -131,6 +130,9 @@ export default {
} else if(this.groupCurrent == 2) {
this.groupMsg = this.groupData?.map(v=>v.msgTotal)
}
this.$nextTick(()=> {
this.getGroupChat(this.groupDate,this.groupMsg)
})
}
})
},
@@ -278,7 +280,7 @@ export default {
};
option && myChart3.setOption(option);
},
getPrivateChat() {
getPrivateChat(privateDate,privateMsg) {
let privateDom = document.getElementById('privateChat');
let myChartPrivate = echarts.init(privateDom);
let option = {
@@ -287,7 +289,7 @@ export default {
},
xAxis: {
type: 'category',
data: this.privateDate,
data: privateDate,
axisTick: {
show: false,
}
@@ -303,7 +305,7 @@ export default {
},
series: [
{
data: this.privateMsg,
data: privateMsg,
type: 'line',
lineStyle: {
color: '#3975C6', // 折线线条颜色
@@ -336,7 +338,7 @@ export default {
};
option && myChartPrivate.setOption(option);
},
getGroupChat() {
getGroupChat(groupDate,groupMsg) {
let groupDom = document.getElementById('groupChat');
let myChartGroup = echarts.init(groupDom);
let option = {
@@ -345,7 +347,7 @@ export default {
},
xAxis: {
type: 'category',
data: this.groupDate,
data: groupDate,
axisTick: {
show: false,
}
@@ -361,7 +363,7 @@ export default {
},
series: [
{
data: this.groupMsg,
data: groupMsg,
type: 'line',
lineStyle: {
color: '#3975C6', // 折线线条颜色

View File

@@ -87,7 +87,9 @@ export default {
this.friendsData = res.data.居民好友数
this.friendsMonth = this.friendsData.map(e=> e.month)
this.friendsNumber = this.friendsData.map(e=> e.totalNumber)
this.getFriendsEcharts(this.friendsMonth,this.friendsNumber)
this.$nextTick(()=> {
this.getFriendsEcharts(this.friendsMonth,this.friendsNumber)
})
}
})
// 居民群
@@ -96,10 +98,10 @@ export default {
this.groupsCard = res.data.居民群统计
this.groupsData = res.data.群成员数
this.groupsMonth = this.groupsData.map(e=> e.month)
// this.groupsMonth = ['2022-09','2022-10','2022-12','2023-01']
this.groupsNumber = this.groupsData.map(e=> e.totalNumber)
// this.groupsNumber = ['6','6','7','7']
this.getGroupsEcharts(this.groupsMonth,this.groupsNumber)
this.$nextTick(()=> {
this.getGroupsEcharts(this.groupsMonth,this.groupsNumber)
})
}
})
},
@@ -126,6 +128,10 @@ export default {
show: false,
}
},
grid:{
x:50,
y:50,
},
series: [
{
data: friendsNumber,
@@ -184,6 +190,10 @@ export default {
show: false,
}
},
grid:{
x:50,
y:50,
},
series: [
{
data: groupsNumber,