From 74195bc88b8450a964f8e3a8f49e0b6449e1a6fe Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Thu, 21 Mar 2024 10:52:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=8B=93=E6=89=91=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E5=AE=9A=E6=97=B6=E5=99=A8=E6=94=B9=E8=B0=83?= =?UTF-8?q?=E5=BA=A6=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/monitor/topology/index.vue | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/views/monitor/topology/index.vue b/src/views/monitor/topology/index.vue index 54bf4cfe..1d9cebb9 100644 --- a/src/views/monitor/topology/index.vue +++ b/src/views/monitor/topology/index.vue @@ -27,12 +27,11 @@ function fnRanderData() { graphG6.value = randerGroph(t, graphG6Dom.value, graphG6Data); } -/**网元状态定时器 */ -const stateTimeout = ref(null); +/**网元状态调度器 */ +const interval10s = ref(null); /**查询网元状态 */ async function fnGetState() { - clearTimeout(stateTimeout.value); for (const node of graphG6Data.nodes) { const ne = node.info; // if (ne.neType === 'OMC') continue; @@ -48,7 +47,6 @@ async function fnGetState() { graphG6.value.setItemState(neShape, 'neState', ne.serverState.online); } } - stateTimeout.value = setTimeout(() => fnGetState(), 30_000); } /**查询全部网元数据列表 */ @@ -149,6 +147,9 @@ function fnGetList(refresh: boolean = false) { } fnRanderData(); fnGetState(); + interval10s.value = setInterval(() => { + fnGetState(); // 获取网元状态 + }, 10_000); }); } @@ -158,7 +159,7 @@ onMounted(() => { }); onBeforeUnmount(() => { - clearTimeout(stateTimeout.value); + clearInterval(interval10s.value); });