From 0dbf19e9f92f5cb1d5ca9a06fd268d3b16e466e3 Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期三, 07 十二月 2022 15:22:01 +0800
Subject: [PATCH] 完善断流监控,集群和设备详情的查询

---
 src/components/CameraLeft.vue |   85 ++++++++++++++++++++++++++++++++++++------
 1 files changed, 72 insertions(+), 13 deletions(-)

diff --git a/src/components/CameraLeft.vue b/src/components/CameraLeft.vue
index d601e66..120f8f0 100644
--- a/src/components/CameraLeft.vue
+++ b/src/components/CameraLeft.vue
@@ -74,6 +74,28 @@
                   </el-tooltip>
                 </div>
 
+                <!-- 瀵煎嚭璁惧 -->
+                <div class="tree-edit export-btn" v-show="!TreeDataPool.readonly">
+                  <el-tooltip content="瀵煎嚭璁惧" placement="bottom" popper-class="atooltip">
+                    <download-excel
+                      class="export-excel-wrapper"
+                      :data="TreeDataPool.childNodes"
+                      :fields="json_fields"
+                      :name="'鎽勫儚鏈哄垪琛�.xlsx'"
+                    >
+                      <!-- 涓婇潰鍙互鑷畾涔夎嚜宸辩殑鏍峰紡锛岃繕鍙互寮曠敤鍏朵粬缁勪欢button -->
+                      <!-- <el-button type="primary" size="small">瀵煎嚭EXCEL</el-button> -->
+                      <!-- <div class="btnArea">
+                      <div class="button light">
+                        <span class="iconfont">&#xe643;</span>
+                        瀵煎嚭鏁版嵁
+                      </div>
+                    </div> -->
+                      <span class="iconfont" style="font-size: 16px">&#xe643;</span>
+                    </download-excel>
+                  </el-tooltip>
+                </div>
+
                 <!-- 鏍戞搷浣滈攣 -->
                 <div class="tree-edit tree-lock" v-show="showLock">
                   <button @click="lockSwitch">
@@ -103,7 +125,7 @@
                     />
                   </el-menu-item-group>
                 </el-submenu>
-                <el-submenu index="1">
+                <el-submenu index="1" v-show="false">
                   <template slot="title">
                     <!-- <i class="iconfont iconjiankongshexiangji"></i> -->
                     <span class="iconfont closeIcon" v-if="openeds[0] === '1'">&#xe64a;</span>
@@ -140,7 +162,7 @@
                     />
                   </el-menu-item-group>
                 </el-submenu>
-                <el-submenu index="2">
+                <el-submenu index="2" v-show="false">
                   <template slot="title">
                     <!-- <i class="iconfont iconjiankongshexiangji"></i> -->
                     <span class="iconfont closeIcon" v-if="openeds[0] === '2'">&#xe64a;</span>
@@ -297,7 +319,8 @@
 import TreeMenu from "@/components/giantTree/index"
 import LocalVedioList from "@/components/subComponents/LocalVedioList"
 import FileUpload from "@/components/subComponents/FileUpload/index"
-import XLSX from "xlsx"
+// import XLSX from "xlsx"
+import * as XLSX from "xlsx/xlsx.mjs"
 import { findCluster } from "@/api/clusterManage"
 
 export default {
@@ -400,7 +423,32 @@
       importAreaId: "",
       menuLoading: false,
       clusterName: "",
-      cluster: ""
+      cluster: "",
+      json_fields: {
+        閮ㄩ棬: {
+          field: "id",
+          //鑷畾涔夊洖璋冨嚱鏁�
+          callback: (value) => {
+            let org = ""
+            if (this.TreeDataPool.cameraParents.hasOwnProperty(value)) {
+              org = this.TreeDataPool.cameraParents[value]
+            }
+            return org
+          }
+        },
+        // 鍛婅鏍囪: "",
+        // 鏁存敼鎻忚堪: "",
+        鎽勫儚鏈洪�氶亾鍙�: "rtsp",
+        鎽勫儚鏈篒D: "id",
+        鎽勫儚鏈哄悕绉�: "name",
+        寮�鍚垎鏋�: {
+          field: "isAI",
+          //鑷畾涔夊洖璋冨嚱鏁�
+          callback: (value) => {
+            return value ? "鏄�" : "鍚�"
+          }
+        }
+      }
     }
   },
   created() {
@@ -570,6 +618,9 @@
       this.TreeDataPool.localCurrentPage = current
     },
 
+    exportCameras() {
+      console.log(this.TreeDataPool.treeData)
+    },
     importCameras(area) {
       this.importAreaId = area
       this.$refs["import-btn"].click()
@@ -639,7 +690,7 @@
           }
         } catch (e) {
           this.menuLoading = false
-          this.$message.warning("鏂囦欢绫诲瀷涓嶆纭紒")
+          this.$message.warning("鏂囦欢绫诲瀷涓嶆纭紒" + e)
         }
       }
       fileReader.readAsBinaryString(_file)
@@ -917,12 +968,6 @@
     color: #000;
   }
 }
-.area-add {
-  right: 62px;
-}
-.camera-add {
-  right: 36px;
-}
 
 .closeIcon,
 .openIcon {
@@ -938,9 +983,23 @@
   margin-right: 6px;
 }
 
-.import-btn {
-  right: 10px;
+.area-add {
+  right: 85px;
 }
+
+.camera-add {
+  right: 60px;
+}
+
+.import-btn {
+  right: 35px;
+}
+
+.export-btn {
+  right: 10px;
+  transform: rotate(90deg);
+}
+
 .tree-font {
   font-family: PingFangSC-Medium;
   font-size: 14px;

--
Gitblit v1.8.0