From a51a787a5ecb7d249dba434be74160c85516c555 Mon Sep 17 00:00:00 2001
From: hanbaoshan <hanbaoshan@aiotlink.com>
Date: 星期三, 05 八月 2020 10:25:12 +0800
Subject: [PATCH] minDock高亮显示

---
 src/components/LeftNav.vue |   96 ++++++++++++++++++-----------------------------
 1 files changed, 37 insertions(+), 59 deletions(-)

diff --git a/src/components/LeftNav.vue b/src/components/LeftNav.vue
index 90ad872..1ad2f58 100644
--- a/src/components/LeftNav.vue
+++ b/src/components/LeftNav.vue
@@ -6,12 +6,7 @@
       v-show="TreeDataPool.showTreeBox"
     >
       <el-tabs v-model="TreeDataPool.treeActiveName" type="border-card" @tab-click="handleClick">
-        <el-tab-pane
-          label="鎽勫儚鏈�"
-          name="camera"
-          :style="`height:${height - 56}px;`"
-          v-if="isShow(cameraAuth)"
-        >
+        <el-tab-pane label="鎽勫儚鏈�" name="camera" :style="`height:${height - 56}px;`" v-if="showCam">
           <el-menu
             :default-openeds="openeds"
             background-color="#fff"
@@ -27,7 +22,6 @@
               <el-select
                 v-model="TreeDataPool.searchCamType"
                 placeholder="璇烽�夋嫨"
-                
                 @change="searchAreaData"
               >
                 <el-option
@@ -43,7 +37,6 @@
                 placeholder="鎼滅储"
                 clearable
                 @input="querySearchAsync('camera')"
-                
               >
                 <i
                   class="el-icon-search el-input__icon"
@@ -150,7 +143,7 @@
           label="鏁版嵁鏍�"
           name="dataStack"
           :style="`height:${height - 56}px;`"
-          v-if="isShow(dataStack)"
+          v-if="showDataStack"
         >
           <div class="local-vedio-area">
             <!-- 鎼滅储 -->
@@ -187,13 +180,13 @@
                 ></i>
               </el-input>
               <!-- 闅愯棌鏍戞寜閽� -->
-              <div class="dev-tree-close">
+              <!-- <div class="dev-tree-close">
                 <i
                   class="el-icon-s-fold"
                   style="color: #3D68E1;line-height: 22px;font-size: 27px;"
                   @click="closeTree"
                 ></i>
-              </div>
+              </div> -->
             </div>
 
             <!-- 鏈湴瑙嗛婧愬垪琛� -->
@@ -216,21 +209,9 @@
               </div>
               <LocalVedioList :dataList="TreeDataPool.localVedioList"></LocalVedioList>
             </div>
-            <!-- 鍒嗛〉 -->
-            <!-- <div class="paginationClass flex-box">
-                <el-pagination
-                  @current-change="refrash"
-                  :current-page="TreeDataPool.localCurrentPage"
-                  :page-size="TreeDataPool.localPageSize"
-                  style="margin: 10px 0;"
-                  :total="TreeDataPool.localTotal"
-                ></el-pagination>
-            </div>-->
           </div>
           <file-upload v-show="fileUploadBox" @close="fileUploadBox= false" />
         </el-tab-pane>
-        <!-- <el-tab-pane label="鏈湴鍥剧墖" name="localPic" v-if="isShow('VIDEOCAMERA:image')">鏈湴鍥剧墖</el-tab-pane>
-        <el-tab-pane label="鏈湴闊抽" name="localAudio" v-if="isShow('VIDEOCAMERA:audio')">鏈湴闊抽</el-tab-pane>-->
       </el-tabs>
     </div>
   </transition>
@@ -270,6 +251,15 @@
   },
 
   computed: {
+    showTab() {
+      return true;
+    },
+    showCam() {
+      return this.appName === "Camera" || this.appName === "Search";
+    },
+    showDataStack() {
+      return this.appName === "DataStack" || this.appName === "Search";
+    },
     showLock() {
       return this.edit;
     },
@@ -347,52 +337,40 @@
       loadingGBTree: false
     };
   },
-  watch: {
-    $route(to, from) {
-      switch (to.name) {
-        case "Searching":
-          this.cameraAuth = "videoSearch:camera"
-          this.dataStack = "videoSearch:dataStack"
-          break
-        case "VideoManage":
-          this.cameraAuth = "VIDEOCAMERA:camera"
-          this.dataStack = "VIDEOCAMERA:dataStack"
-          break
-        default:
-          this.cameraAuth = "videoMonitor:camera"
-          this.dataStack = "videoMonitor:dataStack"
-      }
-      // console.log("璺敱鍙樺寲锛�", to, from)
-    }
-  },
+  // watch: {
+  //   $route(to, from) {
+  //     switch (to.name) {
+  //       case "Searching":
+  //         this.cameraAuth = "videoSearch:camera"
+  //         this.dataStack = "videoSearch:dataStack"
+  //         break
+  //       case "VideoManage":
+  //         this.cameraAuth = "VIDEOCAMERA:camera"
+  //         this.dataStack = "VIDEOCAMERA:dataStack"
+  //         break
+  //       default:
+  //         this.cameraAuth = "videoMonitor:camera"
+  //         this.dataStack = "videoMonitor:dataStack"
+  //     }
+  //     // console.log("璺敱鍙樺寲锛�", to, from)
+  //   }
+  // },
   created() {
-    if (this.isShow('VIDEOCAMERA:camera')) {
+    if (this.showCam) {
       this.TreeDataPool.treeActiveName = "camera"
+      this.TreeDataPool.fetchTreeData();
+
     } else {
       this.TreeDataPool.treeActiveName = "dataStack"
+      this.DataStackPool.fetchFiles();
+
     }
-    this.TreeDataPool.fetchTreeData().then(_ => {
-      // todo
-      // if (this.$route.path == '/Layout/Searching') {
-      //   this.TreeDataPool.filterLocalVideoWell()
-      // }
-    });
   },
   methods: {
-    isShow(authority) {
-      if (this.isAdmin) {
-        return true;
-      } else if (this.buttonAuthority.indexOf("," + authority + ",") > -1) {
-        return true;
-      } else {
-        return false;
-      }
-    },
     searchAreaData() {
       this.TreeDataPool.fetchTreeData();
     },
     searchDataStack() {
-      debugger
       this.DataStackPool.fetchFiles();
     },
     lockSwitch() {
@@ -577,7 +555,7 @@
   .navTopSelect {
     display: flex;
     text-align: left;
-    
+
     .el-input__icon {
       line-height: 34px;
     }

--
Gitblit v1.8.0