提交更改版本

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[] = []

View File

@@ -12,6 +12,7 @@
size="18"
class="fold ml10 mt20 menu-collapse"
style="cursor: pointer"
v-if="route.path!='/admin/govern/reportCore/statistics/index'"
/>
<div class="cn-tree" :style="{ opacity: menuCollapse ? 0 : 1 }">
<div style="display: flex; align-items: center" class="mb10">
@@ -27,7 +28,7 @@
size="18"
class="fold ml10 menu-collapse"
style="cursor: pointer"
v-if="props.canExpand"
v-if="props.canExpand&&route.path!='/admin/govern/reportCore/statistics/index'"
/>
</div>
@@ -91,7 +92,7 @@
import useCurrentInstance from '@/utils/useCurrentInstance'
import { ElTree } from 'element-plus'
import { ref, watch } from 'vue'
import {useRoute} from 'vue-router'
defineOptions({
name: 'govern/tree'
})
@@ -104,11 +105,14 @@ interface Props {
}
const props = withDefaults(defineProps<Props>(), {
width: '280px',
width: '100%',
canExpand: true,
type: '',
data: []
})
const route=useRoute()
console.log(route,"6666677788889")
const { proxy } = useCurrentInstance()
const menuCollapse = ref(false)
const activeName = ref(0)
@@ -204,6 +208,7 @@ defineExpose({ treeRef1, treeRef2 })
padding: 10px;
height: 100%;
width: 100%;
background: #fff;
:deep(.el-tree) {
border: 1px solid var(--el-border-color);