From 323da55c9db0052609231bce57e1971c1b9651a5 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Wed, 15 Oct 2025 11:42:27 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E6=A0=B9=E7=BD=91?= =?UTF-8?q?=E7=AE=A1=E8=8A=82=E7=82=B9=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= =?UTF-8?q?=EF=BC=8C=E6=94=AF=E6=8C=81=E6=97=A0OMC=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/monitor/topology/index.vue | 45 ++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/src/views/monitor/topology/index.vue b/src/views/monitor/topology/index.vue index fdb9d274..fd3080ce 100644 --- a/src/views/monitor/topology/index.vue +++ b/src/views/monitor/topology/index.vue @@ -64,10 +64,50 @@ function fnGetList(refresh: boolean = false) { Array.isArray(res.data) && res.data.length > 0 ) { - // 根网管 - let rootNodeInfo = { neName: 'OMC_001' }; const nodes = []; const edges = []; + + // 根网管 + let rootNodeInfo = { + neName: 'ROOT', + serverState: { + online: true, + }, + }; + // 处理没有OMC的情况 + const omcFilter = res.data.filter(v => v.neType === 'OMC'); + if (omcFilter.length === 1) { + rootNodeInfo.neName = omcFilter[0].neName; + } else { + nodes.unshift({ + id: rootNodeInfo.neName, + label: rootNodeInfo.neName, + info: rootNodeInfo, + labelCfg: { + position: 'bottom', + offset: 8, + style: { + fill: '#fff', + fontSize: 14, + }, + }, + size: 60, + icon: { + x: -30, + y: -30, + // 可更换为其他图片地址 + img: parseBasePath('/svg/service_db.svg'), + width: 60, + height: 60, + }, + }); + edges.push({ + source: rootNodeInfo.neName, + target: rootNodeInfo.neName, + label: `${rootNodeInfo.neName}-${rootNodeInfo.neName}`, + }); + } + for (const item of res.data) { item.serverState = {}; // 节点 @@ -96,7 +136,6 @@ function fnGetList(refresh: boolean = false) { height: 60, }, }); - !rootNodeInfo.neName && (rootNodeInfo = item); } else { nodes.push({ id: item.neName,