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); });