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