fix: 看板拓扑网元状态数量统计

This commit is contained in:
TsMask
2024-01-30 10:26:29 +08:00
parent fd07b00b5d
commit 2e1e0f2cff
3 changed files with 52 additions and 18 deletions

View File

@@ -45,6 +45,23 @@ export const graphNodeState = computed(() =>
}))
);
/**图节点网元状态数量 */
export const graphNodeStateNum = computed(() => {
let normal = 0;
let abnormal = 0;
for (const item of graphState.data.nodes) {
const neId = item.neState.neId;
if (neId) {
if (item.neState.online) {
normal += 1;
} else {
abnormal += 1;
}
}
}
return [normal, abnormal];
});
/**neStateParse 网元状态 数据解析 */
export function neStateParse(neType: string, data: Record<string, any>) {
const { combos, edges, nodes } = graphState.data;