补提 dev 上未进主干的 10 个改动(运力组织/运单导入/凭证批次/运输计划) #17
@@ -143,7 +143,9 @@ export default {
|
||||
for (const node of tree || []) {
|
||||
const path = [...parents, String(node.id)];
|
||||
if (String(node.id) === String(target)) return path;
|
||||
const matched = this.findOrgPath(target, node.children, path);
|
||||
// 必须显式传 node.children || []:叶节点的 children 是 undefined,
|
||||
// 传 undefined 会触发默认参数重新拿到整棵树,逐层重复扫描直到爆栈
|
||||
const matched = this.findOrgPath(target, node.children || [], path);
|
||||
if (matched) return matched;
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user