云设备录入

This commit is contained in:
sjl
2025-10-11 10:35:25 +08:00
parent 2e58e58c73
commit a3b6a5c0be
23 changed files with 9302 additions and 3827 deletions

View File

@@ -31,6 +31,7 @@ const info = () => {
tree.value = []
let arr1: any[] = []
let arr2: any[] = []
let arr3: any[] = []
getLineTree().then(res => {
//治理设备
res.data.map((item: any) => {
@@ -70,10 +71,33 @@ const info = () => {
arr2.push(item2)
})
})
} else if (item.name == '云前置设备') {
item.children.forEach((item: any) => {
item.icon = 'el-icon-HomeFilled'
item.level = 1
item.color = config.getColorVal('elementUiPrimary')
item.children.forEach((item2: any) => {
item2.icon = 'el-icon-List'
item2.level = 1
item2.color = config.getColorVal('elementUiPrimary')
item2.children.forEach((item3: any) => {
item3.icon = 'el-icon-Platform'
item3.level = 1
item3.color =
item3.comFlag === 2 ? config.getColorVal('elementUiPrimary') : '#e26257 !important'
item3.children.forEach((item4: any) => {
item4.icon = 'el-icon-Platform'
item4.color =
item4.comFlag === 2 ? config.getColorVal('elementUiPrimary') : '#e26257 !important'
// item4.color = '#e26257 !important'
arr3.push(item4)
})
})
})
})
}
})
tree.value = res.data
nextTick(() => {
if (arr1.length) {
//初始化选中
@@ -83,18 +107,29 @@ const info = () => {
level: 2,
...arr1[0]
})
return
}
if (arr2.length) {
//初始化选中
treRef.value.treeRef2.setCurrentKey(arr2[0].id)
// 注册父组件事件
emit('init', {
level: 2,
...arr2[0]
})
return
}
if(arr3.length){
treRef.value.treeRef3.setCurrentKey(arr3[0].id)
emit('init', {
level: 2,
...arr3[0]
})
return
}
// if (arr2.length) {
// //初始化选中
// treRef.value.treeRef2.setCurrentKey(arr2[0].id)
// // 注册父组件事件
// emit('init', {
// level: 2,
// ...arr2[0]
// })
// }
else {
emit('init', arr2[0])
emit('init')
return
}
})
})