优化BasicSelectTree

master
LiuJiaNan 2025-12-08 10:56:59 +08:00
parent 20f3ff46a9
commit 25371cab89
1 changed files with 16 additions and 15 deletions

View File

@ -51,8 +51,8 @@ function BasicSelectTree(props) {
} }
onGetNodePaths?.(arrayObjectDeduplication(parentNodes, idKey)); onGetNodePaths?.(arrayObjectDeduplication(parentNodes, idKey));
onGetLabel?.(label); onGetLabel?.(label);
return;
} }
else {
const parentNodes = getTreeNodePaths({ const parentNodes = getTreeNodePaths({
data: treeData, data: treeData,
targetId: value, targetId: value,
@ -63,6 +63,7 @@ function BasicSelectTree(props) {
onGetNodePaths?.(parentNodes); onGetNodePaths?.(parentNodes);
onGetLabel?.(parentNodes[parentNodes.length - 1][nameKey]); onGetLabel?.(parentNodes[parentNodes.length - 1][nameKey]);
} }
}
else { else {
onGetNodePaths?.([]); onGetNodePaths?.([]);
onGetLabel?.(""); onGetLabel?.("");