mirror of
https://github.com/PlayEdu/backend
synced 2025-06-28 10:44:19 +08:00
弹窗组件open外置并使用三元运算
This commit is contained in:
parent
354bd23fc9
commit
eb1e82fc12
@ -40,12 +40,13 @@ export const CreateResourceCategory = (props: PropInterface) => {
|
||||
shape="circle"
|
||||
icon={<PlusOutlined />}
|
||||
/>
|
||||
{showModal ? (
|
||||
<Modal
|
||||
onCancel={() => {
|
||||
setShowModal(false);
|
||||
}}
|
||||
onOk={confirm}
|
||||
open={showModal}
|
||||
open={true}
|
||||
title="创建分类"
|
||||
>
|
||||
<Input
|
||||
@ -57,6 +58,7 @@ export const CreateResourceCategory = (props: PropInterface) => {
|
||||
allowClear
|
||||
/>
|
||||
</Modal>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
@ -47,6 +47,7 @@ export const SelectAttachment = (props: PropsInterface) => {
|
||||
|
||||
return (
|
||||
<>
|
||||
{props.open ? (
|
||||
<Modal
|
||||
title="资源素材库"
|
||||
centered
|
||||
@ -56,7 +57,7 @@ export const SelectAttachment = (props: PropsInterface) => {
|
||||
setSelectVideos([]);
|
||||
props.onCancel();
|
||||
}}
|
||||
open={props.open}
|
||||
open={true}
|
||||
width={800}
|
||||
maskClosable={false}
|
||||
onOk={() => {
|
||||
@ -69,6 +70,7 @@ export const SelectAttachment = (props: PropsInterface) => {
|
||||
<Tabs defaultActiveKey="1" items={items} onChange={onChange} />
|
||||
</Row>
|
||||
</Modal>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
@ -47,6 +47,7 @@ export const SelectResource = (props: PropsInterface) => {
|
||||
|
||||
return (
|
||||
<>
|
||||
{props.open ? (
|
||||
<Modal
|
||||
title="资源素材库"
|
||||
centered
|
||||
@ -56,7 +57,7 @@ export const SelectResource = (props: PropsInterface) => {
|
||||
setSelectVideos([]);
|
||||
props.onCancel();
|
||||
}}
|
||||
open={props.open}
|
||||
open={true}
|
||||
width={800}
|
||||
maskClosable={false}
|
||||
onOk={() => {
|
||||
@ -69,6 +70,7 @@ export const SelectResource = (props: PropsInterface) => {
|
||||
<Tabs defaultActiveKey="1" items={items} onChange={onChange} />
|
||||
</Row>
|
||||
</Modal>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
@ -464,11 +464,12 @@ export const CourseCreate: React.FC<PropInterface> = ({
|
||||
|
||||
return (
|
||||
<>
|
||||
{open ? (
|
||||
<Drawer
|
||||
title="新建课程"
|
||||
onClose={onCancel}
|
||||
maskClosable={false}
|
||||
open={open}
|
||||
open={true}
|
||||
footer={
|
||||
<Space className="j-r-flex">
|
||||
<Button onClick={() => onCancel()}>取 消</Button>
|
||||
@ -844,6 +845,7 @@ export const CourseCreate: React.FC<PropInterface> = ({
|
||||
</Form>
|
||||
</div>
|
||||
</Drawer>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
@ -363,11 +363,12 @@ export const CourseHourUpdate: React.FC<PropInterface> = ({
|
||||
|
||||
return (
|
||||
<>
|
||||
{open ? (
|
||||
<Drawer
|
||||
title="课时管理"
|
||||
onClose={onCancel}
|
||||
maskClosable={false}
|
||||
open={open}
|
||||
open={true}
|
||||
width={634}
|
||||
>
|
||||
<div className={styles["top-content"]}>
|
||||
@ -503,6 +504,7 @@ export const CourseHourUpdate: React.FC<PropInterface> = ({
|
||||
</Form>
|
||||
</div>
|
||||
</Drawer>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
@ -169,11 +169,12 @@ export const CourseUpdate: React.FC<PropInterface> = ({
|
||||
|
||||
return (
|
||||
<>
|
||||
{open ? (
|
||||
<Drawer
|
||||
title="编辑课程"
|
||||
onClose={onCancel}
|
||||
maskClosable={false}
|
||||
open={open}
|
||||
open={true}
|
||||
footer={
|
||||
<Space className="j-r-flex">
|
||||
<Button onClick={() => onCancel()}>取 消</Button>
|
||||
@ -372,6 +373,7 @@ export const CourseUpdate: React.FC<PropInterface> = ({
|
||||
</Form>
|
||||
</div>
|
||||
</Drawer>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
@ -105,11 +105,12 @@ export const DepartmentCreate: React.FC<PropInterface> = ({
|
||||
|
||||
return (
|
||||
<>
|
||||
{open ? (
|
||||
<Modal
|
||||
title="新建部门"
|
||||
centered
|
||||
forceRender
|
||||
open={open}
|
||||
open={true}
|
||||
width={416}
|
||||
onOk={() => form.submit()}
|
||||
onCancel={() => onCancel()}
|
||||
@ -156,6 +157,7 @@ export const DepartmentCreate: React.FC<PropInterface> = ({
|
||||
</Form>
|
||||
</div>
|
||||
</Modal>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
@ -129,11 +129,12 @@ export const DepartmentUpdate: React.FC<PropInterface> = ({
|
||||
|
||||
return (
|
||||
<>
|
||||
{open ? (
|
||||
<Modal
|
||||
title="编辑部门"
|
||||
centered
|
||||
forceRender
|
||||
open={open}
|
||||
open={true}
|
||||
width={416}
|
||||
onOk={() => form.submit()}
|
||||
onCancel={() => onCancel()}
|
||||
@ -176,6 +177,7 @@ export const DepartmentUpdate: React.FC<PropInterface> = ({
|
||||
</Form>
|
||||
</div>
|
||||
</Modal>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
@ -105,11 +105,12 @@ export const MemberCreate: React.FC<PropInterface> = ({
|
||||
|
||||
return (
|
||||
<>
|
||||
{open ? (
|
||||
<Modal
|
||||
title="添加学员"
|
||||
centered
|
||||
forceRender
|
||||
open={open}
|
||||
open={true}
|
||||
width={484}
|
||||
onOk={() => form.submit()}
|
||||
onCancel={() => onCancel()}
|
||||
@ -201,6 +202,7 @@ export const MemberCreate: React.FC<PropInterface> = ({
|
||||
</Form>
|
||||
</div>
|
||||
</Modal>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
@ -210,11 +210,12 @@ export const MemberLearnProgressDialog: React.FC<PropInterface> = ({
|
||||
|
||||
return (
|
||||
<>
|
||||
{open ? (
|
||||
<Modal
|
||||
title="课时学习进度"
|
||||
centered
|
||||
forceRender
|
||||
open={open}
|
||||
open={true}
|
||||
width={1000}
|
||||
onOk={() => onCancel()}
|
||||
onCancel={() => onCancel()}
|
||||
@ -247,6 +248,7 @@ export const MemberLearnProgressDialog: React.FC<PropInterface> = ({
|
||||
/>
|
||||
</div>
|
||||
</Modal>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
@ -134,11 +134,12 @@ export const MemberUpdate: React.FC<PropInterface> = ({
|
||||
|
||||
return (
|
||||
<>
|
||||
{open ? (
|
||||
<Modal
|
||||
title="编辑学员"
|
||||
centered
|
||||
forceRender
|
||||
open={open}
|
||||
open={true}
|
||||
width={484}
|
||||
onOk={() => form.submit()}
|
||||
onCancel={() => onCancel()}
|
||||
@ -230,6 +231,7 @@ export const MemberUpdate: React.FC<PropInterface> = ({
|
||||
</Form>
|
||||
</div>
|
||||
</Modal>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
@ -96,11 +96,12 @@ export const CoursewareUpdateDialog: React.FC<PropInterface> = ({
|
||||
|
||||
return (
|
||||
<>
|
||||
{open ? (
|
||||
<Modal
|
||||
title="编辑课件"
|
||||
centered
|
||||
forceRender
|
||||
open={open}
|
||||
open={true}
|
||||
width={416}
|
||||
onOk={() => form.submit()}
|
||||
onCancel={() => onCancel()}
|
||||
@ -145,6 +146,7 @@ export const CoursewareUpdateDialog: React.FC<PropInterface> = ({
|
||||
</Form>
|
||||
</div>
|
||||
</Modal>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
@ -105,12 +105,13 @@ export const ResourceCategoryCreate: React.FC<PropInterface> = ({
|
||||
|
||||
return (
|
||||
<>
|
||||
{open ? (
|
||||
<Modal
|
||||
title="新建分类"
|
||||
centered
|
||||
forceRender
|
||||
maskClosable={false}
|
||||
open={open}
|
||||
open={true}
|
||||
width={416}
|
||||
onOk={() => form.submit()}
|
||||
onCancel={() => onCancel()}
|
||||
@ -156,6 +157,7 @@ export const ResourceCategoryCreate: React.FC<PropInterface> = ({
|
||||
</Form>
|
||||
</div>
|
||||
</Modal>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
@ -127,11 +127,12 @@ export const ResourceCategoryUpdate: React.FC<PropInterface> = ({
|
||||
|
||||
return (
|
||||
<>
|
||||
{open ? (
|
||||
<Modal
|
||||
title="编辑分类"
|
||||
centered
|
||||
forceRender
|
||||
open={open}
|
||||
open={true}
|
||||
width={416}
|
||||
onOk={() => form.submit()}
|
||||
onCancel={() => onCancel()}
|
||||
@ -178,6 +179,7 @@ export const ResourceCategoryUpdate: React.FC<PropInterface> = ({
|
||||
</Form>
|
||||
</div>
|
||||
</Modal>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
@ -89,11 +89,12 @@ export const VideosUpdateDialog: React.FC<PropInterface> = ({
|
||||
|
||||
return (
|
||||
<>
|
||||
{open ? (
|
||||
<Modal
|
||||
title="编辑视频"
|
||||
centered
|
||||
forceRender
|
||||
open={open}
|
||||
open={true}
|
||||
width={416}
|
||||
onOk={() => form.submit()}
|
||||
onCancel={() => onCancel()}
|
||||
@ -138,6 +139,7 @@ export const VideosUpdateDialog: React.FC<PropInterface> = ({
|
||||
</Form>
|
||||
</div>
|
||||
</Modal>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
@ -85,11 +85,12 @@ export const SystemAdministratorCreate: React.FC<PropInterface> = ({
|
||||
|
||||
return (
|
||||
<>
|
||||
{open ? (
|
||||
<Modal
|
||||
title="添加管理员"
|
||||
centered
|
||||
forceRender
|
||||
open={open}
|
||||
open={true}
|
||||
width={416}
|
||||
onOk={() => form.submit()}
|
||||
onCancel={() => onCancel()}
|
||||
@ -165,6 +166,7 @@ export const SystemAdministratorCreate: React.FC<PropInterface> = ({
|
||||
</Form>
|
||||
</div>
|
||||
</Modal>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
@ -93,11 +93,12 @@ export const SystemAdministratorUpdate: React.FC<PropInterface> = ({
|
||||
|
||||
return (
|
||||
<>
|
||||
{open ? (
|
||||
<Modal
|
||||
title="编辑管理人员"
|
||||
centered
|
||||
forceRender
|
||||
open={open}
|
||||
open={true}
|
||||
width={416}
|
||||
onOk={() => form.submit()}
|
||||
onCancel={() => onCancel()}
|
||||
@ -168,6 +169,7 @@ export const SystemAdministratorUpdate: React.FC<PropInterface> = ({
|
||||
</Form>
|
||||
</div>
|
||||
</Modal>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
@ -25,11 +25,12 @@ export const AdminLogDetailDialog: React.FC<PropInterface> = ({
|
||||
|
||||
return (
|
||||
<>
|
||||
{open ? (
|
||||
<Modal
|
||||
title="日志详情"
|
||||
centered
|
||||
forceRender
|
||||
open={open}
|
||||
open={true}
|
||||
width={416}
|
||||
onOk={() => onCancel()}
|
||||
onCancel={() => onCancel()}
|
||||
@ -52,6 +53,7 @@ export const AdminLogDetailDialog: React.FC<PropInterface> = ({
|
||||
</Form>
|
||||
</div>
|
||||
</Modal>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
@ -151,11 +151,12 @@ export const SystemAdminrolesCreate: React.FC<PropInterface> = ({
|
||||
|
||||
return (
|
||||
<>
|
||||
{open ? (
|
||||
<Drawer
|
||||
title="新建角色"
|
||||
onClose={onCancel}
|
||||
maskClosable={false}
|
||||
open={open}
|
||||
open={true}
|
||||
footer={
|
||||
<Space className="j-r-flex">
|
||||
<Button onClick={() => onCancel()}>取 消</Button>
|
||||
@ -213,6 +214,7 @@ export const SystemAdminrolesCreate: React.FC<PropInterface> = ({
|
||||
</Form>
|
||||
</div>
|
||||
</Drawer>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
@ -165,11 +165,12 @@ export const SystemAdminrolesUpdate: React.FC<PropInterface> = ({
|
||||
|
||||
return (
|
||||
<>
|
||||
{open ? (
|
||||
<Drawer
|
||||
title="编辑角色权限"
|
||||
onClose={onCancel}
|
||||
maskClosable={false}
|
||||
open={open}
|
||||
open={true}
|
||||
footer={
|
||||
<Space className="j-r-flex">
|
||||
<Button onClick={() => onCancel()}>取 消</Button>
|
||||
@ -227,6 +228,7 @@ export const SystemAdminrolesUpdate: React.FC<PropInterface> = ({
|
||||
</Form>
|
||||
</div>
|
||||
</Drawer>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user