From 3834d30a6d56ad7c4d4f5fe630af649ab6826428 Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期日, 28 八月 2022 22:25:58 +0800
Subject: [PATCH] 修复管理中心首页分析项

---
 src/views/manageCenter/index.vue |   35 ++++++++++++++++++++---------------
 1 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/src/views/manageCenter/index.vue b/src/views/manageCenter/index.vue
index b4893c6..c8914db 100644
--- a/src/views/manageCenter/index.vue
+++ b/src/views/manageCenter/index.vue
@@ -258,10 +258,9 @@
         return this.productList
       }
 
-      return this.productList.filter(item => {
+      return this.productList.filter((item) => {
         return user.permissions.indexOf(item.permission) >= 0
       })
-
     }
   },
   data() {
@@ -308,7 +307,7 @@
         },
         {
           name: "缁熻鍒嗘瀽",
-          icon: "/images/manageCenter/search.png",
+          icon: "/images/manageCenter/datav.png",
           openPath: "/dataView",
           path: "/dataView",
           permission: "dataViewMng"
@@ -316,7 +315,7 @@
 
         {
           name: "鎺ㄩ�佺鐞�",
-          icon: "/images/manageCenter/manage2.png",
+          icon: "/images/manageCenter/push.png",
           openPath: "/report",
           path: "/report",
           permission: "dataPushMng"
@@ -324,7 +323,7 @@
 
         {
           name: "瀹炴椂鐩戞帶",
-          icon: "/images/manageCenter/manage2.png",
+          icon: "/images/manageCenter/video.png",
           openPath: "/video",
           path: "/video",
           permission: "videoMng"
@@ -503,19 +502,20 @@
           // basic 涓哄瓙璐︽埛榛樿鐨勭┖瀛楁,琛ㄧず鍙鐞嗙殑鎽勫儚鏈虹洰褰曚负绌�
           if (checkedCameras == "basic") {
             this.cameraTree = ["basic"]
+            this.authorizedCameras = ["basic"]
           } else {
             let cameraIds = checkedCameras.split(",")
             this.authorizedCameras = cameraIds
             this.TreeDataPool.removeNoAuthorizedNode(this.cameraTree, cameraIds)
           }
-        }        
+        }
 
         let tmpTree = JSON.parse(JSON.stringify(this.cameraTree))
 
         for (let i = 0; i < tmpTree.length; i++) this.clearNode(tmpTree[i])
         this.menuTree = tmpTree
 
-        console.log(this.cameraTree)
+        // console.log(this.cameraTree)
       }
     },
     clearNode(tree) {
@@ -535,14 +535,13 @@
       let selectedNode = {}
       let orgNodeIds = []
 
-      if (this.selectedOrg == "") {
+      if (this.selectedOrg == "" || this.selectedOrg == null) {
         return this.authorizedCameras
       }
 
       function findNode(node) {
         if (node.id == selectedNodeId) {
           selectedNode = node
-
           return
         }
 
@@ -585,21 +584,21 @@
         if (rsp && rsp.success) {
           this.decodeWarningRate(rsp.data.warningRate)
           this.decodeWarningChartRate(rsp.data.warningChartRate)
-          this.decodeWarningStatics(rsp.data.warningTable)
-          this.decodeWarningTable(rsp.data.warningStatics)
+          this.decodeWarningStatics(rsp.data.warningStatics)
+          this.decodeWarningTable(rsp.data.warningTable)
         }
       })
     },
-    decodeWarningTable(b64data) {
+    // 鏁存敼鍒楄〃
+    decodeWarningStatics(b64data) {
       this.solvedTotal = 0
       this.tableDataList = []
       if (b64data) {
         let decodeString = Base64.decode(b64data)
         if (decodeString != "") {
           let decodeResult = JSON.parse(decodeString)
-          decodeResult = []
           if (decodeResult) {
-            console.log("decodeResult", decodeResult)
+            console.log("warningStatics", decodeResult)
             decodeResult.forEach((element) => {
               this.solvedTotal = this.solvedTotal + element.doc_count
               this.tableDataList.push({ date: element.key_as_string, count: element.doc_count })
@@ -609,7 +608,7 @@
       }
     },
     // 鎶樼嚎鍥�
-    decodeWarningStatics(b64data) {
+    decodeWarningTable(b64data) {
       this.lineChart.clear()
       this.barOption.xAxis.data = []
       this.barOption.series[0].data = []
@@ -676,6 +675,12 @@
       }
     },
     handleTreeChange(value) {
+      // console.log("change:", value)
+      if (value == null) {
+        this.selectedOrg = ""
+
+        return
+      }
       this.selectedOrg = value[value.length - 1]
     },
     getInfo() {

--
Gitblit v1.8.0