数据统计

This commit is contained in:
liuye
2023-08-22 17:18:23 +08:00
parent a380648a12
commit d6d6d0790f

View File

@@ -6,13 +6,8 @@
<div class="item_num">{{ Number(info.recordSum) }}</div>
</div>
<div class="item">
<div class="item_name">群聊敏感词</div>
<div class="item_num">{{ Number(info.groupRecordSum) }}</div>
</div>
<div class="item">
<div class="item_name">私聊敏感词</div>
<div class="item_num">{{ Number(info.personRecordSum) }}</div>
<!-- <img src="../img/down.png" alt="" class="imgs" v-show="info.personRecordSum !=0"> -->
<div class="item_name">本月群聊敏感词</div>
<div class="item_num">{{ Number(info.recordNowMonthSum) }}</div>
</div>
</div>
@@ -29,7 +24,7 @@
</div>
<div class="head">
<span>单聊敏感词统计</span>
<span>敏感词分类统计</span>
</div>
<div class="groups_box">
<div id="user" v-if="userData.length > 0"></div>
@@ -70,7 +65,7 @@ export default {
getData() {
this.$http
.post(
`/app/appsessionarchivekeywordrecord/getKeywordRecordStatistic?departmentId=${this.departmentId}`
`/app/appsessionarchivekeywordrecord/getKeywordRecordStatisticForXbot?departmentId=${this.departmentId}`
)
.then((res) => {
if (res?.data) {
@@ -78,16 +73,16 @@ export default {
var groupMonth = res.data.groupRecordListMap.map((e) => e.dateDay);
this.groupData = res.data.groupRecordListMap.map((e) => e.cnt);
var userMonth = res.data.personRecordListMap.map((e) => e.dateDay);
this.userData = res.data.personRecordListMap.map((e) => e.cnt);
// var userMonth = res.data.personRecordListMap.map((e) => e.dateDay);
this.userData = res.data.typeListMap.map((e) => e.c);
var wordNameList = res.data.typeListMap.map((e) => e.word_name);
res.data.wordNames.map((item) => {
var i = { name: item.wordName, value: item.wordCount };
this.wordData.push(i);
});
this.$nextTick(() => {
this.getGroupEcharts(groupMonth, this.groupData);
this.getUserEcharts(userMonth, this.userData);
this.getUserEcharts(wordNameList, this.userData);
if (this.wordData) {
this.getKeyWordEcharts(this.wordData);
}
@@ -159,65 +154,38 @@ export default {
option && groupChart.setOption(option);
},
getUserEcharts(userMonth, userData) {
console.log(userMonth, userData)
let userDom = document.getElementById("user");
let userChart = echarts.init(userDom);
let option = {
tooltip: {
trigger: "axis",
},
xAxis: {
type: "category",
data: userMonth,
axisTick: {
show: false,
},
type: 'category',
data: userMonth
},
yAxis: {
type: "value",
axisLine: {
show: false,
},
axisTick: {
show: false,
},
},
grid: {
x: 50,
y: 50,
type: 'value'
},
series: [
{
data: userData,
type: "line",
lineStyle: {
color: "#3975C6", // 折线线条颜色
},
itemStyle: {
color: "#3975C6", // 折角颜色
normal: {
color: ['#0072FF'],
label: {
show: true, //开启显示数值
position: 'top', //数值在上方显示
textStyle: { //数值样式
color: '#919191', //字体颜色
fontSize: 14 //字体大小
}
}
}
},
areaStyle: {
color: {
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
// 渐变颜色
{
offset: 0,
color: "#2891ff33",
},
{
offset: 1,
color: "#2891ff00",
},
],
global: false,
},
},
},
],
data: userData,
type: 'bar',
barWidth : 20,
}
]
};
option && userChart.setOption(option);
},