This commit is contained in:
仲么了
2024-01-09 13:49:21 +08:00
parent 1d4bc5d442
commit 300d34c1bf
15 changed files with 655 additions and 224 deletions

View File

@@ -0,0 +1,35 @@
<template>
<Tree :data="tree" />
</template>
<script lang="ts" setup>
import { ref } from 'vue'
import Tree from './index.vue'
import { getDeviceTree } from '@/api/cs-device-boot/csLedger'
import { useConfig } from '@/stores/config'
defineOptions({
name: 'govern/deviceTree'
})
const config = useConfig()
const tree = ref()
getDeviceTree().then(res => {
let arr: any[] = []
res.data.forEach(item => {
item.icon = 'el-icon-HomeFilled'
item.color = config.getColorVal('elementUiPrimary')
item.children.forEach(item2 => {
item2.icon = 'el-icon-List'
item.color = config.getColorVal('elementUiPrimary')
item2.children.forEach(item3 => {
item3.icon = 'el-icon-Platform'
item3.color = config.getColorVal('elementUiPrimary')
if (item3.comFlag === 1) {
item3.color = '#e26257 !important'
}
arr.push(item3)
})
})
})
tree.value = res.data
})
</script>