子系统栏显示调整

This commit is contained in:
fan 2022-06-27 13:22:25 +08:00
parent 83702c4c22
commit 8b8bdec3db

View File

@ -178,18 +178,20 @@ export default {
this.treeList = [];
res.data.forEach(item => {
const childList = [];
item && item.children && item.children.length > 3 && item.children.forEach(elem => {
if (elem.id === 'Lesson') {
childList[0] = elem;
} else if (elem.id === 'Exam') {
childList[3] = elem;
} else if (elem.id === 'Simulation') {
childList[1] = elem;
} else {
childList[2] = elem;
}
});
item.children = childList;
if (item && item.children && item.children.length > 3) {
item.children.forEach(elem => {
if (elem.id === 'Lesson') {
childList[0] = elem;
} else if (elem.id === 'Exam') {
childList[3] = elem;
} else if (elem.id === 'Simulation') {
childList[1] = elem;
} else {
childList[2] = elem;
}
});
item.children = childList;
}
});
}
this.treeList = res.data;