From 807df6dedd5078e0dd9f6515a8e1ea93e19a6f52 Mon Sep 17 00:00:00 2001 From: zhang_12370 <z2864490065@outlook.com> Date: 星期三, 25 六月 2025 15:21:51 +0800 Subject: [PATCH] 文档管理 树形菜单 新增修改优化 生产加工模块的 数据tags 显示 生产人的匹配 --- src/views/archiveManagement/index.vue | 24 +++++++++--------------- 1 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/views/archiveManagement/index.vue b/src/views/archiveManagement/index.vue index c3e56e4..f1fb1e2 100644 --- a/src/views/archiveManagement/index.vue +++ b/src/views/archiveManagement/index.vue @@ -201,15 +201,14 @@ ElMessage.error("鎿嶄綔澶辫触锛岃绋嶅悗閲嶈瘯"); } }; -// 褰撳墠缁勪欢鐨勬暟鎹� -const initTreeData = ref([]); // 鏍戝舰鏁版嵁 + const centerDialogVisible = (val) => { dialogVisible.value = val; }; const tableSwitch = ref(false); // 澶勭悊鑺傜偣鐐瑰嚮 const handleNodeClick = (data) => { - initTreeData.value = data || []; + console.log("鐐瑰嚮鑺傜偣", data); tableSwitch.value = true; // 鍒囨崲鑺傜偣鏃堕噸缃埌绗竴椤� queryParams.current = 1; @@ -227,7 +226,7 @@ // 纭繚缁勪欢寮曠敤瀛樺湪鍚庡啀璋冪敤鏂规硶 nextTick(() => { if (archiveDialogs.value && typeof archiveDialogs.value.initForm === 'function') { - archiveDialogs.value.initForm(initTreeData); // 閲嶇疆琛ㄥ崟 + archiveDialogs.value.initForm(); // 閲嶇疆琛ㄥ崟 } }); } catch (error) { @@ -489,15 +488,16 @@ const hasChildren = data.children; const nodeKey = data.id || data; const node = treeRef.value?.getNode(nodeKey); - const isExpanded = node?.expanded; - - // 濡傛灉鏈夊瓙绾т笖鏈睍寮�锛屽厛灞曞紑鑺傜偣 + const isExpanded = node?.expanded; // 濡傛灉鏈夊瓙绾т笖鏈睍寮�锛屽厛灞曞紑鑺傜偣 if (hasChildren && !isExpanded) { - if (treeRef.value && treeRef.value.store && treeRef.value.store.nodesMap[nodeKey]) { + if ( + treeRef.value && + treeRef.value.store && + treeRef.value.store.nodesMap[nodeKey] + ) { treeRef.value.store.nodesMap[nodeKey].expanded = true; } } - const newNode = { name: "鏂板瓙鑺傜偣", isEdit: true, @@ -508,12 +508,6 @@ } data.children.push(newNode); newName.value = "鏂板瓙鑺傜偣"; - - // 纭繚鐖惰妭鐐瑰睍寮� - if (node) { - node.expanded = true; - expandParentNodes(node); - } // 鏍规嵁鏄惁闇�瑕佸睍寮�鏉ュ喅瀹氬欢杩熸椂闂� const delay = hasChildren && !isExpanded ? 200 : 50; -- Gitblit v1.9.3