Browse Source

修改交互统计数据展示方式

vothin 2 năm trước cách đây
mục cha
commit
fa45e99e75
1 tập tin đã thay đổi với 15 bổ sung2 xóa
  1. 15 2
      src/views/ncs-chars/index.vue

+ 15 - 2
src/views/ncs-chars/index.vue

@@ -166,6 +166,7 @@ import CountTo from 'vue-count-to'
 import * as API_interaction from '@/api/ncs_interaction'
 import Storage from '@/utils/storage'
 import myInfo from '@/views/ncs-chars/info'
+import {TCP_TYPE} from "@/utils/enum/TcpTypeEnum";
 
 export default {
   name: 'Index',
@@ -224,6 +225,8 @@ export default {
         } else {
           _this.partTotal.count = res.count
           _this.partTotal.noCount = res.noCount
+          _this.btListNameToStr(res.btList)
+          _this.btListNameToStr(res.noBtList)
           _this.buildTable(res.btList, res.noBtList)
           _this.buildBtChart(res.btList, res.noBtList) // 饼图
           _this.buildChart(res.dataList, res.tilStr, res.xAxis, 'chart', this.$t('interaction.dataCensus'))
@@ -236,10 +239,12 @@ export default {
       this.dataList.forEach(item => {
         let count = 0
         let noCount = 0
+        // const data = btList.find(p => TCP_TYPE.getDescFromValue(p.name) === item)
         const data = btList.find(p => p.name === item)
         if (data) {
           count = data.value
         }
+        // const noData = noBtList.find(p => TCP_TYPE.getDescFromValue(p.name) === item)
         const noData = noBtList.find(p => p.name === item)
         if (noData) {
           noCount = noData.value
@@ -258,7 +263,7 @@ export default {
       if (dataList.length > 0) {
         dataList.forEach((item, index) => {
           const d = {
-            name: tilStr[index],
+            name: TCP_TYPE.getDescFromValue(tilStr[index]),
             type: 'line',
             stack: this.$t('interaction.total') + index,
             data: item,
@@ -284,7 +289,7 @@ export default {
         //   top: 'bottom'
         // },
         legend: {
-          data: tilStr
+          data: TCP_TYPE.getDescFromValue(tilStr)
         },
         grid: {
           left: '3%',
@@ -491,6 +496,8 @@ export default {
           return this.$t('tcpType.ENTRACEGUARD')
         case 'SOS':
           return this.$t('tcpType.SOS')
+        case 'PHONE':
+          return this.$t('tcpType.PHONE')
         default:
           return this.$t('tcpType.UNKNOWN')
       }
@@ -589,6 +596,12 @@ export default {
           return v[j]
         }
       }))
+    },
+    btListNameToStr(btList) {
+      console.log(btList)
+      btList = btList.forEach(p => p.name = TCP_TYPE.getDescFromValue(p.name))
+      // console.log(btList)
+      // return btList
     }
   }