| | |
| | | activeTab: "信息维护", |
| | | clusterArr: [], |
| | | cluster: "", |
| | | clusterData: [], |
| | | intervalTimer: null, |
| | | leftWith: 0, |
| | | screenHeight: 0, |
| | |
| | | }, |
| | | |
| | | 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); |
| | |
| | | "TreeDataPool.selectedNodes": { |
| | | handler(nodes) { |
| | | if (this.activeTab == "场景配置") { |
| | | console.log(this.TreeDataPool.multiple); |
| | | // this.$refs.sepRule.initCameraData(nodes[nodes.length - 1]); |
| | | let CameraArr = []; |
| | | |
| | |
| | | }); |
| | | |
| | | this.$refs.sepRule.Carmeras = CameraArr; |
| | | console.log(CameraArr); |
| | | } |
| | | }, |
| | | deep: true, |
| | |
| | | }, |
| | | created() { |
| | | this.getCluster(); |
| | | this.PollData.statistics(); |
| | | this.TreeDataPool.readonly = false; |
| | | |
| | | // this.TreeDataPool.readonly = true; |
| | |
| | | this.TreeDataPool.multiple = false; |
| | | this.TreeDataPool.selectedNode = ""; |
| | | this.selectedNodes = []; |
| | | this.VideoManageData.init(); |
| | | }, |
| | | beforeDestroy() { |
| | | clearInterval(this.intervalTimer); |
| | |
| | | }); |
| | | this.TreeDataPool.clean(); |
| | | }); |
| | | |
| | | let _this = this; |
| | | _this.PollData.statisticTaskInfo(); |
| | | this.intervalTimer = setInterval(() => { |
| | | _this.PollData.statisticTaskInfo(); |
| | | }, 10000); |
| | | }, |
| | | methods: { |
| | | handAddDevice(node) { |
| | |
| | | }, |
| | | 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, |
| | |
| | | }); |
| | | |
| | | 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(); |
| | | }, |
| | | }, |
| | | }; |