|
@@ -108,10 +108,12 @@ export const fetchTaggingStyles = async () => {
|
|
|
params: reqParams,
|
|
|
});
|
|
|
const styles: any[] = [];
|
|
|
- const genTree = (tree: any, parent?: any) => {
|
|
|
+ const genTree = (tree: any, parent?: any, level = 0) => {
|
|
|
for (const item of tree) {
|
|
|
if (item.iconUrl) {
|
|
|
- delete parent.children;
|
|
|
+ if (level !== 0) {
|
|
|
+ delete parent.children;
|
|
|
+ }
|
|
|
__map[item.iconId] = item.dictId || parent.dictId
|
|
|
styles.push(toLocal({ ...item, iconTitle: parent.id }));
|
|
|
} else {
|
|
@@ -122,7 +124,7 @@ export const fetchTaggingStyles = async () => {
|
|
|
children: [],
|
|
|
};
|
|
|
parent.children.push(data);
|
|
|
- genTree(item.childrenList, data)
|
|
|
+ genTree(item.childrenList, data, ++level)
|
|
|
}
|
|
|
}
|
|
|
};
|