zhangzengfei
2021-02-04 171558c783772979546d5c0285809165c273fc0e
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 {
@@ -143,6 +146,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,9 +280,14 @@
      return
    }
    node.forEach(n => {
      // vue-js-tree 默认展开,控制部分折叠. z-tree 默认折叠, 控制部分展开
      if (this.foldNodeList[n.id]) {
        if (this.zTree) {
          n.open = true
        } else {
        n.opened = false
      }
      }
      if (n.children && n.children.length > 0) {
        this.isFold(n.children)
      }