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,8 +280,13 @@
      return
    }
    node.forEach(n => {
      // vue-js-tree 默认展开,控制部分折叠. z-tree 默认折叠, 控制部分展开
      if (this.foldNodeList[n.id]) {
        n.opened = false
        if (this.zTree) {
          n.open = true
        } else {
          n.opened = false
        }
      }
      if (n.children && n.children.length > 0) {
        this.isFold(n.children)
@@ -281,7 +313,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) {
@@ -323,7 +355,7 @@
      this.isFold(this.treeData)
    }
  }
  async fetchClusterTree() {
    const rsp: any = await getClusterTree({
      searchType: this.searchCamType,
@@ -402,7 +434,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)