mirror of
https://github.com/PlayEdu/backend
synced 2025-06-08 06:37:49 +08:00
线上课课时添加bug修复
This commit is contained in:
parent
535dfb8204
commit
76a88e4e5e
@ -242,6 +242,16 @@ 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) {
|
||||
message.error("请选择视频");
|
||||
return;
|
||||
}
|
||||
let data = [...treeData];
|
||||
keys = keys.concat(arr);
|
||||
data = data.concat(videos);
|
||||
@ -253,6 +263,16 @@ 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) {
|
||||
message.error("请选择视频");
|
||||
return;
|
||||
}
|
||||
keys[addvideoCurrent] = keys[addvideoCurrent].concat(arr);
|
||||
data[addvideoCurrent].hours = data[addvideoCurrent].hours.concat(videos);
|
||||
setChapters(data);
|
||||
|
Loading…
x
Reference in New Issue
Block a user