From 12ea4d9b4c40a7eedfe7440b5d3ff952b381675c Mon Sep 17 00:00:00 2001
From: hanbaoshan <hanbaoshan@aiotlink.com>
Date: 星期四, 25 二月 2021 18:34:54 +0800
Subject: [PATCH] 朔黄任务管理视频列表隐藏uniqueId,视频检索tab中label单行溢出显示省略号

---
 src/components/giantTree/index.vue |   46 ++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 44 insertions(+), 2 deletions(-)

diff --git a/src/components/giantTree/index.vue b/src/components/giantTree/index.vue
index b1aa707..0a694bd 100644
--- a/src/components/giantTree/index.vue
+++ b/src/components/giantTree/index.vue
@@ -5,9 +5,11 @@
       :show-checkbox="TreeDataPool.multiple"
       :readonly="TreeDataPool.readonly"
       :gb28181="gb28181"
+      @onCreated="handleCreated"
       @onClick="itemClick"
       @onCheck="itemCheck"
       @onDblClick="onDblClick"
+      @onAddNode="addNode"
       @onRemoveNode="delNode"
       @onRenameNode="editNode"
       @onAddDevice="addCamera"
@@ -80,7 +82,9 @@
           { required: true, message: "璇疯緭鍏ヨ妭鐐瑰悕绉�", trigger: "change" },
           { min: 2, max: 10, message: "闀垮害鍦�2鍒�10涓瓧", trigger: "change" }
         ]
-      }
+      },
+      evt: {},
+      treeId: '',
     };
   },
   created() {
@@ -101,8 +105,27 @@
   methods: {
     handleCreated: function (ztreeObj) {
       this.ztreeObj = ztreeObj;
+      // console.log("handleCreated")
       // onCreated 涓搷浣渮treeObj瀵硅薄灞曞紑绗竴涓妭鐐�
       // ztreeObj.expandNode(ztreeObj.getNodes()[0], true);
+
+      // 鎽勫儚鏈洪厤缃垏鎹㈡椂, 璁剧疆閫変腑鐘舵��
+      if (this.TreeDataPool.selectedNode.id) {
+        // 鍙栨秷鎵�鏈夊閫夌殑鑺傜偣,浠呬繚鐣欏綋鍓嶅崟閫夌殑鑺傜偣
+        this.TreeDataPool.selectedNodes = [this.TreeDataPool.selectedNode.id]
+
+        let node = this.ztreeObj.getNodeByTId(this.TreeDataPool.selectedNode.tId)
+        //鎽勫儚鏈轰俊鎭洿鏂颁俊鎭悗锛屽鏋滆妭鐐逛綅缃湁鍙榯Id灏变笉鍑嗕簡,this.TreeDataPool.selectedNode姝ゆ椂杩樻槸鏃х殑淇℃伅
+        console.log('selecBode',this.TreeDataPool.selectedNode)
+        console.log('selectedNode.tId',this.TreeDataPool.selectedNode.tId,)
+        // 澶氶�夋椂, 閫変腑鍗曢�夊崟鍑荤殑鑺傜偣
+        if (this.TreeDataPool.multiple) {
+          this.ztreeObj.checkAllNodes(false);
+          this.ztreeObj.checkNode(node, true, false, false);
+        }
+
+        this.ztreeObj.selectNode(node, false, true)
+      }
     },
     onDblClick(evt, treeId, item) {
       if (item.type !== "4" || this.app !== "Camera") {
@@ -169,7 +192,7 @@
     importCameras(node) {
       this.$emit("import", node);
     },
-    addNode(event, node) {
+    addNode(node) {
       this.dialogForm = {
         text: "",
         method: "add",
@@ -222,6 +245,12 @@
       this.showDialog = true;
     },
     itemClick(evt, treeId, treeNode) {
+      debugger
+      //let itemClickArgs = {evt,treeId};
+      this.evt = evt;
+      this.treeId = treeId;
+      console.log(evt,treeId)
+      // sessionStorage.setItem('itemClickArgs',JSON.stringify(itemClickArgs))
       this.TreeDataPool.selectedNode = treeNode;
       this.TreeDataPool.treeType = this.treeName;
 
@@ -234,6 +263,19 @@
 
       this.TreeDataPool.updateZTreeCheckNodes([treeNode]);
     },
+    // itemClick(treeNode) {
+    //   this.TreeDataPool.selectedNode = treeNode;
+    //   this.TreeDataPool.treeType = this.treeName;
+
+    //   // 澶氶��
+    //   if (this.TreeDataPool.multiple) {
+    //     // 鍗曞嚮鏌愪竴涓妭鐐规枃瀛楁椂 鍙栨秷鎵�鏈夊嬀閫夌姸鎬� 鐒跺悗閫変腑鑷韩
+    //     this.ztreeObj.checkAllNodes(false);
+    //     this.ztreeObj.checkNode(treeNode, true, false, false);
+    //   }
+
+    //   this.TreeDataPool.updateZTreeCheckNodes([treeNode]);
+    // },
     itemCheck(evt, treeId, treeNode) {
       this.TreeDataPool.selectedNode = treeNode;
       this.TreeDataPool.treeType = this.treeName;

--
Gitblit v1.8.0