From b55b4ad49d8148b40c0aa0316acdba61a80abcb2 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Fri, 19 Sep 2025 15:38:45 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=B4=BB=E5=8A=A8?= =?UTF-8?q?=E5=91=8A=E8=AD=A6=E8=87=AA=E5=8A=A8=E5=88=B7=E6=96=B0=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/BasicLayout.vue | 6 ++++ src/views/faultManage/active-alarm/index.vue | 34 ++++++++++++++++---- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/src/layouts/BasicLayout.vue b/src/layouts/BasicLayout.vue index f3dbbbf3..757f4f5d 100644 --- a/src/layouts/BasicLayout.vue +++ b/src/layouts/BasicLayout.vue @@ -208,6 +208,7 @@ let serverTime = reactive({ zone: 'UTC', // 时区 UTC interval: null as any, // 定时器 }); +let activeAlarmRefresh = 0; // 获取服务器时间 function fnGetServerTime() { @@ -221,6 +222,7 @@ function fnGetServerTime() { serverTime.timestamp = parseInt(res.data.timestamp); serverTime.interval = setInterval(() => { serverTime.timestamp += 1000; + activeAlarmRefresh += 1; // serverTimeStr.value = parseDateToStr(serverTime.timestamp); // 用DOM直接修改 if (serverTimeDom) { @@ -229,6 +231,10 @@ function fnGetServerTime() { YYYY_MM_DD_HH_MM_SSZ ); } + if (activeAlarmRefresh === 5) { + useAlarmStore().fnGetActiveAlarmInfo(); + activeAlarmRefresh = 0; + } }, 1000); } }); diff --git a/src/views/faultManage/active-alarm/index.vue b/src/views/faultManage/active-alarm/index.vue index ba320443..0119f4af 100644 --- a/src/views/faultManage/active-alarm/index.vue +++ b/src/views/faultManage/active-alarm/index.vue @@ -1,5 +1,5 @@ @@ -1201,7 +1220,7 @@ onMounted(() => { > {{ modalState.from.alarmType }} - + { > {{ modalState.from.locationInfo }} - + { :label="t('views.faultManage.activeAlarm.ackState')" name="ackState" > - +