From d07f76351fa34a0f3b65d6f6f6e784aabd3a0b98 Mon Sep 17 00:00:00 2001
From: wujingjing <gersonwu@qq.com>
Date: 星期一, 21 十月 2024 15:00:34 +0800
Subject: [PATCH] 精简代码

---
 src/views/project/yw/dataManage/knowledge/Knowledge.vue |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

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