From f20a554bdb24e9dfde9dc6a69d78595944f61d15 Mon Sep 17 00:00:00 2001
From: mark <mark18340872469@163.com>
Date: 星期二, 25 十月 2022 14:53:57 +0800
Subject: [PATCH] 设备管理 样式调整

---
 src/Pool/TreeData.ts |   48 +++++++++++++++++++++++++++++-------------------
 1 files changed, 29 insertions(+), 19 deletions(-)

diff --git a/src/Pool/TreeData.ts b/src/Pool/TreeData.ts
index 330295e..1ff4151 100644
--- a/src/Pool/TreeData.ts
+++ b/src/Pool/TreeData.ts
@@ -67,6 +67,8 @@
   public baseImageLoading: boolean
 
   public activeNode: string
+  public clusterId: string
+  public devId: string
 
 
   constructor() {
@@ -108,6 +110,8 @@
     this.gb28181CameraBaseImage = ""
     this.baseImageLoading = false
     this.activeNode = ''
+    this.clusterId = ''
+    this.devId = ''
 
 
   }
@@ -392,21 +396,21 @@
   }
 
   async fetchGbTree() {
-    // 鍚庨棬
-    // const rsp: any = await getGB28181CameraTree({
-    //   searchType: this.searchCamType,
-    //   cameraName: this.searchInput
-    // })
+    const rsp: any = await getGB28181CameraTree({
+      parentId: "",
+      searchType: this.searchCamType,
+      cameraName: this.searchInput
+    })
 
-    // if (rsp && rsp.success) {
-    //   this.gb28181Data = rsp.data ? rsp.data : []
-    //   if (this.gb28181Data && this.gb28181Data.length > 0) {
-    //     this.sortTreeData(this.gb28181Data)
-    //   }
+    if (rsp && rsp.success) {
+      this.gb28181Data = rsp.data.treeMenu ? rsp.data.treeMenu : []
+      if (this.gb28181Data && this.gb28181Data.length > 0) {
+        this.sortTreeData(this.gb28181Data)
+      }
 
-    //   this.gb28181DataPure = JSON.parse(JSON.stringify(this.gb28181Data))
-    //   this.isFold(this.gb28181Data)
-    // }
+      this.gb28181DataPure = JSON.parse(JSON.stringify(this.gb28181Data))
+      this.isFold(this.gb28181Data)
+    }
   }
 
   async fetchTreeData() {
@@ -447,7 +451,7 @@
   }
 
   async refreshGB28181() {
-    await refreshGB28181Tree()
+    await refreshGB28181Tree({})
     // this.fetchGbTree()
   }
 
@@ -485,7 +489,10 @@
     if (update) {
       fn = refreshGB28181Tree
     }
-    const rsp: any = await fn()
+    const rsp: any = await fn({
+      clusterId:this.clusterId,
+      devId:this.devId,
+    })
 
     if (rsp && rsp.success) {
       this.selectedNode = {}
@@ -498,10 +505,9 @@
       this.setDropDisable(this.treeData)
       this.isFold(this.treeData)
 
-      this.activeTreeData = this.treeData
-
-      this.gb28181CheckedCount = 0;
+      this.gb28181CheckedCount = 0
       this.gb28181ChildNodeCount = this.countChildrenNodes(this.treeData)
+      this.activeTreeData = this.treeData
     }
   }
 
@@ -542,7 +548,11 @@
     this.cameraNameForBaseImage = node.name
 
     try {
-      const rsp: any = await getCameraBaseImage({ id: node.id })
+      const rsp: any = await getCameraBaseImage({ 
+        id: node.id,
+        clusterId: this.clusterId,
+        devId: this.devId,
+      })
 
       if (rsp && rsp.data) {
         this.gb28181CameraBaseImage = rsp.data

--
Gitblit v1.8.0