From be75846529e01dec21fca65176ae5de09c83b876 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Thu, 14 Sep 2023 16:32:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E9=80=BB=E8=BE=91=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/LineMonitorPage.vue | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/pages/LineMonitorPage.vue b/src/pages/LineMonitorPage.vue index 32e0925..4f81b2b 100644 --- a/src/pages/LineMonitorPage.vue +++ b/src/pages/LineMonitorPage.vue @@ -56,15 +56,11 @@ onMounted(() => { lineApp.bindDom(dom); onResize(); } - setTimeout(() => { - try { - if (lineApp) { - centerFaultDevice(); - } - } catch (error) { - console.warn('未找到具体故障设备'); - } - }, 1000); + lineApp.on('loadfinish', () => { + setTimeout(() => { + centerFaultDevice(); + }, 1000); + }); }); function onResize() { @@ -76,9 +72,13 @@ function onResize() { } function centerFaultDevice() { - const deviceId = lineNetStore.alarmInfo[0].locator_device_id; - const faultDevice = lineApp.queryStore.queryById(deviceId); - lineApp.makeGraphicCenterShow(faultDevice); + try { + const deviceId = lineNetStore.alarmInfo[0].locator_device_id; + const faultDevice = lineApp.queryStore.queryById(deviceId); + lineApp.makeGraphicCenterShow(faultDevice); + } catch (error) { + console.warn('未找到具体故障设备'); + } } onUnmounted(() => {