diff --git a/src/views/dashboard/overview/components/Topology/index.vue b/src/views/dashboard/overview/components/Topology/index.vue index 983ae936..907dec6f 100644 --- a/src/views/dashboard/overview/components/Topology/index.vue +++ b/src/views/dashboard/overview/components/Topology/index.vue @@ -14,9 +14,7 @@ import { notNeNodes, } from '../../hooks/useTopology'; import useI18n from '@/hooks/useI18n'; -import useWS from '../../hooks/useWS'; const { t } = useI18n(); -const { wsSend } = useWS(); /**图DOM节点实例对象 */ const graphG6Dom = ref(undefined); @@ -239,41 +237,12 @@ function fnGraphDataLoad(reload: boolean = false) { } else { handleRanderGraph(graphG6Dom.value, graphState.data); } - fnGetState(); // 获取网元状态 }); } -/**网元状态定时器 */ -const stateTimeout = ref(null); - -/**查询网元状态 */ -async function fnGetState() { - clearTimeout(stateTimeout.value); - // 获取节点状态 - for (const node of graphState.data.nodes) { - if (notNeNodes.includes(node.id)) continue; - const { neType, neId } = node.neInfo; - if (!neType || !neId) continue; - wsSend({ - requestId: `neState_${neType}_${neId}`, - type: 'ne_state', - data: { - neType: neType, - neId: neId, - }, - }); - } - - stateTimeout.value = setTimeout(() => fnGetState(), 10_000); -} - onMounted(() => { fnGraphDataLoad(false); }); - -onBeforeUnmount(() => { - clearTimeout(stateTimeout.value); -});