线上课编辑和课时管理初步

This commit is contained in:
禺狨
2023-03-21 18:01:23 +08:00
parent 9fc6e79b3d
commit faa03f19e0
12 changed files with 687 additions and 367 deletions

View File

@@ -168,26 +168,31 @@ export const CourseCreate: React.FC<PropInterface> = ({ open, onCancel }) => {
};
const getChapterType = (e: any) => {
confirm({
title: "操作确认",
icon: <ExclamationCircleFilled />,
content: "切换列表选项会清空已添加课时,确认切换?",
centered: true,
okText: "确认",
cancelText: "取消",
onOk() {
setChapterType(e.target.value);
setChapters([]);
setHours([]);
setChapterHours([]);
setTreeData([]);
},
onCancel() {
form.setFieldsValue({
hasChapter: chapterType,
});
},
});
const arr = [...chapters];
if (arr.length > 0) {
confirm({
title: "操作确认",
icon: <ExclamationCircleFilled />,
content: "切换列表选项会清空已添加课时,确认切换?",
centered: true,
okText: "确认",
cancelText: "取消",
onOk() {
setChapterType(e.target.value);
setChapters([]);
setHours([]);
setChapterHours([]);
setTreeData([]);
},
onCancel() {
form.setFieldsValue({
hasChapter: chapterType,
});
},
});
} else {
setChapterType(e.target.value);
}
};
const delHour = (id: number) => {
@@ -378,7 +383,9 @@ export const CourseCreate: React.FC<PropInterface> = ({ open, onCancel }) => {
rules={[{ required: true, message: "请选择课程类型!" }]}
>
<Radio.Group onChange={getType}>
<Radio value="open"></Radio>
<Radio value="open">
<i className="iconfont icon-icon-tips c-gray ml-8" />
</Radio>
<Radio value="elective"></Radio>
</Radio.Group>
</Form.Item>