fix: 拓扑信息首个非OMC的异常显示问题

This commit is contained in:
TsMask
2024-05-11 18:03:49 +08:00
parent 56833b654e
commit 1e2c2b5170

View File

@@ -61,7 +61,7 @@ function fnGetList(refresh: boolean = false) {
res.data.length > 0 res.data.length > 0
) { ) {
// 根网管 // 根网管
let rootNodeInfo = { neName: undefined }; let rootNodeInfo = { neName: "OMC_001" };
const nodes = []; const nodes = [];
const edges = []; const edges = [];
for (const item of res.data) { for (const item of res.data) {
@@ -70,7 +70,7 @@ function fnGetList(refresh: boolean = false) {
const nodeIndex = nodes.findIndex(v => v.id === item.neName); const nodeIndex = nodes.findIndex(v => v.id === item.neName);
if (nodeIndex === -1) { if (nodeIndex === -1) {
if (item.neType === 'OMC') { if (item.neType === 'OMC') {
nodes.push({ nodes.unshift({
id: item.neName, id: item.neName,
label: item.neName, label: item.neName,
info: item, info: item,
@@ -120,7 +120,7 @@ function fnGetList(refresh: boolean = false) {
}); });
} }
} else { } else {
edges.push({ edges.unshift({
source: item.neName, source: item.neName,
target: rootNodeInfo.neName, target: rootNodeInfo.neName,
label: `${item.neName}-${rootNodeInfo.neName}`, label: `${item.neName}-${rootNodeInfo.neName}`,
@@ -140,6 +140,7 @@ function fnGetList(refresh: boolean = false) {
}) })
.then(hasNeList => { .then(hasNeList => {
if (!hasNeList) return; if (!hasNeList) return;
console.log(graphG6Data)
if (refresh) { if (refresh) {
// graphG6.value.get('canvas').set('localRefresh', true); // graphG6.value.get('canvas').set('localRefresh', true);
graphG6.value.destroy(); graphG6.value.destroy();