From 294a3fdb786c8de3cc7e08177fe74eeab140b0ac Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期四, 17 九月 2026 15:55:04 +0800
Subject: [PATCH] feat: 1上传地址

---
 src/utils/standardTree.js |   22 ++++++++++++++++++----
 1 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/src/utils/standardTree.js b/src/utils/standardTree.js
index 458f12d..9f96784 100644
--- a/src/utils/standardTree.js
+++ b/src/utils/standardTree.js
@@ -1,7 +1,8 @@
 /**
  * 鏍囧噯搴撴爲閫氱敤宸ュ叿
  *
- * 灞傜骇涓嶅浐瀹氾細children 涓� null / undefined / 绌烘暟缁勭殑鑺傜偣鍗充负銆屾爣鍑嗐�嶅彾瀛愩��
+ * 鏍囧噯搴撳浐瀹氫袱绾э細code=[1] 涓鸿涓氾紝code=[2] 涓烘爣鍑嗐��
+ * 鍏煎娌℃湁 code 鐨勬棫鎺ュ彛鏁版嵁鏃讹紝鍐嶅洖閫�鍒� children 鍒ゆ柇鍙跺瓙銆�
  * 鏍戣矾寰勭粺涓�鐢� " - " 杩炴帴锛屾牸寮忎笌鍘嗗彶瀹炵幇閫愬瓧鑺備繚鎸佷竴鑷达細
  * 椤跺眰鐪熷疄鑺傜偣鐨� parent 鏄� Element UI 鐨勮櫄鎷熸牴锛屽洜姝ゆ牴鑺傜偣浼氳繘鍏ヨ矾寰勩��
  */
@@ -9,6 +10,8 @@
 // 鏄惁鍙跺瓙锛堟爣鍑嗭級
 export function isLeaf(data) {
   if (!data) return true;
+  if (data.code === '[1]') return false;
+  if (data.code === '[2]') return true;
   const children = data.children;
   return children === null || children === undefined || children.length === 0;
 }
@@ -33,7 +36,10 @@
   let cur = node;
   while (cur && cur.parent) {
     if (isLeaf(cur.data)) {
-      tokens.push(cur.label, leafMarker);
+      const leafValue = cur.data && cur.data.standardMethodId
+        ? (cur.data.value || cur.label)
+        : cur.label;
+      tokens.push(leafValue, leafMarker);
     } else {
       tokens.push(cur.label);
     }
@@ -72,6 +78,14 @@
 // 鍘绘帀璺緞鏈锛岀敤浜庛�屽綋鍓嶆槸鍙跺瓙浣嗘煡涓嶅埌鏍囧噯銆嶆椂鍥為��鍒扮埗绾ф煡璇�
 export function dropLastLabel(path) {
   if (!path) return '';
-  const idx = path.lastIndexOf(' - ');
-  return idx === -1 ? '' : path.slice(0, idx);
+  const tokens = path.split(' - ');
+  if (tokens.length <= 1) return '';
+  // 鍙跺瓙璺緞鏍煎紡涓衡�滆涓� - null - 鏍囧噯鈥濇垨鈥滆涓� -  - 鏍囧噯鈥濄��
+  // 鍘绘帀鏍囧噯鍚嶅悗杩樿鍘绘帀浠呯敤浜庢爣璇嗗彾瀛愮殑鍗犱綅娈碉紝鐖惰矾寰勬墠鏄湡瀹炵殑琛屼笟璺緞銆�
+  tokens.pop();
+  const marker = tokens[tokens.length - 1];
+  if (marker === '' || marker === 'null') {
+    tokens.pop();
+  }
+  return tokens.join(' - ');
 }

--
Gitblit v1.9.3