From 8098e7f023320b5bd9482bace3bf4f19d807765e Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@iotlink.com>
Date: 星期五, 16 四月 2021 18:08:26 +0800
Subject: [PATCH] 修复集群检索无法分页的bug
---
src/Pool/TreeData.ts | 45 +++++++++++++++++++++++++++++++++++++++------
1 files changed, 39 insertions(+), 6 deletions(-)
diff --git a/src/Pool/TreeData.ts b/src/Pool/TreeData.ts
index cbb1fde..0289f6c 100644
--- a/src/Pool/TreeData.ts
+++ b/src/Pool/TreeData.ts
@@ -60,6 +60,8 @@
//璁板綍澶嶅埗鐨勬憚鍍忔満name
public ctrlCameraName: string
+ public zTree: boolean
+
constructor() {
this.openeds = [true, true, false]
this.treeData = []
@@ -95,6 +97,7 @@
this.localTotal = 0
this.ctrlCameraId = ''
this.ctrlCameraName = ''
+ this.zTree = false
}
setVideoArr(index: number, value: object, vue: any): void {
@@ -109,7 +112,6 @@
return
}
let _selected = this.selectedNodes
- console.log(this.selectedNodes)
function nodeFilter(node: any) {
if (node.type === '4' && node.selected) {
_selected.push(node.id)
@@ -143,6 +145,30 @@
// nodeFilter(n);
// });
// }
+ }
+
+ updateZTreeCheckNodes(checkedNodes) {
+ let _this = this
+ _this.selectedNodes = []
+ if (!_this.multiple) {
+ _this.selectedNodes = [checkedNodes.id]
+ return
+ }
+
+ function nodeFilter(node: any) {
+ if (node.type === '4' && (node.selected || node.checked)) {
+ _this.selectedNodes.push(node.id)
+ }
+ if (node.children) {
+ node.children.forEach((n: any) => {
+ nodeFilter(n)
+ })
+ }
+ }
+
+ checkedNodes.forEach((n: any) => {
+ nodeFilter(n)
+ })
}
getCameraInfoByIp(ipaddr) {
@@ -253,8 +279,13 @@
return
}
node.forEach(n => {
+ // vue-js-tree 榛樿灞曞紑,鎺у埗閮ㄥ垎鎶樺彔. z-tree 榛樿鎶樺彔, 鎺у埗閮ㄥ垎灞曞紑
if (this.foldNodeList[n.id]) {
- n.opened = false
+ if (this.zTree) {
+ n.open = false
+ } else {
+ n.opened = false
+ }
}
if (n.children && n.children.length > 0) {
this.isFold(n.children)
@@ -281,7 +312,7 @@
if (!node) {
return
}
- node.sort(function(obj1: any, obj2: any) {
+ node.sort(function (obj1: any, obj2: any) {
var val1 = obj1.name
var val2 = obj2.name
if (val1 < val2) {
@@ -295,6 +326,9 @@
node.forEach(n => {
if (n.children && n.children.length > 0) {
+ if (this.zTree) {
+ n.open = true
+ }
this.sortTreeData(n.children)
}
})
@@ -323,14 +357,13 @@
this.isFold(this.treeData)
}
}
-
+
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)
@@ -402,7 +435,7 @@
}
async findAllFile(params: any) {
- ;(params.fileName = this.searchInput), (params.type = this.searchLocalType)
+ ; (params.fileName = this.searchInput), (params.type = this.searchLocalType)
params.page = this.localCurrentPage
params.size = this.localPageSize
let res: any = await findAllFile(params)
--
Gitblit v1.8.0