diff --git a/src/compenents/create-rs-category/index.tsx b/src/compenents/create-rs-category/index.tsx index e1c8449..4a9eab5 100644 --- a/src/compenents/create-rs-category/index.tsx +++ b/src/compenents/create-rs-category/index.tsx @@ -40,23 +40,25 @@ export const CreateResourceCategory = (props: PropInterface) => { shape="circle" icon={} /> - { - setShowModal(false); - }} - onOk={confirm} - open={showModal} - title="创建分类" - > - { - setName(e.target.value); + {showModal ? ( + { + setShowModal(false); }} - allowClear - /> - + onOk={confirm} + open={true} + title="创建分类" + > + { + setName(e.target.value); + }} + allowClear + /> + + ) : null} ); }; diff --git a/src/compenents/select-attachment/index.tsx b/src/compenents/select-attachment/index.tsx index 8739670..774b47b 100644 --- a/src/compenents/select-attachment/index.tsx +++ b/src/compenents/select-attachment/index.tsx @@ -47,28 +47,30 @@ export const SelectAttachment = (props: PropsInterface) => { return ( <> - { - setSelectKeys([]); - setSelectVideos([]); - props.onCancel(); - }} - open={props.open} - width={800} - maskClosable={false} - onOk={() => { - props.onSelected(selectKeys, selectVideos); - setSelectKeys([]); - setSelectVideos([]); - }} - > - - - - + {props.open ? ( + { + setSelectKeys([]); + setSelectVideos([]); + props.onCancel(); + }} + open={true} + width={800} + maskClosable={false} + onOk={() => { + props.onSelected(selectKeys, selectVideos); + setSelectKeys([]); + setSelectVideos([]); + }} + > + + + + + ) : null} ); }; diff --git a/src/compenents/select-resource/index.tsx b/src/compenents/select-resource/index.tsx index 017cf30..b30c29e 100644 --- a/src/compenents/select-resource/index.tsx +++ b/src/compenents/select-resource/index.tsx @@ -47,28 +47,30 @@ export const SelectResource = (props: PropsInterface) => { return ( <> - { - setSelectKeys([]); - setSelectVideos([]); - props.onCancel(); - }} - open={props.open} - width={800} - maskClosable={false} - onOk={() => { - props.onSelected(selectKeys, selectVideos); - setSelectKeys([]); - setSelectVideos([]); - }} - > - - - - + {props.open ? ( + { + setSelectKeys([]); + setSelectVideos([]); + props.onCancel(); + }} + open={true} + width={800} + maskClosable={false} + onOk={() => { + props.onSelected(selectKeys, selectVideos); + setSelectKeys([]); + setSelectVideos([]); + }} + > + + + + + ) : null} ); }; diff --git a/src/pages/course/compenents/create.tsx b/src/pages/course/compenents/create.tsx index cba360e..ac9e37c 100644 --- a/src/pages/course/compenents/create.tsx +++ b/src/pages/course/compenents/create.tsx @@ -464,386 +464,388 @@ export const CourseCreate: React.FC = ({ return ( <> - - - - - } - width={634} - > -
- { - setVideoVisible(false); - }} - onSelected={(arr: any, videos: any) => { - if (chapterType === 0) { - selectData(arr, videos); - } else { - selectChapterData(arr, videos); + {open ? ( + + + + + } + width={634} + > +
+ - { - setAttachmentVisible(false); - }} - onSelected={(arr: any, videos: any) => { - selectAttachmentData(arr, videos); - }} - > -
- { + setVideoVisible(false); + }} + onSelected={(arr: any, videos: any) => { + if (chapterType === 0) { + selectData(arr, videos); + } else { + selectChapterData(arr, videos); + } + }} + /> + { + setAttachmentVisible(false); + }} + onSelected={(arr: any, videos: any) => { + selectAttachmentData(arr, videos); + }} + > + - - - - - - - - 必修课 - - 选修课 - - - - - - 全部部门 - 选择部门 - - - - {type === "elective" && ( - )} - - -
- + -
-
-
{ - setThumb(defaultThumb1); - form.setFieldsValue({ - thumb: defaultThumb1, - }); - }} - > - + + + + 必修课 + + 选修课 + + + + + + 全部部门 + 选择部门 + + + + {type === "elective" && ( + + + + )} + + +
+ +
+
+
{ + setThumb(defaultThumb1); + form.setFieldsValue({ + thumb: defaultThumb1, + }); + }} + > + +
+
{ + setThumb(defaultThumb2); + form.setFieldsValue({ + thumb: defaultThumb2, + }); + }} + > + +
+
{ + setThumb(defaultThumb3); + form.setFieldsValue({ + thumb: defaultThumb3, + }); + }} + > + +
-
{ - setThumb(defaultThumb2); - form.setFieldsValue({ - thumb: defaultThumb2, - }); - }} - > - +
+ { + setThumb(url); + form.setFieldsValue({ thumb: url }); + }} + > + + (推荐尺寸:400x300px) +
-
{ - setThumb(defaultThumb3); - form.setFieldsValue({ - thumb: defaultThumb3, - }); - }} - > - -
-
-
- { - setThumb(url); - form.setFieldsValue({ thumb: url }); - }} - > - - (推荐尺寸:400x300px) -
-
-
- - - 无章节 - - 有章节 - - - - {chapterType === 0 && ( -
- -
- + + + + 无章节 + + 有章节 + + + + {chapterType === 0 && ( +
+ +
+ +
+
+
+ {treeData.length === 0 && ( + + 请点击上方按钮添加课时 + + )} + {treeData.length > 0 && ( + { + delHour(id); + }} + onUpdate={(arr: any[]) => { + transHour(arr); + }} + /> + )}
+
+ )} + {chapterType === 1 && ( +
+ {chapters.length > 0 && + chapters.map((item: any, index: number) => { + return ( +
+
+
+ 章节{index + 1}: +
+ { + setChapterName(index, e.target.value); + }} + allowClear + placeholder="请在此处输入章节名称" + /> + + +
+
+ {item.hours.length === 0 && ( + + 请点击上方按钮添加课时 + + )} + {item.hours.length > 0 && ( + { + delChapterHour(index, id); + }} + onUpdate={(arr: any[]) => { + transChapterHour(index, arr); + }} + /> + )} +
+
+ ); + })} + +
+ +
+
+
+ )} + +
setShowDrop(!showDrop)} + > + + (课程简介、课件) +
+
+
+ + + + +
- {treeData.length === 0 && ( + {attachmentData.length === 0 && ( - 请点击上方按钮添加课时 + 请点击上方按钮添加课件 )} - {treeData.length > 0 && ( - 0 && ( + { - delHour(id); + delAttachments(id); }} onUpdate={(arr: any[]) => { - transHour(arr); + transAttachments(arr); }} /> )}
- )} - {chapterType === 1 && ( -
- {chapters.length > 0 && - chapters.map((item: any, index: number) => { - return ( -
-
-
- 章节{index + 1}: -
- { - setChapterName(index, e.target.value); - }} - allowClear - placeholder="请在此处输入章节名称" - /> - - -
-
- {item.hours.length === 0 && ( - - 请点击上方按钮添加课时 - - )} - {item.hours.length > 0 && ( - { - delChapterHour(index, id); - }} - onUpdate={(arr: any[]) => { - transChapterHour(index, arr); - }} - /> - )} -
-
- ); - })} - -
- -
-
-
- )} - -
setShowDrop(!showDrop)} - > - - (课程简介、课件) -
-
-
- - - - - - -
- {attachmentData.length === 0 && ( - - 请点击上方按钮添加课件 - - )} - {attachmentData.length > 0 && ( - { - delAttachments(id); - }} - onUpdate={(arr: any[]) => { - transAttachments(arr); - }} - /> - )} -
-
- -
- + +
+ + ) : null} ); }; diff --git a/src/pages/course/compenents/hour-update.tsx b/src/pages/course/compenents/hour-update.tsx index 5a077d8..26761d3 100644 --- a/src/pages/course/compenents/hour-update.tsx +++ b/src/pages/course/compenents/hour-update.tsx @@ -363,146 +363,148 @@ export const CourseHourUpdate: React.FC = ({ return ( <> - -
-

1.线上课课时调整及时生效,操作不可逆,请谨慎操作。

-

2.课时调整后,已有学习进度会在学员学习时重新计算。

-
-
- { - setVideoVisible(false); - }} - onSelected={(arr: any, videos: any) => { - if (chapterType === 0) { - selectData(arr, videos); - } else { - selectChapterData(arr, videos); + {open ? ( + +
+

1.线上课课时调整及时生效,操作不可逆,请谨慎操作。

+

2.课时调整后,已有学习进度会在学员学习时重新计算。

+
+
+ -
- {chapterType === 0 && ( -
- -
- -
-
-
- {treeData.length === 0 && ( - - 请点击上方按钮添加课时 - - )} - {treeData.length > 0 && ( - { - delHour(id); - }} - onUpdate={(arr: any[]) => { - transHour(arr); - }} - /> - )} -
-
- )} - {chapterType === 1 && ( -
- {chapters.length > 0 && - chapters.map((item: any, index: number) => { - return ( -
{ + setVideoVisible(false); + }} + onSelected={(arr: any, videos: any) => { + if (chapterType === 0) { + selectData(arr, videos); + } else { + selectChapterData(arr, videos); + } + }} + /> + + {chapterType === 0 && ( +
+ +
+ - -
-
- {item.hours.length === 0 && ( - - 请点击上方按钮添加课时 - - )} - {item.hours.length > 0 && ( - { - delChapterHour(index, id); - }} - onUpdate={(arr: any[]) => { - transChapterHour(index, arr); - }} - /> - )} -
-
- ); - })} - -
- + 添加课时 + +
+
+
+ {treeData.length === 0 && ( + + 请点击上方按钮添加课时 + + )} + {treeData.length > 0 && ( + { + delHour(id); + }} + onUpdate={(arr: any[]) => { + transHour(arr); + }} + /> + )}
- -
- )} - -
- +
+ )} + {chapterType === 1 && ( +
+ {chapters.length > 0 && + chapters.map((item: any, index: number) => { + return ( +
+
+
+ 章节{index + 1}: +
+ { + setChapterName(index, e.target.value); + }} + onBlur={(e) => { + saveChapterName(index, e.target.value); + }} + placeholder="请在此处输入章节名称" + allowClear + /> + + +
+
+ {item.hours.length === 0 && ( + + 请点击上方按钮添加课时 + + )} + {item.hours.length > 0 && ( + { + delChapterHour(index, id); + }} + onUpdate={(arr: any[]) => { + transChapterHour(index, arr); + }} + /> + )} +
+
+ ); + })} + +
+ +
+
+
+ )} + +
+
+ ) : null} ); }; diff --git a/src/pages/course/compenents/update.tsx b/src/pages/course/compenents/update.tsx index c36b3ae..e892e6d 100644 --- a/src/pages/course/compenents/update.tsx +++ b/src/pages/course/compenents/update.tsx @@ -169,209 +169,211 @@ export const CourseUpdate: React.FC = ({ return ( <> - - - - - } - width={634} - > -
-
- + + + + } + width={634} + > +
+ - - - - - - - - 必修课 - - 选修课 - - - - - - 全部部门 - 选择部门 - - - - {type === "elective" && ( - )} - - -
- + -
-
-
{ - setThumb(defaultThumb1); - form.setFieldsValue({ - thumb: defaultThumb1, - }); - }} - > - + + + + 必修课 + + 选修课 + + + + + + 全部部门 + 选择部门 + + + + {type === "elective" && ( + + + + )} + + +
+ +
+
+
{ + setThumb(defaultThumb1); + form.setFieldsValue({ + thumb: defaultThumb1, + }); + }} + > + +
+
{ + setThumb(defaultThumb2); + form.setFieldsValue({ + thumb: defaultThumb2, + }); + }} + > + +
+
{ + setThumb(defaultThumb3); + form.setFieldsValue({ + thumb: defaultThumb3, + }); + }} + > + +
-
{ - setThumb(defaultThumb2); - form.setFieldsValue({ - thumb: defaultThumb2, - }); - }} - > - +
+ { + setThumb(url); + form.setFieldsValue({ thumb: url }); + }} + > + + (推荐尺寸:400x300px) +
-
{ - setThumb(defaultThumb3); - form.setFieldsValue({ - thumb: defaultThumb3, - }); - }} - > - -
-
-
- { - setThumb(url); - form.setFieldsValue({ thumb: url }); - }} - > - - (推荐尺寸:400x300px) -
-
-
- - - - -
- + + + + + +
+ + ) : null} ); }; diff --git a/src/pages/department/compenents/create.tsx b/src/pages/department/compenents/create.tsx index cf11d83..ca8ca80 100644 --- a/src/pages/department/compenents/create.tsx +++ b/src/pages/department/compenents/create.tsx @@ -105,57 +105,59 @@ export const DepartmentCreate: React.FC = ({ return ( <> - form.submit()} - onCancel={() => onCancel()} - maskClosable={false} - > -
-
- form.submit()} + onCancel={() => onCancel()} + maskClosable={false} + > +
+ - - - - - - -
- + + + + + + + +
+
+ ) : null} ); }; diff --git a/src/pages/department/compenents/update.tsx b/src/pages/department/compenents/update.tsx index 8125bf3..edc94c5 100644 --- a/src/pages/department/compenents/update.tsx +++ b/src/pages/department/compenents/update.tsx @@ -129,53 +129,55 @@ export const DepartmentUpdate: React.FC = ({ return ( <> - form.submit()} - onCancel={() => onCancel()} - maskClosable={false} - > -
-
- form.submit()} + onCancel={() => onCancel()} + maskClosable={false} + > +
+ - - - - - - -
- + + + + + + + +
+
+ ) : null} ); }; diff --git a/src/pages/member/compenents/create.tsx b/src/pages/member/compenents/create.tsx index 6eff2bf..f5deb66 100644 --- a/src/pages/member/compenents/create.tsx +++ b/src/pages/member/compenents/create.tsx @@ -105,102 +105,104 @@ export const MemberCreate: React.FC = ({ return ( <> - form.submit()} - onCancel={() => onCancel()} - maskClosable={false} - > -
-
- form.submit()} + onCancel={() => onCancel()} + maskClosable={false} + > +
+ -
- {avatar && ( - - )} +
- { - setAvatar(url); - form.setFieldsValue({ avatar: url }); - }} - > + {avatar && ( + + )} +
+ { + setAvatar(url); + form.setFieldsValue({ avatar: url }); + }} + > +
-
- - - - - - - - - - - - - - - - - -
- +
+ + + + + + + + + + + + + + + + +
+
+ ) : null} ); }; diff --git a/src/pages/member/compenents/progress.tsx b/src/pages/member/compenents/progress.tsx index 82fb20a..1589487 100644 --- a/src/pages/member/compenents/progress.tsx +++ b/src/pages/member/compenents/progress.tsx @@ -210,43 +210,45 @@ export const MemberLearnProgressDialog: React.FC = ({ return ( <> - onCancel()} - onCancel={() => onCancel()} - maskClosable={false} - footer={null} - > -
- { - clearProgress(); - }} - disabled={null} - /> -
-
onCancel()} + onCancel={() => onCancel()} + maskClosable={false} + footer={null} > - record.id} - pagination={false} - /> - - +
+ { + clearProgress(); + }} + disabled={null} + /> +
+
+
record.id} + pagination={false} + /> + + + ) : null} ); }; diff --git a/src/pages/member/compenents/update.tsx b/src/pages/member/compenents/update.tsx index 4ee2bf2..2fdcfd7 100644 --- a/src/pages/member/compenents/update.tsx +++ b/src/pages/member/compenents/update.tsx @@ -134,102 +134,104 @@ export const MemberUpdate: React.FC = ({ return ( <> - form.submit()} - onCancel={() => onCancel()} - maskClosable={false} - > -
-
- form.submit()} + onCancel={() => onCancel()} + maskClosable={false} + > +
+ -
- {avatar && ( - - )} +
- { - setAvatar(url); - form.setFieldsValue({ avatar: url }); - }} - > + {avatar && ( + + )} +
+ { + setAvatar(url); + form.setFieldsValue({ avatar: url }); + }} + > +
-
- - - - - - - - - - - - - - - - - -
- +
+ + + + + + + + + + + + + + + + +
+
+ ) : null} ); }; diff --git a/src/pages/resource/courseware/compenents/update-dialog/index.tsx b/src/pages/resource/courseware/compenents/update-dialog/index.tsx index 32f88da..417a017 100644 --- a/src/pages/resource/courseware/compenents/update-dialog/index.tsx +++ b/src/pages/resource/courseware/compenents/update-dialog/index.tsx @@ -96,55 +96,57 @@ export const CoursewareUpdateDialog: React.FC = ({ return ( <> - form.submit()} - onCancel={() => onCancel()} - maskClosable={false} - > -
-
- form.submit()} + onCancel={() => onCancel()} + maskClosable={false} + > +
+ - - - - - - -
- + + + + + + + +
+
+ ) : null} ); }; diff --git a/src/pages/resource/resource-category/compenents/create.tsx b/src/pages/resource/resource-category/compenents/create.tsx index 09d4979..f22632f 100644 --- a/src/pages/resource/resource-category/compenents/create.tsx +++ b/src/pages/resource/resource-category/compenents/create.tsx @@ -105,57 +105,59 @@ export const ResourceCategoryCreate: React.FC = ({ return ( <> - form.submit()} - onCancel={() => onCancel()} - > -
-
- form.submit()} + onCancel={() => onCancel()} + > +
+ - - - - - - -
- + + + + + + + +
+
+ ) : null} ); }; diff --git a/src/pages/resource/resource-category/compenents/update.tsx b/src/pages/resource/resource-category/compenents/update.tsx index aa5d7e7..d1aafde 100644 --- a/src/pages/resource/resource-category/compenents/update.tsx +++ b/src/pages/resource/resource-category/compenents/update.tsx @@ -127,57 +127,59 @@ export const ResourceCategoryUpdate: React.FC = ({ return ( <> - form.submit()} - onCancel={() => onCancel()} - maskClosable={false} - > -
-
- form.submit()} + onCancel={() => onCancel()} + maskClosable={false} + > +
+ - - - - - - -
- + + + + + + + +
+
+ ) : null} ); }; diff --git a/src/pages/resource/videos/compenents/update-dialog/index.tsx b/src/pages/resource/videos/compenents/update-dialog/index.tsx index becc4d2..e084a2d 100644 --- a/src/pages/resource/videos/compenents/update-dialog/index.tsx +++ b/src/pages/resource/videos/compenents/update-dialog/index.tsx @@ -89,55 +89,57 @@ export const VideosUpdateDialog: React.FC = ({ return ( <> - form.submit()} - onCancel={() => onCancel()} - maskClosable={false} - > -
-
- form.submit()} + onCancel={() => onCancel()} + maskClosable={false} + > +
+ - - - - - - -
- + + + + + + + +
+
+ ) : null} ); }; diff --git a/src/pages/system/administrator/compenents/create.tsx b/src/pages/system/administrator/compenents/create.tsx index 544c7b0..392c4a8 100644 --- a/src/pages/system/administrator/compenents/create.tsx +++ b/src/pages/system/administrator/compenents/create.tsx @@ -85,86 +85,88 @@ export const SystemAdministratorCreate: React.FC = ({ return ( <> - form.submit()} - onCancel={() => onCancel()} - maskClosable={false} - > -
-
- form.submit()} + onCancel={() => onCancel()} + maskClosable={false} + > +
+ - - - - - - - - + + + + + + + + + - - - - -
- + + + + +
+
+ ) : null} ); }; diff --git a/src/pages/system/administrator/compenents/update.tsx b/src/pages/system/administrator/compenents/update.tsx index 67957fb..93a5c18 100644 --- a/src/pages/system/administrator/compenents/update.tsx +++ b/src/pages/system/administrator/compenents/update.tsx @@ -93,81 +93,83 @@ export const SystemAdministratorUpdate: React.FC = ({ return ( <> - form.submit()} - onCancel={() => onCancel()} - maskClosable={false} - > -
-
- form.submit()} + onCancel={() => onCancel()} + maskClosable={false} + > +
+ - - - - - - - - - - - - -
- + + + + + + + + + + + + + +
+
+ ) : null} ); }; diff --git a/src/pages/system/adminlog/compenents/detail-dialog.tsx b/src/pages/system/adminlog/compenents/detail-dialog.tsx index 1c62d52..2070095 100644 --- a/src/pages/system/adminlog/compenents/detail-dialog.tsx +++ b/src/pages/system/adminlog/compenents/detail-dialog.tsx @@ -25,33 +25,35 @@ export const AdminLogDetailDialog: React.FC = ({ return ( <> - onCancel()} - onCancel={() => onCancel()} - footer={null} - maskClosable={false} - > -
-
- {param} - {result} - -
-
+ {open ? ( + onCancel()} + onCancel={() => onCancel()} + footer={null} + maskClosable={false} + > +
+
+ {param} + {result} + +
+
+ ) : null} ); }; diff --git a/src/pages/system/adminroles/compenents/create.tsx b/src/pages/system/adminroles/compenents/create.tsx index cf5d0ba..383a5a3 100644 --- a/src/pages/system/adminroles/compenents/create.tsx +++ b/src/pages/system/adminroles/compenents/create.tsx @@ -151,68 +151,70 @@ export const SystemAdminrolesCreate: React.FC = ({ return ( <> - - - - - } - width={634} - > -
-
- + + + + } + width={634} + > +
+ - - - - - - - - - -
- + + + + + + + + + + +
+
+ ) : null} ); }; diff --git a/src/pages/system/adminroles/compenents/update.tsx b/src/pages/system/adminroles/compenents/update.tsx index d2b2639..e6868b6 100644 --- a/src/pages/system/adminroles/compenents/update.tsx +++ b/src/pages/system/adminroles/compenents/update.tsx @@ -165,68 +165,70 @@ export const SystemAdminrolesUpdate: React.FC = ({ return ( <> - - - - - } - width={634} - > -
-
- + + + + } + width={634} + > +
+ - - - - - - - - - -
- + + + + + + + + + + +
+
+ ) : null} ); };