mirror of
https://github.com/PlayEdu/backend
synced 2025-12-23 07:09:27 +08:00
线上课新建、编辑优化
This commit is contained in:
@@ -105,15 +105,18 @@ export const CourseHourUpdate: React.FC<PropInterface> = ({
|
||||
|
||||
const selectData = (arr: any, videos: any) => {
|
||||
const hours: any = [];
|
||||
console.log(videos);
|
||||
for (let i = 0; i < videos.length; i++) {
|
||||
hours.push({
|
||||
chapter_id: 0,
|
||||
sort: i,
|
||||
title: videos[i].name,
|
||||
type: videos[i].type,
|
||||
duration: videos[i].duration,
|
||||
rid: videos[i].rid,
|
||||
});
|
||||
if (videos[i].disabled === false) {
|
||||
hours.push({
|
||||
chapter_id: 0,
|
||||
sort: i,
|
||||
title: videos[i].name,
|
||||
type: videos[i].type,
|
||||
duration: videos[i].duration,
|
||||
rid: videos[i].rid,
|
||||
});
|
||||
}
|
||||
}
|
||||
courseHour
|
||||
.storeCourseHourMulti(id, hours)
|
||||
@@ -135,14 +138,16 @@ export const CourseHourUpdate: React.FC<PropInterface> = ({
|
||||
}
|
||||
const hours: any = [];
|
||||
for (let i = 0; i < videos.length; i++) {
|
||||
hours.push({
|
||||
chapter_id: data[addvideoCurrent].id,
|
||||
sort: i,
|
||||
title: videos[i].name,
|
||||
type: videos[i].type,
|
||||
duration: videos[i].duration,
|
||||
rid: videos[i].rid,
|
||||
});
|
||||
if (videos[i].disabled === false) {
|
||||
hours.push({
|
||||
chapter_id: data[addvideoCurrent].id,
|
||||
sort: i,
|
||||
title: videos[i].name,
|
||||
type: videos[i].type,
|
||||
duration: videos[i].duration,
|
||||
rid: videos[i].rid,
|
||||
});
|
||||
}
|
||||
}
|
||||
courseHour
|
||||
.storeCourseHourMulti(id, hours)
|
||||
|
||||
@@ -80,7 +80,7 @@ export const CourseUpdate: React.FC<PropInterface> = ({
|
||||
let box = res.data.dep_ids;
|
||||
let depIds: any[] = [];
|
||||
let type = res.data.dep_ids.length > 0 ? "elective" : "open";
|
||||
if (box.length > 1) {
|
||||
if (box.length > 0) {
|
||||
for (let i = 0; i < box.length; i++) {
|
||||
let item = checkChild(deps, box[i]);
|
||||
let arr: any[] = [];
|
||||
|
||||
@@ -157,7 +157,6 @@ export const CoursePage = () => {
|
||||
{
|
||||
title: "必修/选修",
|
||||
dataIndex: "isRequired",
|
||||
width: 120,
|
||||
render: (isRequired: number) => (
|
||||
<span>{isRequired === 1 ? "必修课" : "选修课"}</span>
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user