From 041f90c71cfc79dcf51c67cbd13fefa099640333 Mon Sep 17 00:00:00 2001
From: yangjun <1173114630@qq.com>
Date: Tue, 26 Aug 2025 13:46:04 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9F=A5=E8=AF=A2=E5=AE=9A?=
=?UTF-8?q?=E4=BD=8D=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../ConfigServiceDirectiveList.vue | 74 ++++++++++---------
1 file changed, 41 insertions(+), 33 deletions(-)
diff --git a/src/views/services/serviceDirective/ConfigServiceDirectiveList.vue b/src/views/services/serviceDirective/ConfigServiceDirectiveList.vue
index 1469db5..dfeb836 100644
--- a/src/views/services/serviceDirective/ConfigServiceDirectiveList.vue
+++ b/src/views/services/serviceDirective/ConfigServiceDirectiveList.vue
@@ -34,19 +34,22 @@
-
+ -->
新增分类标签
-
+
-
+
@@ -716,34 +719,39 @@ function getDropDownAction(record) {
}
function expandTreeNodeToLevel4(directiveData: any) {
- // 清空之前展开的节点
- expandedKeys.value = [];
- // 递归查找并展开相应的节点
- const findAndExpandNode = (nodes: any[], level: number, directiveData: any) => {
- for (const node of nodes) {
- // 判断当前节点的 level 是否与 directiveData 的级别匹配
- if (level === 1 && node.instructionId === directiveData.instructionTagId) {
- expandedKeys.value.push(node.key);
- if (node.children && node.children.length > 0) {
- findAndExpandNode(node.children, 2, directiveData);
- }
- } else if (level === 2 && node.categoryId === directiveData.categoryId) {
- expandedKeys.value.push(node.key);
- if (node.children && node.children.length > 0) {
- findAndExpandNode(node.children, 3, directiveData);
- }
- } else if (level === 3 && node.typeId === directiveData.typeId) {
- expandedKeys.value.push(node.key);
- if (node.children && node.children.length > 0) {
- findAndExpandNode(node.children, 4, directiveData);
- }
- } else if (level === 4 && node.key === directiveData.id) {
- expandedKeys.value.push(node.key);
- }
- }
- };
- // 调用递归方法,从树的根节点开始查找
- findAndExpandNode(treeData.value, 1, directiveData);
+console.log("🚀 ~ expandTreeNodeToLevel4 ~ directiveData:", directiveData)
+
+
+ selectedKeys.value = [ directiveData.instructionTagId, directiveData.categoryId, directiveData.typeId, directiveData.id ]
+ openKeys.value = [ directiveData.instructionTagId, directiveData.categoryId, directiveData.typeId, directiveData.id ]
+ // // 清空之前展开的节点
+ // expandedKeys.value = [];
+ // // 递归查找并展开相应的节点
+ // const findAndExpandNode = (nodes: any[], level: number, directiveData: any) => {
+ // for (const node of nodes) {
+ // // 判断当前节点的 level 是否与 directiveData 的级别匹配
+ // if (level === 1 && node.instructionId === directiveData.instructionTagId) {
+ // expandedKeys.value.push(node.key);
+ // if (node.children && node.children.length > 0) {
+ // findAndExpandNode(node.children, 2, directiveData);
+ // }
+ // } else if (level === 2 && node.categoryId === directiveData.categoryId) {
+ // expandedKeys.value.push(node.key);
+ // if (node.children && node.children.length > 0) {
+ // findAndExpandNode(node.children, 3, directiveData);
+ // }
+ // } else if (level === 3 && node.typeId === directiveData.typeId) {
+ // expandedKeys.value.push(node.key);
+ // if (node.children && node.children.length > 0) {
+ // findAndExpandNode(node.children, 4, directiveData);
+ // }
+ // } else if (level === 4 && node.key === directiveData.id) {
+ // expandedKeys.value.push(node.key);
+ // }
+ // }
+ // };
+ // // 调用递归方法,从树的根节点开始查找
+ // findAndExpandNode(treeData.value, 1, directiveData);
}
/**