mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2025-12-16 08:38:48 +00:00
解决部门列表删除按钮不显示问题
This commit is contained in:
parent
2477a44ee5
commit
e2470a31bf
@ -244,13 +244,15 @@ export function revDeepTree(list: any[]) {
|
|||||||
const arr: any[] = [];
|
const arr: any[] = [];
|
||||||
let id = 0;
|
let id = 0;
|
||||||
|
|
||||||
function deep(list: any[], parentId: any) {
|
function deep(list: any[], parentId: number) {
|
||||||
list.forEach((e) => {
|
list.forEach((e) => {
|
||||||
if (!e.id) {
|
if (!e.id) {
|
||||||
e.id = id++;
|
e.id = id++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!e.parentId) {
|
||||||
e.parentId = parentId;
|
e.parentId = parentId;
|
||||||
|
}
|
||||||
|
|
||||||
arr.push(e);
|
arr.push(e);
|
||||||
|
|
||||||
@ -260,7 +262,7 @@ export function revDeepTree(list: any[]) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
deep(list || [], null);
|
deep(list || [], 0);
|
||||||
|
|
||||||
return arr;
|
return arr;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user