联调接口

This commit is contained in:
xuli3099
2025-08-13 18:15:04 +08:00
parent 0728d92094
commit 28f24a90fd
18 changed files with 516 additions and 280 deletions

12
src/utils/common.js Normal file
View File

@@ -0,0 +1,12 @@
// 递归算法
export const initTree = (arr, parentId='0',id) => {
const tree = [];
arr.filter(item => item.parentId === parentId).forEach(item => {
const children = initTree(arr, item[id]);
if (children.length > 0) {
item.children = children;
}
tree.push(item);
});
return tree;
}