From d889eaf990af99c06970e51f2bc421ac0015489c Mon Sep 17 00:00:00 2001 From: ZZJ <zzjdsg2300@163.com> Date: 星期四, 05 五月 2022 13:30:31 +0800 Subject: [PATCH] bug修复 --- src/views/hashrate/CameraManage/index.vue | 59 ++++++++++++++++++++++++++++++++++++++++------------------- 1 files changed, 40 insertions(+), 19 deletions(-) diff --git a/src/views/hashrate/CameraManage/index.vue b/src/views/hashrate/CameraManage/index.vue index c8ab02e..9396978 100644 --- a/src/views/hashrate/CameraManage/index.vue +++ b/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, @@ -123,8 +123,8 @@ }, }, created() { + console.log("------------"); this.getCluster(); - this.PollData.statistics(); this.TreeDataPool.readonly = false; // this.TreeDataPool.readonly = true; @@ -132,11 +132,12 @@ this.TreeDataPool.multiple = false; this.TreeDataPool.selectedNode = ""; this.selectedNodes = []; - this.VideoManageData.init(); }, beforeDestroy() { clearInterval(this.intervalTimer); //this.TreeDataPool.treeActiveName = "camera"; + sessionStorage.removeItem("devId"); + sessionStorage.removeItem("clusterId"); }, mounted() { this.$nextTick(() => { @@ -148,12 +149,6 @@ }); this.TreeDataPool.clean(); }); - - let _this = this; - _this.PollData.statisticTaskInfo(); - this.intervalTimer = setInterval(() => { - _this.PollData.statisticTaskInfo(); - }, 10000); }, methods: { handAddDevice(node) { @@ -190,8 +185,24 @@ }, async getCluster() { const res = await getClusterDevList(); - console.log(res); if (res && res.success) { + this.clusterData = res.data.clusterList; + if (res.data.clusterList <= 0 && res.data.devList <= 0) { + this.$confirm( + "绯荤粺妫�娴嬪埌鎮ㄨ繕鏈坊鍔犺澶�, 璇峰湪璁惧绠$悊椤甸潰缁存姢", + "鎻愮ず", + { + confirmButtonText: "璺宠浆", + cancelButtonText: "鍙栨秷", + type: "warning", + } + ) + .then(() => { + this.$router.push("/manageCenter"); + }) + .catch(() => {}); + } + res.data.clusterList.forEach((item) => { this.clusterArr.push({ label: item.cluster_name, @@ -207,20 +218,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(); }, }, }; -- Gitblit v1.8.0