同步电网一张图代码

This commit is contained in:
GGJ
2024-06-04 16:56:57 +08:00
parent a0c64a4232
commit cf21d0a842
8 changed files with 832 additions and 266 deletions

View File

@@ -171,7 +171,9 @@ const tableStore = new TableStore({
let treeData = []
tableStore.table.data.forEach((item: any) => {
if (item.children.length > 0) {
item.id = item.children[0].pid
item.children.forEach((k: any) => {
k.pid = item.id
})
}
})
treeData = tree2List(tableStore.table.data)
@@ -195,7 +197,6 @@ const tree2List = (list: any) => {
// 遍历 tree 数组
list.forEach((item: any) => {
item.comFlag = item.comFlag == null ? 3 : item.comFlag
item.assess = item.onlineRate == 3.14159 ? 0 : item.onlineRate < 60 ? 1 : item.onlineRate < 90 ? 2 : 3
// 判断item是否存在children
if (!item.children) return arr.push(item)