提交更改版本

This commit is contained in:
zhujiyan
2024-07-22 10:35:01 +08:00
parent 33a41b9d7a
commit bccf61c6d1
31 changed files with 180231 additions and 443 deletions

View File

@@ -23,7 +23,7 @@ const props = withDefaults(
}>(),
{
showCheckbox: false,
defaultCheckedKeys: [],
defaultCheckedKeys: []
}
)
@@ -64,9 +64,9 @@ getDeviceTree().then(res => {
}
})
})
const getTreeList = (list:any) => {
const getTreeList = (list: any) => {
let arr: any[] = []
list.forEach((item: any) => {
list.forEach((item: any) => {
item.icon = 'el-icon-HomeFilled'
item.color = config.getColorVal('elementUiPrimary')
item.children.forEach((item2: any) => {
@@ -83,7 +83,7 @@ const getTreeList = (list:any) => {
})
})
})
tree.value = list;
tree.value = list
nextTick(() => {
if (arr.length) {
treRef.value.treeRef.setCurrentKey(arr[0].id)
@@ -103,5 +103,5 @@ const handleCheckChange = (data: any) => {
data
})
}
defineExpose({getTreeList})
defineExpose({ getTreeList })
</script>

View File

@@ -1,5 +1,5 @@
<template>
<Tree ref="treRef" :data="tree" />
<Tree ref="treRef" :width="width" :data="tree" />
</template>
<script lang="ts" setup>
@@ -14,6 +14,7 @@ const emit = defineEmits(['init', 'checkChange'])
const config = useConfig()
const tree = ref()
const treRef = ref()
const width=ref('')
getLineTree().then(res => {
console.log(res.data, '设备监控666')
let arr1: any[] = []