Skip to content

Commit e2470a3

Browse files
committed
解决部门列表删除按钮不显示问题
1 parent 2477a44 commit e2470a3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/cool/utils/index.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -244,13 +244,15 @@ export function revDeepTree(list: any[]) {
244244
const arr: any[] = [];
245245
let id = 0;
246246

247-
function deep(list: any[], parentId: any) {
247+
function deep(list: any[], parentId: number) {
248248
list.forEach((e) => {
249249
if (!e.id) {
250250
e.id = id++;
251251
}
252252

253-
e.parentId = parentId;
253+
if (!e.parentId) {
254+
e.parentId = parentId;
255+
}
254256

255257
arr.push(e);
256258

@@ -260,7 +262,7 @@ export function revDeepTree(list: any[]) {
260262
});
261263
}
262264

263-
deep(list || [], null);
265+
deep(list || [], 0);
264266

265267
return arr;
266268
}

0 commit comments

Comments
 (0)