mirror of
https://github.com/fantasticit/think.git
synced 2026-11-03 08:43:16 +08:00
fix: fix array to tree when parentNode is null
This commit is contained in:
@@ -16,6 +16,7 @@ export function array2tree(list) {
|
||||
list[map[node.parentDocumentId]].children.push(node);
|
||||
} else {
|
||||
node.parentDocumentId = null; // 该节点的父节点无法访问
|
||||
roots.push(node);
|
||||
}
|
||||
} else {
|
||||
roots.push(node);
|
||||
|
||||
@@ -816,7 +816,7 @@ export class DocumentService {
|
||||
delete doc.state;
|
||||
});
|
||||
|
||||
return array2tree(docs.map((doc) => instanceToPlain(doc)));
|
||||
return array2tree(docs);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user