From d6d6d0790f4f4a1f2e422d57a95c3d24c4cdf654 Mon Sep 17 00:00:00 2001 From: liuye Date: Tue, 22 Aug 2023 17:18:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/sensitive.vue | 90 ++++++------------- 1 file changed, 29 insertions(+), 61 deletions(-) diff --git a/src/project/xbot/AppDataStatistics/components/sensitive.vue b/src/project/xbot/AppDataStatistics/components/sensitive.vue index a1c1fe96..9963761e 100644 --- a/src/project/xbot/AppDataStatistics/components/sensitive.vue +++ b/src/project/xbot/AppDataStatistics/components/sensitive.vue @@ -6,13 +6,8 @@
{{ Number(info.recordSum) }}
-
群聊敏感词
-
{{ Number(info.groupRecordSum) }}
-
-
-
私聊敏感词
-
{{ Number(info.personRecordSum) }}
- +
本月群聊敏感词
+
{{ Number(info.recordNowMonthSum) }}
@@ -29,7 +24,7 @@
- 单聊敏感词统计 + 敏感词分类统计
@@ -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); },