ZZJ
2022-04-12 994e5e08cba4e6b9ce321b7cf5cb1ec8d19dfa22
src/views/hashrate/CameraManage/index.vue
@@ -66,6 +66,7 @@
      activeTab: "信息维护",
      clusterArr: [],
      cluster: "",
      clusterData: [],
      intervalTimer: null,
      leftWith: 0,
      screenHeight: 0,
@@ -77,11 +78,8 @@
  },
  watch: {
    "TreeDataPool.selectedNode": function (node) {
      if (this.TreeDataPool.multiple) {
        return;
      }
    "TreeDataPool.activeNode": function (node) {
      console.log("cclickaaa");
      if (this.activeTab == "信息维护") {
        if (this.TreeDataPool.treeActiveName == "camera") {
          this.$refs.cameraInfo.selectCamera(node);
@@ -93,6 +91,7 @@
    "TreeDataPool.selectedNodes": {
      handler(nodes) {
        if (this.activeTab == "场景配置") {
          console.log(this.TreeDataPool.multiple);
          //  this.$refs.sepRule.initCameraData(nodes[nodes.length - 1]);
          let CameraArr = [];
@@ -102,6 +101,7 @@
          });
          this.$refs.sepRule.Carmeras = CameraArr;
          console.log(CameraArr);
        }
      },
      deep: true,
@@ -124,7 +124,6 @@
  },
  created() {
    this.getCluster();
    this.PollData.statistics();
    this.TreeDataPool.readonly = false;
    //  this.TreeDataPool.readonly = true;
@@ -132,7 +131,6 @@
    this.TreeDataPool.multiple = false;
    this.TreeDataPool.selectedNode = "";
    this.selectedNodes = [];
    this.VideoManageData.init();
  },
  beforeDestroy() {
    clearInterval(this.intervalTimer);
@@ -148,12 +146,6 @@
      });
      this.TreeDataPool.clean();
    });
    let _this = this;
    _this.PollData.statisticTaskInfo();
    this.intervalTimer = setInterval(() => {
      _this.PollData.statisticTaskInfo();
    }, 10000);
  },
  methods: {
    handAddDevice(node) {
@@ -190,8 +182,8 @@
    },
    async getCluster() {
      const res = await getClusterDevList();
      console.log(res);
      if (res && res.success) {
        this.clusterData = res.data.clusterList;
        res.data.clusterList.forEach((item) => {
          this.clusterArr.push({
            label: item.cluster_name,
@@ -207,20 +199,30 @@
        });
        this.cluster = this.clusterArr[0].value;
        this.selectCluster(this.clusterArr[0].value);
      }
    },
    selectCluster(val) {
      const arr = val.split("$$");
      console.log(arr);
      if (arr[0] == "0") {
        this.TreeDataPool.clusterId = arr[1];
        this.TreeDataPool.devId = "";
        sessionStorage.setItem("clusterId", arr[1]);
        sessionStorage.setItem("devId", "");
        console.log(this.clusterData);
        this.clusterData.forEach((item) => {
          if (arr[1] == item.cluster_id) {
            sessionStorage.setItem("nodeId", item.nodeList[0].devId);
          }
        });
      }
      if (arr[0] == "1") {
        this.TreeDataPool.devId = arr[1];
        this.TreeDataPool.clusterId = "";
        sessionStorage.setItem("clusterId", "");
        sessionStorage.setItem("devId", arr[1]);
        sessionStorage.setItem("nodeId", arr[1]);
      }
      this.TreeDataPool.fetchTreeData();
      this.PollData.statisticTaskInfo();
      this.VideoManageData.init();
      this.PollData.statistics();
    },
  },
};