mirror of
https://github.com/PlayEdu/backend
synced 2025-07-21 07:49:40 +08:00
管理人员页面重构
This commit is contained in:
parent
add06808ab
commit
10e4d0dae1
@ -1,5 +1,5 @@
|
|||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import { Modal, Select, Form, Input, message } from "antd";
|
import { Drawer, Select, Space, Button, Form, Input, message } from "antd";
|
||||||
import styles from "./create.module.less";
|
import styles from "./create.module.less";
|
||||||
import { adminRole } from "../../../../api/index";
|
import { adminRole } from "../../../../api/index";
|
||||||
|
|
||||||
@ -74,37 +74,45 @@ export const SystemAdminrolesCreate: React.FC<PropInterface> = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Modal
|
<Drawer
|
||||||
title="新建角色"
|
title="新建角色"
|
||||||
centered
|
onClose={onCancel}
|
||||||
forceRender
|
|
||||||
open={open}
|
|
||||||
width={416}
|
|
||||||
onOk={() => form.submit()}
|
|
||||||
onCancel={() => onCancel()}
|
|
||||||
maskClosable={false}
|
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">
|
<div className="float-left mt-24">
|
||||||
<Form
|
<Form
|
||||||
form={form}
|
form={form}
|
||||||
name="basic"
|
name="adminroles-create"
|
||||||
labelCol={{ span: 8 }}
|
labelCol={{ span: 5 }}
|
||||||
wrapperCol={{ span: 16 }}
|
wrapperCol={{ span: 19 }}
|
||||||
initialValues={{ remember: true }}
|
initialValues={{ remember: true }}
|
||||||
onFinish={onFinish}
|
onFinish={onFinish}
|
||||||
onFinishFailed={onFinishFailed}
|
onFinishFailed={onFinishFailed}
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
>
|
>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="角色名"
|
label="角色名称"
|
||||||
name="name"
|
name="name"
|
||||||
rules={[{ required: true, message: "请输入角色名!" }]}
|
rules={[{ required: true, message: "请输入角色名称!" }]}
|
||||||
>
|
>
|
||||||
<Input style={{ width: 200 }} placeholder="请输入角色名" />
|
<Input
|
||||||
|
style={{ width: 424 }}
|
||||||
|
placeholder="请在此处输入角色名称"
|
||||||
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="操作权限" name="action_ids">
|
<Form.Item label="操作权限" name="action_ids">
|
||||||
<Select
|
<Select
|
||||||
style={{ width: 200 }}
|
style={{ width: 424 }}
|
||||||
mode="multiple"
|
mode="multiple"
|
||||||
allowClear
|
allowClear
|
||||||
placeholder="请选择权限"
|
placeholder="请选择权限"
|
||||||
@ -113,7 +121,7 @@ export const SystemAdminrolesCreate: React.FC<PropInterface> = ({
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="数据权限" name="permission_ids">
|
<Form.Item label="数据权限" name="permission_ids">
|
||||||
<Select
|
<Select
|
||||||
style={{ width: 200 }}
|
style={{ width: 424 }}
|
||||||
mode="multiple"
|
mode="multiple"
|
||||||
allowClear
|
allowClear
|
||||||
placeholder="请选择权限"
|
placeholder="请选择权限"
|
||||||
@ -122,7 +130,7 @@ export const SystemAdminrolesCreate: React.FC<PropInterface> = ({
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Form>
|
</Form>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Drawer>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import { Modal, Form, Input, Select, message } from "antd";
|
import { Drawer, Select, Space, Button, Form, Input, message } from "antd";
|
||||||
import styles from "./update.module.less";
|
import styles from "./update.module.less";
|
||||||
import { adminRole } from "../../../../api/index";
|
import { adminRole } from "../../../../api/index";
|
||||||
|
|
||||||
interface PropInterface {
|
interface PropInterface {
|
||||||
id: number;
|
id: any;
|
||||||
open: boolean;
|
open: boolean;
|
||||||
onCancel: () => void;
|
onCancel: () => void;
|
||||||
}
|
}
|
||||||
@ -24,7 +24,7 @@ export const SystemAdminrolesUpdate: React.FC<PropInterface> = ({
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (id === 0 || "undefined" || "") {
|
if (id === undefined) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
getDetail();
|
getDetail();
|
||||||
@ -86,22 +86,27 @@ export const SystemAdminrolesUpdate: React.FC<PropInterface> = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Modal
|
<Drawer
|
||||||
title="编辑角色"
|
title="新建角色"
|
||||||
centered
|
onClose={onCancel}
|
||||||
forceRender
|
|
||||||
open={open}
|
|
||||||
width={416}
|
|
||||||
onOk={() => form.submit()}
|
|
||||||
onCancel={() => onCancel()}
|
|
||||||
maskClosable={false}
|
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">
|
<div className="float-left mt-24">
|
||||||
<Form
|
<Form
|
||||||
form={form}
|
form={form}
|
||||||
name="basic"
|
name="adminroles-update"
|
||||||
labelCol={{ span: 8 }}
|
labelCol={{ span: 5 }}
|
||||||
wrapperCol={{ span: 16 }}
|
wrapperCol={{ span: 19 }}
|
||||||
initialValues={{ remember: true }}
|
initialValues={{ remember: true }}
|
||||||
onFinish={onFinish}
|
onFinish={onFinish}
|
||||||
onFinishFailed={onFinishFailed}
|
onFinishFailed={onFinishFailed}
|
||||||
@ -112,11 +117,11 @@ export const SystemAdminrolesUpdate: React.FC<PropInterface> = ({
|
|||||||
name="name"
|
name="name"
|
||||||
rules={[{ required: true, message: "请输入角色名!" }]}
|
rules={[{ required: true, message: "请输入角色名!" }]}
|
||||||
>
|
>
|
||||||
<Input style={{ width: 200 }} placeholder="请输入角色名" />
|
<Input style={{ width: 424 }} placeholder="请输入角色名" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="操作权限" name="action_ids">
|
<Form.Item label="操作权限" name="action_ids">
|
||||||
<Select
|
<Select
|
||||||
style={{ width: 200 }}
|
style={{ width: 424 }}
|
||||||
mode="multiple"
|
mode="multiple"
|
||||||
allowClear
|
allowClear
|
||||||
placeholder="请选择权限"
|
placeholder="请选择权限"
|
||||||
@ -125,7 +130,7 @@ export const SystemAdminrolesUpdate: React.FC<PropInterface> = ({
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="数据权限" name="permission_ids">
|
<Form.Item label="数据权限" name="permission_ids">
|
||||||
<Select
|
<Select
|
||||||
style={{ width: 200 }}
|
style={{ width: 424 }}
|
||||||
mode="multiple"
|
mode="multiple"
|
||||||
allowClear
|
allowClear
|
||||||
placeholder="请选择权限"
|
placeholder="请选择权限"
|
||||||
@ -134,7 +139,7 @@ export const SystemAdminrolesUpdate: React.FC<PropInterface> = ({
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Form>
|
</Form>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Drawer>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user