修改数据来源

This commit is contained in:
guanj
2026-01-08 19:51:43 +08:00
parent 4cbd2e43cb
commit e21ae50e51
20 changed files with 2639 additions and 2570 deletions

View File

@@ -34,19 +34,19 @@ const deviceTree = ref([])
const activeName = ref('1')
const key = ref(0)
getDeviceTree().then(res => {
res.data.forEach((item: any) => {
item.value = item.id
item.label = item.name
item.children.forEach((child: any) => {
child.value = child.id
child.label = child.name
child.children.forEach((grand: any) => {
grand.value = grand.id
grand.label = grand.name
delete grand.children
})
})
})
// res.data.forEach((item: any) => {
// item.value = item.id
// item.label = item.name
// item.children.forEach((child: any) => {
// child.value = child.id
// child.label = child.name
// child.children.forEach((grand: any) => {
// grand.value = grand.id
// grand.label = grand.name
// delete grand.children
// })
// })
// })
deviceTree.value = res.data
key.value += 1
})