回复率

This commit is contained in:
shijingjing
2022-12-23 08:52:03 +08:00
parent b3aafd8b89
commit 04dc59e84c

View File

@@ -68,7 +68,6 @@ export default {
name: 'message',
data() {
return {
replyData: {},
privateCard: {},
privateData: [],
privateDate: [],
@@ -79,18 +78,18 @@ export default {
groupDate: [],
groupMsg: [],
groupCurrent: 0,
replyData: {},
}
},
created() {
this.getData()
},
onShow() {
},
mounted() {
this.getEcharts1()
this.getEcharts2()
this.getEcharts3()
// this.getPrivateChat()
// this.getGroupChat()
console.log(this.replyData.replyPercentage,'hhhh');
this.getPrivateChat()
this.getGroupChat()
},
methods: {
getData() {
@@ -98,7 +97,9 @@ export default {
this.$http.post(`/app/wxgroupstatistic/replyPercentage`).then(res=> {
if(res?.data) {
this.replyData = res.data
this.$forceUpdate()
this.getEcharts1(this.replyData)
this.getEcharts2(this.replyData)
this.getEcharts3(this.replyData)
}
})
this.getPrivateData()
@@ -137,16 +138,16 @@ export default {
}
})
},
getEcharts1() {
getEcharts1({replyPercentage}) {
let echarts1 = document.getElementById('echarts1');
let myChart1 = echarts.init(echarts1);
let option = {
tooltip: {
trigger: 'item',
},
// tooltip: {
// trigger: 'item',
// },
title: {
zlevel: 0,
text: [`{name|昨日}\n{value|${ this.replyData.replyPercentage } %}`],
text: [`{name|昨日}\n{value|${ replyPercentage } %}`],
top: 'center',
left: '46%',
textAlign: 'center',
@@ -165,7 +166,7 @@ export default {
},
},
},
color: ['#3975C6','#5d5c5c'],
color: ['#3975C6','#C7C7C7'],
series: [
{
name: '昨天',
@@ -177,24 +178,24 @@ export default {
show: false,
},
data: [
{ value: this.replyData.replyPercentage, name: '已回复聊天比' },
{ value: 100 - this.replyData.replyPercentage, name: '未回复聊天比' },
{ value: replyPercentage, name: '' },
{ value: 100 - replyPercentage, name: '' },
]
}
]
};
option && myChart1.setOption(option);
},
getEcharts2() {
getEcharts2({weekSum}) {
let echarts2 = document.getElementById('echarts2');
let myChart2 = echarts.init(echarts2);
let option = {
tooltip: {
trigger: "item",
},
// tooltip: {
// trigger: "item",
// },
title: {
zlevel: 0,
text: [`{name|近7天}\n{value|${ this.replyData.weekSum } %}`],
text: [`{name|近7天}\n{value|${ weekSum } %}`],
top: 'center',
left: '46%',
textAlign: 'center',
@@ -225,24 +226,24 @@ export default {
show: false,
},
data: [
{ value: this.replyData.weekSum, name: '近7天回复率' },
{ value: 100 - this.replyData.weekSum, name: '近7天未回复率' },
{ value: weekSum, name: '' },
{ value: 100 - weekSum, name: '' },
]
}
]
};
option && myChart2.setOption(option);
},
getEcharts3() {
getEcharts3({monthSum}) {
let echarts3 = document.getElementById('echarts3');
let myChart3 = echarts.init(echarts3);
let option = {
tooltip: {
trigger: "item",
},
// tooltip: {
// trigger: "item",
// },
title: {
zlevel: 0,
text: [`{name|近30天}\n{value|${ this.replyData.monthSum } %}`],
text: [`{name|近30天}\n{value|${ monthSum } %}`],
top: 'center',
left: '46%',
textAlign: 'center',
@@ -261,7 +262,7 @@ export default {
},
},
},
color: ['#3975C6','#F0F2F5'],
color: ['#3975C6','#C7C7C7'],
series: [
{
name: '近30天',
@@ -273,8 +274,8 @@ export default {
show: false,
},
data: [
{ value: this.replyData.monthSum, name: '近一个月回复率' },
{ value: 100 - this.replyData.monthSum, name: '近一个月未回复率' },
{ value: monthSum, name: '' },
{ value: 100 - monthSum, name: '' },
]
}
]