提交更改版本
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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[] = []
|
||||
|
||||
Reference in New Issue
Block a user