mirror of
https://github.com/PlayEdu/backend
synced 2025-06-10 16:54:06 +08:00
部门学院学习明细
This commit is contained in:
parent
516c718c78
commit
ea934eae07
@ -60,9 +60,9 @@ const MemberLearnPage = () => {
|
|||||||
if (depValue === 0) {
|
if (depValue === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let arr = courses[depValue];
|
let arr = [...courses[depValue]];
|
||||||
let arr2 = openCourses;
|
let arr2 = [...openCourses];
|
||||||
if (arr.length > 0) {
|
if (arr2.length > 0) {
|
||||||
var data = arr.concat(arr2);
|
var data = arr.concat(arr2);
|
||||||
setCurrentCourses(data);
|
setCurrentCourses(data);
|
||||||
} else {
|
} else {
|
||||||
@ -154,15 +154,20 @@ const MemberLearnPage = () => {
|
|||||||
setCourses(res.data.dep_courses);
|
setCourses(res.data.dep_courses);
|
||||||
setOpenCourses(res.data.open_courses);
|
setOpenCourses(res.data.open_courses);
|
||||||
setRecords(res.data.user_course_records);
|
setRecords(res.data.user_course_records);
|
||||||
let box: any = [];
|
if (res.data.departments.length > 0) {
|
||||||
res.data.departments.map((item: any) => {
|
let box: any = [];
|
||||||
box.push({
|
res.data.departments.map((item: any) => {
|
||||||
label: item.name,
|
box.push({
|
||||||
value: String(item.id),
|
label: item.name,
|
||||||
|
value: String(item.id),
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
setDepValue(Number(box[0].value));
|
||||||
setDepValue(Number(box[0].value));
|
setDeps(box);
|
||||||
setDeps(box);
|
} else {
|
||||||
|
setDepValue(0);
|
||||||
|
setDeps([]);
|
||||||
|
}
|
||||||
setLoading2(false);
|
setLoading2(false);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user