From 8e12e678decdf72f546e488601dc0842127aeabc Mon Sep 17 00:00:00 2001
From: hanbaoshan <hanbaoshan@aiotlink.com>
Date: 星期一, 19 十月 2020 16:43:58 +0800
Subject: [PATCH] 加入集群添加loading
---
src/Pool/TreeData.ts | 29 +++++++++++++++++++++++++++--
1 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/src/Pool/TreeData.ts b/src/Pool/TreeData.ts
index d23f400..2008d98 100644
--- a/src/Pool/TreeData.ts
+++ b/src/Pool/TreeData.ts
@@ -1,6 +1,7 @@
import {
getLocalCameraTree,
getGB28181CameraTree,
+ getClusterTree,
addAreaTreeData,
delAreaTreeData,
updateAreaTreeData,
@@ -16,9 +17,11 @@
export default class TreeDataPool {
public openeds: Array<boolean>;
public treeData: Array<object>;
+ public clusterData: Array<object>;
public gb28181Data: Array<object>;
public treeDataPure: Array<object>;
public gb28181DataPure: Array<object>;
+ public clusterDataPure: Array<object>;
public videoArr: Array<string | undefined | object>;
public searchCamType: number;
public searchInput: string;
@@ -64,8 +67,10 @@
this.openeds = [true, true, false];
this.treeData = [];
this.gb28181Data = [];
+ this.clusterData = [];
this.treeDataPure = [];
this.gb28181DataPure = [];
+ this.clusterDataPure = [];
this.videoArr = [""];
this.searchCamType = 0;
this.searchInput = "";
@@ -96,7 +101,6 @@
}
setVideoArr(index: number, value: object, vue: any): void {
- debugger
vue.$set(this.videoArr, index, value);
this.activeForceChoose = false;
}
@@ -107,7 +111,6 @@
this.selectedNodes = [this.selectedNode.id];
return;
}
-
let _selected = this.selectedNodes;
function nodeFilter(node: any) {
if (node.type === "4" && node.selected) {
@@ -126,6 +129,11 @@
}
if (this.selectedNode.cameraType === 1) {
this.gb28181Data.forEach((n: any) => {
+ nodeFilter(n);
+ });
+ }
+ if (this.selectedNode.cameraType === -1) {
+ this.clusterData.forEach((n: any) => {
nodeFilter(n);
});
}
@@ -305,6 +313,22 @@
}
}
+ async fetchClusterTree (){
+ const rsp: any = await getClusterTree({
+ searchType: this.searchCamType,
+ cameraName: this.searchInput
+ });
+ if(rsp && rsp.success){
+ console.log(rsp.data);
+ this.clusterData = rsp.data ? rsp.data : []
+ if(this.clusterData && this.clusterData.length > 0){
+ this.sortTreeData(this.clusterData)
+ }
+ this.clusterDataPure = JSON.parse(JSON.stringify(this.clusterData));
+ this.isFold(this.clusterData)
+ }
+ }
+
async fetchGbTree() {
const rsp: any = await getGB28181CameraTree({
searchType: this.searchCamType,
@@ -329,6 +353,7 @@
if (this.openeds[1]) {
this.fetchGbTree()
}
+
this.findAllFile({})
}
--
Gitblit v1.8.0