From 7e399e5ba071e431599aff9ca20849ead34a4c87 Mon Sep 17 00:00:00 2001 From: z_yu <1534695664@qq.com> Date: Wed, 17 Aug 2022 09:40:17 +0800 Subject: [PATCH] =?UTF-8?q?3D=E5=BA=93=E6=88=BF=E6=A1=A3=E6=A1=88=E5=BA=93?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../warehouse3D/archivesStorage/index.vue | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/views/storeManage/warehouse3D/archivesStorage/index.vue b/src/views/storeManage/warehouse3D/archivesStorage/index.vue index 58a5b18..17f5bde 100644 --- a/src/views/storeManage/warehouse3D/archivesStorage/index.vue +++ b/src/views/storeManage/warehouse3D/archivesStorage/index.vue @@ -113,6 +113,7 @@ export default { url: '', allDeviceIds: [], oaoMessage: [], + timer: '', topDisplayData: { DAK_DIV_TOP_001: { show: false, @@ -179,6 +180,14 @@ export default { _this.deviceState() } window.addEventListener('message', this.handleMessageDevice) + // 定时请求第三方数据,更新页面数据 + setInterval(async() => { + await _this.getRealTimeData() + _this.handleAQI() + }, 4000) + }, + beforeDestroy() { + clearInterval(this.timer) }, methods: { // 加载完成状态传值 @@ -215,7 +224,9 @@ export default { }, // 设置温湿度 handleAQI(deviceId, wendu, sidu) { - window.frames['iframeMap'].setAlertValue(deviceId, wendu, sidu) + this.oaoMessage.forEach(element => { + window.frames['iframeMap'].setAlertValue(element.id, element.wendu, element.sidu) + }) }, // 设置温湿度报警状况 handleAlarm(deviceId) { @@ -237,6 +248,7 @@ export default { }, getRealTimeData() { thirdApi.getRealTimeData({ ids: this.allDeviceIds, url: this.url }).then((data) => { + this.oaoMessage.splice(0, this.oaoMessage.length) this.displayConfigData.forEach(element => { if (element.divPosition.includes('TOP') && element.deviceSpecParams[0]) { const result = data.find((item) => {