From 1a9aa77a1438db9e87aa0819fdecf12f9a614269 Mon Sep 17 00:00:00 2001 From: yangyin <1850366751@qq.com> Date: 星期三, 16 十月 2024 11:27:16 +0800 Subject: [PATCH] 修改数据中心左侧树只保留水务知识库 --- src/views/project/yw/dataManage/graph/GraphIndex.vue | 11 +++++++++-- src/views/project/yw/dataManage/knowledge/Knowledge.vue | 15 ++++++++++++--- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/views/project/yw/dataManage/graph/GraphIndex.vue b/src/views/project/yw/dataManage/graph/GraphIndex.vue index 840ca42..a9b915b 100644 --- a/src/views/project/yw/dataManage/graph/GraphIndex.vue +++ b/src/views/project/yw/dataManage/graph/GraphIndex.vue @@ -10,6 +10,7 @@ label: 'group_name', children: 'children', }" + defaultExpandAll :treedata="listTreeData" title-name="鍒嗙粍鍒楄〃" :show-more-operate="false" @@ -94,6 +95,7 @@ import mittBus from '/@/utils/mitt'; import { useCompRef } from '/@/utils/types'; import { convertFileSize, convertListToTree } from '/@/utils/util'; +import { OptClassificationMap, classificationEnum } from '/@/views/types/metrics'; const state = reactive({ tableParams: { PageIndex: 1, @@ -110,13 +112,18 @@ const listData = ref([]); const currentListID = computed(() => currentNode.value?.group_id); const currentNode = ref(null); - const listTreeData = computed(() => { - const result = convertListToTree(listData.value, { + const byParentData = convertListToTree(listData.value, { ID: 'group_id', ParentID: 'p_group_id', Children: 'children', }); + const result = []; + byParentData.forEach((item) => { + if (item.group_type == OptClassificationMap[classificationEnum.Knowledge]) { + result.push(item); + } + }); return result; }); diff --git a/src/views/project/yw/dataManage/knowledge/Knowledge.vue b/src/views/project/yw/dataManage/knowledge/Knowledge.vue index d5f5061..86297a3 100644 --- a/src/views/project/yw/dataManage/knowledge/Knowledge.vue +++ b/src/views/project/yw/dataManage/knowledge/Knowledge.vue @@ -2,10 +2,10 @@ <div class="h100 overflow-y-auto"> <div class="flex flex-col h100"> <el-row class="h100"> - <el-col :span="4" class="h100"> + <el-col :span="4" class="h100 px-[10px]"> <LeftTreeByMgr v-loading="treeLoading" - class="h100" + class="h100 p-[20px]" ref="leftTreeRef" :defaultProps="{ id: 'group_id', @@ -16,6 +16,7 @@ title-name="鍒嗙粍鍒楄〃" :show-more-operate="false" :show-add="false" + defaultExpandAll :current-node-key="currentListID" :node-icon="() => 'ele-Document'" @click="handleClickNode" @@ -129,7 +130,9 @@ import { useCompRef } from '/@/utils/types'; import { convertListToTree } from '/@/utils/util'; import { SupervisorPublished, supervisorPublishedMap } from '/@/views/project/yw/lowCode/sqlAmis/types'; +import { OptClassificationMap, classificationEnum } from '/@/views/types/metrics'; import knowledgeLeft from '/static/images/knowledge/data_type_1.png'; +import item from 'element-plus/es/components/space/src/item'; const router = useRouter(); //#region ====================== 宸︿晶鏍戞暟鎹紝tree init ====================== const leftTreeRef = useCompRef(LeftTreeByMgr); @@ -138,11 +141,17 @@ const currentListID = computed(() => currentNode.value?.group_id); const currentNode = ref(null); const listTreeData = computed(() => { - const result = convertListToTree(listData.value, { + const byParentData = convertListToTree(listData.value, { ID: 'group_id', ParentID: 'p_group_id', Children: 'children', }); + const result = []; + byParentData.forEach((item) => { + if (item.group_type == OptClassificationMap[classificationEnum.Knowledge]) { + result.push(item); + } + }); return result; }); const handleClickNode = (data) => { -- Gitblit v1.9.3