From 07d14cf6edbef9436aa5909bcb6b2329ecc6f9a2 Mon Sep 17 00:00:00 2001 From: ZZJ <10913410+zzj2100@user.noreply.gitee.com> Date: 星期五, 15 七月 2022 14:44:44 +0800 Subject: [PATCH] 禅道bug --- src/Pool/TreeData.ts | 56 ++++++++++++++++++++++++++++++++++++-------------------- 1 files changed, 36 insertions(+), 20 deletions(-) diff --git a/src/Pool/TreeData.ts b/src/Pool/TreeData.ts index 27be295..8b93a3d 100644 --- a/src/Pool/TreeData.ts +++ b/src/Pool/TreeData.ts @@ -11,6 +11,8 @@ getCameraBaseImage } from '@/api/area' +import {getClusterDevList} from '@/api/clusterManage' + export default class TreeDataPool { public openeds: Array<boolean> public activeTreeData: Array<object> @@ -64,6 +66,9 @@ public gb28181CameraBaseImage: string public baseImageLoading: boolean + public activeNode: string + + constructor() { this.openeds = [true, true, false] this.activeTreeData = [] @@ -102,7 +107,11 @@ this.cameraNameForBaseImage = "" this.gb28181CameraBaseImage = "" this.baseImageLoading = false + this.activeNode = '' + + } + setVideoArr(index: number, value: object, vue: any): void { vue.$set(this.videoArr, index, value) @@ -119,6 +128,7 @@ function nodeFilter(node: any) { if (node.type === '4' && node.selected) { _selected.push(node.id) + sessionStorage.setItem('cameraDevId',node.devId) } if (node.children) { node.children.forEach((n: any) => { @@ -161,6 +171,7 @@ function nodeFilter(node: any) { if (node.type === '4' && (node.selected || node.checked)) { + sessionStorage.setItem("cameraDevId", node.devId); _this.selectedNodes.push(node.id) } if (node.children) { @@ -338,17 +349,22 @@ async fetchLocalTree() { let params: any = { + parentId:"", searchType: this.searchCamType, - cameraName: this.searchInput + cameraName: this.searchInput, + //isPlatform: 1 } if (this.searchFrom == 'cluster') { params.isPlatform = 1 } + + const rsp: any = await getLocalCameraTree(params) if (rsp && rsp.success) { - this.treeData = rsp.data ? rsp.data : [] + + this.treeData = rsp.data.treeMenu ? rsp.data.treeMenu : [] if (this.treeData && this.treeData.length > 0) { this.sortTreeData(this.treeData) } @@ -376,20 +392,21 @@ } async fetchGbTree() { - const rsp: any = await getGB28181CameraTree({ - searchType: this.searchCamType, - cameraName: this.searchInput - }) + // 鍚庨棬 + // const rsp: any = await getGB28181CameraTree({ + // 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 ? rsp.data : [] + // 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() { @@ -404,7 +421,7 @@ async add(name: string, parent: string) { await addAreaTreeData({ name: name, - parentId: parent + parentId: parent, }) this.fetchTreeData() @@ -412,7 +429,7 @@ async del(id: string) { await delAreaTreeData({ - id: id + id: id, }) this.fetchTreeData() @@ -423,7 +440,7 @@ id: id, name: name, parentId: this.getParent(id, isGb), - alias: alias + alias: alias, }) this.fetchTreeData() @@ -481,10 +498,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 } } -- Gitblit v1.8.0