From b0709630cd6d0ab2259ab06cf7b55fd84d242330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A6=BA=E7=8B=A8?= <18119604035@163.com> Date: Thu, 16 Mar 2023 09:59:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=96=B0=E5=BB=BA=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=88=87=E6=8D=A2=E8=AF=BE=E6=97=B6=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E7=A1=AE=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/course/compenents/create.tsx | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/pages/course/compenents/create.tsx b/src/pages/course/compenents/create.tsx index e85ce78..8fbe953 100644 --- a/src/pages/course/compenents/create.tsx +++ b/src/pages/course/compenents/create.tsx @@ -7,11 +7,15 @@ import { Form, Cascader, Input, + Modal, message, } from "antd"; import styles from "./create.module.less"; import { course, department } from "../../../api/index"; import { UploadImageButton } from "../../../compenents"; +import { ExclamationCircleFilled } from "@ant-design/icons"; + +const { confirm } = Modal; interface PropInterface { open: boolean; @@ -119,7 +123,22 @@ export const CourseCreate: React.FC = ({ open, onCancel }) => { }; const getChapterType = (e: any) => { - setChapterType(e.target.value); + confirm({ + title: "操作确认", + icon: , + content: "切换列表选项会清空已添加课时,确认切换?", + centered: true, + okText: "确认", + cancelText: "取消", + onOk() { + setChapterType(e.target.value); + }, + onCancel() { + form.setFieldsValue({ + hasChapter: chapterType, + }); + }, + }); }; return (