hanbaoshan
2020-12-03 c587fbdad6f75ba05e5440b41be144bd335703aa
src/Pool/TreeData.ts
@@ -113,6 +113,7 @@
      return;
    }
    let _selected = this.selectedNodes;
    console.log(this.selectedNodes)
    function nodeFilter(node: any) {
      if (node.type === "4" && node.selected) {
        _selected.push(node.id);
@@ -124,25 +125,33 @@
      }
    }
    if (this.selectedNode.cameraType === 0) {
      this.treeData.forEach((n: any) => {
        nodeFilter(n);
      });
      //摄像机树
      if(this.treeActiveName == "camera"){
        this.treeData.forEach((n: any) => {
          nodeFilter(n);
        });
      }else if(this.treeActiveName == "cluster"){
        //集群树
        this.clusterData.forEach((n: any) => {
          nodeFilter(n);
        });
      }
    }
    if (this.selectedNode.cameraType === 1) {
      this.gb28181Data.forEach((n: any) => {
        nodeFilter(n);
      });
    }
    if (this.selectedNode.cameraType === -1) {
      this.clusterData.forEach((n: any) => {
        nodeFilter(n);
      });
    }
    // if (this.selectedNode.cameraType === -1) {
    //   this.clusterData.forEach((n: any) => {
    //     nodeFilter(n);
    //   });
    // }
  }
  getCameraInfoByIp(ipaddr) {
    let camera = null;
    function nodeFilter(node: any) {
      if (node.rtsp && node.rtsp.indexOf(ipaddr) != -1) {
        camera = node;
@@ -296,13 +305,12 @@
  }
  async fetchLocalTree() {
    let params:any = {
    let params: any = {
      searchType: this.searchCamType,
      cameraName: this.searchInput,
      //isPlatform: 1
    };
    debugger
    if(this.searchFrom == 'cluster'){
    if (this.searchFrom == 'cluster') {
      params.isPlatform = 1
    }
    const rsp: any = await getLocalCameraTree(params);
@@ -320,15 +328,15 @@
    }
  }
  async fetchClusterTree (){
  async fetchClusterTree() {
    const rsp: any = await getClusterTree({
      searchType: this.searchCamType,
      cameraName: this.searchInput
    });
    if(rsp && rsp.success){
    if (rsp && rsp.success) {
      console.log(rsp.data);
      this.clusterData = rsp.data ? rsp.data : []
      if(this.clusterData && this.clusterData.length > 0){
      if (this.clusterData && this.clusterData.length > 0) {
        this.sortTreeData(this.clusterData)
      }
      this.clusterDataPure = JSON.parse(JSON.stringify(this.clusterData));