mirror of
https://github.com/PlayEdu/backend
synced 2025-06-21 19:04:18 +08:00
线上课课时添加bug修复
This commit is contained in:
parent
76a88e4e5e
commit
4606a8f896
@ -62,7 +62,11 @@ export const SelectResource = (props: PropsInterface) => {
|
||||
open={props.open}
|
||||
width={800}
|
||||
maskClosable={false}
|
||||
onOk={() => props.onSelected(selectKeys, selectVideos)}
|
||||
onOk={() => {
|
||||
props.onSelected(selectKeys, selectVideos);
|
||||
setSelectKeys([]);
|
||||
setSelectVideos([]);
|
||||
}}
|
||||
>
|
||||
<Row>
|
||||
<Tabs defaultActiveKey="1" items={items} onChange={onChange} />
|
||||
|
@ -218,7 +218,7 @@ export const UploadVideoSub = (props: PropsInterface) => {
|
||||
paddingLeft: 10,
|
||||
}}
|
||||
>
|
||||
{videoList.length > 0 && (
|
||||
{videoList.length > 0 && total > 10 && (
|
||||
<Col
|
||||
span={24}
|
||||
style={{ display: "flex", flexDirection: "row-reverse" }}
|
||||
|
@ -241,17 +241,11 @@ export const CourseCreate: React.FC<PropInterface> = ({
|
||||
};
|
||||
|
||||
const selectData = (arr: any, videos: any) => {
|
||||
let keys = [...hours];
|
||||
let init = false;
|
||||
keys.map((item: any) => {
|
||||
if (arr.indexOf(item) !== -1) {
|
||||
init = true;
|
||||
}
|
||||
});
|
||||
if (init) {
|
||||
if (arr.length === 0) {
|
||||
message.error("请选择视频");
|
||||
return;
|
||||
}
|
||||
let keys = [...hours];
|
||||
let data = [...treeData];
|
||||
keys = keys.concat(arr);
|
||||
data = data.concat(videos);
|
||||
@ -261,18 +255,12 @@ export const CourseCreate: React.FC<PropInterface> = ({
|
||||
};
|
||||
|
||||
const selectChapterData = (arr: any, videos: any) => {
|
||||
const data = [...chapters];
|
||||
const keys = [...chapterHours];
|
||||
let init = false;
|
||||
keys[addvideoCurrent].map((item: any) => {
|
||||
if (arr.indexOf(item) !== -1) {
|
||||
init = true;
|
||||
}
|
||||
});
|
||||
if (init) {
|
||||
if (arr.length === 0) {
|
||||
message.error("请选择视频");
|
||||
return;
|
||||
}
|
||||
const data = [...chapters];
|
||||
const keys = [...chapterHours];
|
||||
keys[addvideoCurrent] = keys[addvideoCurrent].concat(arr);
|
||||
data[addvideoCurrent].hours = data[addvideoCurrent].hours.concat(videos);
|
||||
setChapters(data);
|
||||
|
@ -117,6 +117,10 @@ export const CourseHourUpdate: React.FC<PropInterface> = ({
|
||||
});
|
||||
}
|
||||
}
|
||||
if (hours.length === 0) {
|
||||
message.error("请选择视频");
|
||||
return;
|
||||
}
|
||||
courseHour
|
||||
.storeCourseHourMulti(id, hours)
|
||||
.then((res: any) => {
|
||||
@ -148,6 +152,10 @@ export const CourseHourUpdate: React.FC<PropInterface> = ({
|
||||
});
|
||||
}
|
||||
}
|
||||
if (hours.length === 0) {
|
||||
message.error("请选择视频");
|
||||
return;
|
||||
}
|
||||
courseHour
|
||||
.storeCourseHourMulti(id, hours)
|
||||
.then((res: any) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user