diff --git a/src/views/construction/manage/hoistManage/hoistManage.vue b/src/views/construction/manage/hoistManage/hoistManage.vue index 6e923c6..193796d 100644 --- a/src/views/construction/manage/hoistManage/hoistManage.vue +++ b/src/views/construction/manage/hoistManage/hoistManage.vue @@ -184,10 +184,8 @@ export default { pageNum: 0, pageSize: 10 }, - // 预警信息定时刷新 + // 定时刷新 intervalId: null, - // 选中的吊装设备 - checkDevCode: null }; }, created() { @@ -207,7 +205,7 @@ export default { methods: { startRefresh() { // 每10分钟刷新一次 - this.intervalId = setInterval(this.refreshData, 1000 * 60 * 10); + this.intervalId = setInterval(this.refreshData, 1000 * 60 * 5); }, stopRefresh() { if (this.intervalId) { diff --git a/src/views/construction/manage/personManage/personManage.vue b/src/views/construction/manage/personManage/personManage.vue index a521608..2b05123 100644 --- a/src/views/construction/manage/personManage/personManage.vue +++ b/src/views/construction/manage/personManage/personManage.vue @@ -314,10 +314,10 @@ export default { this.getPersonsTree(); }, mounted(){ - alert('页面初始化完成'); + // alert('页面初始化完成'); }, destroyed(){ - alert('页面销毁了'); + // alert('页面销毁了'); }, methods: { // 当前日期 @@ -440,14 +440,19 @@ export default { } }, // 自动验证配置详情 - getCheckConfigDetail() { - getCheckConfig().then((res) => { + async getCheckConfigDetail() { + let loading = this.$loading({ + lock: true, + text: "数据加载中,请稍候...", + background: 'rgba(0,0,0,0.2)' + }) + await getCheckConfig().then((res) => { if (res.data && res.data.length > 0) { const data = res.data; const configType = data[0].configType + ''; if (configType === '1') { data.forEach((item, index) => { - this.form.times.push({ value: item.time, key: Date.now() }) + this.form.times.push({ value: item.time, key: Date.now() + index }) }) } else if (configType === '2') { this.form.timeNum = parseInt(res.data[0].time); @@ -456,9 +461,11 @@ export default { } else { this.form.configType = '1'; } + }).catch((res) => { }) + loading.close(); this.dialogVisible2 = true; }, // 模式选择为固定时间-添加多个时间 diff --git a/src/views/construction/manage/realTimeManage/realTimeManage.vue b/src/views/construction/manage/realTimeManage/realTimeManage.vue index 76d4efb..f152da4 100644 --- a/src/views/construction/manage/realTimeManage/realTimeManage.vue +++ b/src/views/construction/manage/realTimeManage/realTimeManage.vue @@ -76,7 +76,7 @@
-
@@ -164,7 +164,11 @@ export default { // 窗口数量 boxNum: 1,//1窗口或4窗口 boxIndex:1,//视频下标 - classStyle: 'ball-content' + classStyle: 'ball-content', + // 定时刷新 + intervalId: null, + // 选中树节点ID + checkNodeId:null }; }, created() { @@ -175,11 +179,45 @@ export default { this.$nextTick(() => { this.busy = false; }); + this.startRefresh(); + }, + destroyed() { + this.stopRefresh(); }, methods: { + startRefresh() { + // 每10分钟刷新一次 + this.intervalId = setInterval(this.refreshData, 1000 * 60 * 10); + }, + stopRefresh() { + if (this.intervalId) { + clearInterval(this.intervalId); + this.intervalId = null; + } + }, + async refreshData() { + // 定时刷新球机树数据 + this.treeData.splice(0); + this.idArr.splice(0); + await this.laodBallDeviceLists(); + if(this.filterText){ + this.$refs.tree.filter(); + } + if(this.checkNodeId){ + this.$refs.tree.setCurrentKey(this.checkNodeId); + } + // 定时刷新预警信息 + this.warnInfoArr.splice(0); + this.queryParams.pageNum = 0; + this.isHasData = true; + this.loadWarnInfoData(); + // 刷新球机违章识别 + this.vioArr.splice(0); + this.loadBallWarnLists(); + }, /* 加载球机树 */ - laodBallDeviceLists() { - getBallDeviceLists().then(res => { + async laodBallDeviceLists() { + await getBallDeviceLists().then(res => { const treeData = res.data; if (treeData && treeData.length > 0) { this.treeData = treeData @@ -293,7 +331,7 @@ export default { }, //球机树节点点击 handleNodeClick(data, node, item) {// 点击球机时触发的事件 - console.log(node) + this.checkNodeId = data.id; if (node.level === 2) { if(this.boxNum==1){ this.$refs[`monitor`+1].closeVideo()