mirror of
https://github.com/PlayEdu/backend
synced 2025-12-31 13:09:43 +08:00
弹窗组件open外置并使用三元运算
This commit is contained in:
@@ -165,68 +165,70 @@ export const SystemAdminrolesUpdate: React.FC<PropInterface> = ({
|
||||
|
||||
return (
|
||||
<>
|
||||
<Drawer
|
||||
title="编辑角色权限"
|
||||
onClose={onCancel}
|
||||
maskClosable={false}
|
||||
open={open}
|
||||
footer={
|
||||
<Space className="j-r-flex">
|
||||
<Button onClick={() => onCancel()}>取 消</Button>
|
||||
<Button onClick={() => form.submit()} type="primary">
|
||||
确 认
|
||||
</Button>
|
||||
</Space>
|
||||
}
|
||||
width={634}
|
||||
>
|
||||
<div className="float-left mt-24">
|
||||
<Form
|
||||
form={form}
|
||||
name="adminroles-update"
|
||||
labelCol={{ span: 5 }}
|
||||
wrapperCol={{ span: 19 }}
|
||||
initialValues={{ remember: true }}
|
||||
onFinish={onFinish}
|
||||
onFinishFailed={onFinishFailed}
|
||||
autoComplete="off"
|
||||
>
|
||||
<Form.Item
|
||||
label="角色名"
|
||||
name="name"
|
||||
rules={[{ required: true, message: "请输入角色名!" }]}
|
||||
{open ? (
|
||||
<Drawer
|
||||
title="编辑角色权限"
|
||||
onClose={onCancel}
|
||||
maskClosable={false}
|
||||
open={true}
|
||||
footer={
|
||||
<Space className="j-r-flex">
|
||||
<Button onClick={() => onCancel()}>取 消</Button>
|
||||
<Button onClick={() => form.submit()} type="primary">
|
||||
确 认
|
||||
</Button>
|
||||
</Space>
|
||||
}
|
||||
width={634}
|
||||
>
|
||||
<div className="float-left mt-24">
|
||||
<Form
|
||||
form={form}
|
||||
name="adminroles-update"
|
||||
labelCol={{ span: 5 }}
|
||||
wrapperCol={{ span: 19 }}
|
||||
initialValues={{ remember: true }}
|
||||
onFinish={onFinish}
|
||||
onFinishFailed={onFinishFailed}
|
||||
autoComplete="off"
|
||||
>
|
||||
<Input
|
||||
style={{ width: 424 }}
|
||||
allowClear
|
||||
placeholder="请输入角色名"
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item label="操作权限" name="action_ids">
|
||||
<TreeSelect
|
||||
style={{ width: 424 }}
|
||||
listHeight={600}
|
||||
treeCheckable={true}
|
||||
placeholder="请选择权限"
|
||||
multiple
|
||||
allowClear
|
||||
treeData={actions}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item label="数据权限" name="permission_ids">
|
||||
<TreeSelect
|
||||
style={{ width: 424 }}
|
||||
listHeight={600}
|
||||
treeCheckable={true}
|
||||
placeholder="请选择权限"
|
||||
multiple
|
||||
allowClear
|
||||
treeData={permissions}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</div>
|
||||
</Drawer>
|
||||
<Form.Item
|
||||
label="角色名"
|
||||
name="name"
|
||||
rules={[{ required: true, message: "请输入角色名!" }]}
|
||||
>
|
||||
<Input
|
||||
style={{ width: 424 }}
|
||||
allowClear
|
||||
placeholder="请输入角色名"
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item label="操作权限" name="action_ids">
|
||||
<TreeSelect
|
||||
style={{ width: 424 }}
|
||||
listHeight={600}
|
||||
treeCheckable={true}
|
||||
placeholder="请选择权限"
|
||||
multiple
|
||||
allowClear
|
||||
treeData={actions}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item label="数据权限" name="permission_ids">
|
||||
<TreeSelect
|
||||
style={{ width: 424 }}
|
||||
listHeight={600}
|
||||
treeCheckable={true}
|
||||
placeholder="请选择权限"
|
||||
multiple
|
||||
allowClear
|
||||
treeData={permissions}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</div>
|
||||
</Drawer>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user