联调算法库

修改冀北台账问题
This commit is contained in:
GGJ
2024-09-11 20:37:40 +08:00
parent a8c1fa46c0
commit 28d9af0cb4
11 changed files with 437 additions and 230 deletions

View File

@@ -39,11 +39,14 @@ const info = (id: any) => {
item4.children.forEach((item5: any) => {
item5.icon = 'el-icon-OfficeBuilding'
item5.level = 300
item5.id = item4.id
// item5.id = item4.id
item5.children.forEach((item6: any) => {
item6.icon = 'el-icon-HelpFilled'
item6.level = 300
item6.id = item4.id
if (item6.name == '电网侧' && item6.children.length == 0) {
item6.level = 400
} else {
item6.level = 400
}
item6.children.forEach((item7: any) => {
item7.icon = 'el-icon-Film'
item7.level = 400

View File

@@ -1,7 +1,16 @@
<template>
<div class="point-tree">
<div style="flex: 1; overflow: hidden">
<Tree ref="treeRef" :data="tree" style="width: 100%; height: 100%" :canExpand="false" v-bind="$attrs" />
<Tree
ref="treeRef"
:data="tree"
:canExpand="false"
style="width: 100%; height: 100%"
v-bind="$attrs"
default-expand-all
addTree
@onAddTree="onAddTree"
/>
</div>
</div>
</template>
@@ -13,11 +22,11 @@ import { useAdminInfo } from '@/stores/adminInfo'
import { useDictData } from '@/stores/dictData'
import { getTerminalTreeForFive } from '@/api/device-boot/terminalTree'
import { useConfig } from '@/stores/config'
import { queryAllAlgorithmLibrary } from '@/api/supervision-boot/database/index'
defineOptions({
name: 'pms/pointTree'
})
const emit = defineEmits(['init'])
const emit = defineEmits(['init', 'onAddTree'])
const attrs = useAttrs()
const adminInfo = useAdminInfo()
const dictData = useDictData()
@@ -26,48 +35,45 @@ const classificationData = dictData.getBasicData('Statistical_Type', ['Report_Ty
const tree = ref()
const treeRef = ref()
const loadData = () => {
const loadData = (id?: any) => {
console.log('🚀 ~ loadData ~ id:', id)
let nodeKey = ''
let res = {
data: [
{
name: '运行管理',
id: '1',
children: [
{
name: '运行指标',
id: '2'
},
{
name: '数据质量核查',
id: '3'
}
]
}
]
}
// getTerminalTreeForFive(form).then(res => {
res.data.forEach((item: any) => {
item.icon = 'el-icon-FolderOpened'
item.color = config.getColorVal('elementUiPrimary')
item.children.forEach((item2: any) => {
item2.icon = 'el-icon-Document'
queryAllAlgorithmLibrary().then(res => {
res.data.forEach((item: any) => {
item.icon = 'el-icon-FolderOpened'
item.color = config.getColorVal('elementUiPrimary')
item.children.forEach((item2: any) => {
item2.icon = 'el-icon-Document'
item2.color = config.getColorVal('elementUiPrimary')
item2.childrens = item2.children
item2.children = []
if (item2.id == id) {
emit('init', item2)
}
})
})
nodeKey = res.data[0].children[0].id
tree.value = res.data
if (id) {
setTimeout(() => {
treeRef.value.treeRef.setCurrentKey(id)
}, 10)
} else {
setTimeout(() => {
treeRef.value.treeRef.setCurrentKey(nodeKey)
emit('init', res.data[0].children[0])
}, 10)
}
})
}
nodeKey = res.data[0].children[0].id
emit('init', res.data[0].children[0])
tree.value = res.data
if (nodeKey) {
setTimeout(() => {
treeRef.value.treeRef.setCurrentKey(nodeKey)
}, 10)
}
// })
const onAddTree = () => {
emit('onAddTree')
}
loadData()
defineExpose({ loadData })
</script>
<style lang="scss">
.point-tree {