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