From c746783c4f570f9bdbe2d62b22bda22308b0dfba Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期一, 05 十二月 2022 15:27:35 +0800
Subject: [PATCH] 修复断流数据展示的内容

---
 src/views/manageCenter/index.vue |  115 +++++++++++++++++++++++++++++++++++----------------------
 1 files changed, 71 insertions(+), 44 deletions(-)

diff --git a/src/views/manageCenter/index.vue b/src/views/manageCenter/index.vue
index b4893c6..97b7298 100644
--- a/src/views/manageCenter/index.vue
+++ b/src/views/manageCenter/index.vue
@@ -26,7 +26,7 @@
         <div class="products">
           <div class="title">缁熻鍒嗘瀽</div>
           <div class="productList">
-            <p class="p-statis" style=" vertical-align: top">
+            <p class="p-statis" style="vertical-align: top">
               <span>鏃堕棿锛�</span>
               <el-date-picker
                 size="mini"
@@ -64,7 +64,7 @@
               <span>閮ㄩ棬锛�</span>
               <el-cascader
                 size="mini"
-                style="width:400px"
+                style="width: 400px"
                 v-model="searchTree"
                 :options="menuTree"
                 :props="{ value: 'id', label: 'name', checkStrictly: true }"
@@ -80,7 +80,7 @@
                 clearable
                 collapse-tags
                 size="mini"
-                style="width:140px"
+                style="width: 140px"
                 placeholder="璇烽�夋嫨"
               >
                 <el-option
@@ -162,7 +162,7 @@
         <div class="left">
           <div class="title">棰勮鏁版嵁鍗犳瘮:</div>
           <div class="info">
-            <div class="equipmentInfo" style="margin-top:25px">
+            <div class="equipmentInfo" style="margin-top: 25px">
               <div class="equipmentCard">
                 <div class="label">鏁存敼鎬婚噺</div>
                 <div class="number">
@@ -198,7 +198,7 @@
 
                 <el-table-column prop="count" align="center" label="鏁存敼鏁伴噺" show-overflow-tooltip></el-table-column>
               </el-table>
-              <el-pagination
+              <!-- <el-pagination
                 @current-change="refrash"
                 @size-change="handleSizeChange"
                 :current-page="page"
@@ -207,7 +207,7 @@
                 :page-sizes="[5, 10, 15, 20, 25]"
                 :total="solvedTotal"
                 background
-              ></el-pagination>
+              ></el-pagination> -->
             </div>
           </div>
         </div>
@@ -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,26 +307,49 @@
         },
         {
           name: "缁熻鍒嗘瀽",
-          icon: "/images/manageCenter/search.png",
+          icon: "/images/manageCenter/datav.png",
           openPath: "/dataView",
           path: "/dataView",
           permission: "dataViewMng"
         },
 
         {
-          name: "鎺ㄩ�佺鐞�",
-          icon: "/images/manageCenter/manage2.png",
-          openPath: "/report",
-          path: "/report",
-          permission: "dataPushMng"
+          name: "鐢ㄦ埛绠$悊",
+          icon: "/images/manageCenter/push.png",
+          openPath: "/subAccount",
+          path: "/subAccount",
+          permission: "accountMng"
+        },
+
+        {
+          name: "鏁版嵁涓婁紶",
+          icon: "/images/manageCenter/push.png",
+          openPath: "/dataPush",
+          path: "/dataPush",
+          permission: "reportMng"
+        },
+
+        {
+          name: "鏁版嵁鎶ヨ〃",
+          icon: "/images/manageCenter/push.png",
+          openPath: "/dataReport",
+          path: "/dataReport",
+          permission: ""
         },
 
         {
           name: "瀹炴椂鐩戞帶",
-          icon: "/images/manageCenter/manage2.png",
+          icon: "/images/manageCenter/video.png",
           openPath: "/video",
           path: "/video",
           permission: "videoMng"
+        },
+        {
+          name: "鐐逛綅鍙樻洿",
+          icon: "/images/manageCenter/cam.png",
+          openPath: "/invalidCamera",
+          path: "/invalidCamera",
+          permission: "positionMng"
         }
       ],
       cameraTree: [],
@@ -445,6 +467,10 @@
           "rgb(255, 124, 31)",
           "rgb(165, 96, 255)"
         ],
+        tooltip: {
+          trigger: "item",
+          formatter: "{b} {d}%" //鍙鐧惧垎姣�
+        },
         series: [
           {
             name: "Nightingale Chart",
@@ -457,7 +483,9 @@
             },
             label: {
               show: false
+              //formatter: '{b} : {c} ({d}%)' //甯﹀綋鍓嶅浘渚嬪悕 + 鐧惧垎姣�
             },
+
             data: []
           }
         ]
@@ -503,19 +531,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 +564,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,31 +613,34 @@
         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 })
+              this.tableDataList.push({
+                date: element.key_as_string,
+                count: element.doc_count
+              })
             })
           }
         }
       }
     },
     // 鎶樼嚎鍥�
-    decodeWarningStatics(b64data) {
+    decodeWarningTable(b64data) {
       this.lineChart.clear()
       this.barOption.xAxis.data = []
       this.barOption.series[0].data = []
@@ -638,7 +669,10 @@
           let decodeResult = JSON.parse(decodeString)
           if (decodeResult) {
             decodeResult.forEach((element) => {
-              this.pieOption.series[0].data.push({ value: element.doc_count, name: element.key })
+              this.pieOption.series[0].data.push({
+                value: element.doc_count,
+                name: element.key
+              })
             })
           }
         }
@@ -676,6 +710,12 @@
       }
     },
     handleTreeChange(value) {
+      // console.log("change:", value)
+      if (value == null) {
+        this.selectedOrg = ""
+
+        return
+      }
       this.selectedOrg = value[value.length - 1]
     },
     getInfo() {
@@ -734,23 +774,10 @@
       this.pieChart.setOption(this.pieOption)
     },
     jump(route) {
-      const userInfo = JSON.parse(sessionStorage.getItem("userInfo"))
-
-      const val = userInfo.permissions.find((item) => {
-        return item == route.permission
+      const { href } = this.$router.resolve({
+        path: route.path
       })
-      if (val) {
-        if (route.path === "/search" || route.path === "/dataView") {
-          const { href } = this.$router.resolve({
-            path: route.path
-          })
-          window.open(href, "_blank")
-          return
-        }
-        this.$router.push(route.path)
-      } else if (!userInfo.parentId) {
-        this.$router.push(route.openPath)
-      }
+      window.open(href, "_blank")
     },
     refrash() {},
     handleSizeChange() {},
@@ -844,7 +871,7 @@
       display: flex;
 
       .productItem {
-        margin-right: 20px;
+        margin: 0px 10px;
         width: 190px;
         height: 90px;
         display: flex;

--
Gitblit v1.8.0