back-bar组件

This commit is contained in:
禺狨
2023-03-07 10:26:52 +08:00
parent 2176bbf7a1
commit 87b29bf0cd
10 changed files with 485 additions and 397 deletions

View File

@@ -3,6 +3,7 @@ import { Row, Col, Form, Input, Select, Button, message } from "antd";
import styles from "./create.module.less";
import { adminRole } from "../../../api/index";
import { useNavigate } from "react-router-dom";
import { BackBartment } from "../../../compenents";
export const AdminrolesCreatePage: React.FC = () => {
const navigate = useNavigate();
@@ -47,47 +48,52 @@ export const AdminrolesCreatePage: React.FC = () => {
<>
<Row className="playedu-main-body">
<Col>
<Form
form={form}
name="basic"
labelCol={{ span: 8 }}
wrapperCol={{ span: 16 }}
style={{ width: 600 }}
initialValues={{ remember: true }}
onFinish={onFinish}
onFinishFailed={onFinishFailed}
autoComplete="off"
>
<Form.Item
label="姓名"
name="name"
rules={[{ required: true, message: "请输入角色名!" }]}
<div className="float-left mb-24">
<BackBartment title="添加管理员角色" />
</div>
<div className="float-left">
<Form
form={form}
name="basic"
labelCol={{ span: 8 }}
wrapperCol={{ span: 16 }}
style={{ width: 600 }}
initialValues={{ remember: true }}
onFinish={onFinish}
onFinishFailed={onFinishFailed}
autoComplete="off"
>
<Input style={{ width: 300 }} placeholder="请输入角色名" />
</Form.Item>
<Form.Item label="权限" name="permission_ids">
<Select
style={{ width: 300 }}
mode="multiple"
allowClear
placeholder="请选择权限"
onChange={handleChange}
options={permissions}
/>
</Form.Item>
<Form.Item wrapperCol={{ offset: 8, span: 16 }}>
<Button type="primary" htmlType="submit">
</Button>
<Button
className="ml-15"
htmlType="button"
onClick={() => navigate(-1)}
<Form.Item
label="姓名"
name="name"
rules={[{ required: true, message: "请输入角色名!" }]}
>
</Button>
</Form.Item>
</Form>
<Input style={{ width: 300 }} placeholder="请输入角色名" />
</Form.Item>
<Form.Item label="权限" name="permission_ids">
<Select
style={{ width: 300 }}
mode="multiple"
allowClear
placeholder="请选择权限"
onChange={handleChange}
options={permissions}
/>
</Form.Item>
<Form.Item wrapperCol={{ offset: 8, span: 16 }}>
<Button type="primary" htmlType="submit">
</Button>
<Button
className="ml-15"
htmlType="button"
onClick={() => navigate(-1)}
>
</Button>
</Form.Item>
</Form>
</div>
</Col>
</Row>
</>

View File

@@ -15,6 +15,7 @@ import { PlusOutlined, ReloadOutlined } from "@ant-design/icons";
import { adminRole } from "../../../api/index";
import { dateFormat } from "../../../utils/index";
import { Link, useNavigate } from "react-router-dom";
import { BackBartment } from "../../../compenents";
interface DataType {
id: React.Key;
@@ -106,6 +107,9 @@ export const SystemAdminrolesPage: React.FC = () => {
return (
<>
<div className="playedu-main-body">
<div className="float-left mb-24">
<BackBartment title="管理员角色" />
</div>
<div className="float-left j-b-flex mb-24">
<div className="d-flex">
<Link

View File

@@ -3,6 +3,7 @@ import { Row, Col, Form, Input, Select, Button, message } from "antd";
import styles from "./update.module.less";
import { adminRole } from "../../../api/index";
import { useParams, useNavigate } from "react-router-dom";
import { BackBartment } from "../../../compenents";
export const AdminrolesUpdatePage: React.FC = () => {
const params = useParams();
@@ -62,47 +63,52 @@ export const AdminrolesUpdatePage: React.FC = () => {
<>
<Row className="playedu-main-body">
<Col>
<Form
form={form}
name="basic"
labelCol={{ span: 8 }}
wrapperCol={{ span: 16 }}
style={{ width: 600 }}
initialValues={{ remember: true }}
onFinish={onFinish}
onFinishFailed={onFinishFailed}
autoComplete="off"
>
<Form.Item
label="姓名"
name="name"
rules={[{ required: true, message: "请输入角色名!" }]}
<div className="float-left mb-24">
<BackBartment title="编辑管理员角色" />
</div>
<div className="float-left">
<Form
form={form}
name="basic"
labelCol={{ span: 8 }}
wrapperCol={{ span: 16 }}
style={{ width: 600 }}
initialValues={{ remember: true }}
onFinish={onFinish}
onFinishFailed={onFinishFailed}
autoComplete="off"
>
<Input style={{ width: 300 }} placeholder="请输入角色名" />
</Form.Item>
<Form.Item label="权限" name="permission_ids">
<Select
style={{ width: 300 }}
mode="multiple"
allowClear
placeholder="请选择权限"
onChange={handleChange}
options={permissions}
/>
</Form.Item>
<Form.Item wrapperCol={{ offset: 8, span: 16 }}>
<Button type="primary" htmlType="submit">
</Button>
<Button
className="ml-15"
htmlType="button"
onClick={() => navigate(-1)}
<Form.Item
label="姓名"
name="name"
rules={[{ required: true, message: "请输入角色名!" }]}
>
</Button>
</Form.Item>
</Form>
<Input style={{ width: 300 }} placeholder="请输入角色名" />
</Form.Item>
<Form.Item label="权限" name="permission_ids">
<Select
style={{ width: 300 }}
mode="multiple"
allowClear
placeholder="请选择权限"
onChange={handleChange}
options={permissions}
/>
</Form.Item>
<Form.Item wrapperCol={{ offset: 8, span: 16 }}>
<Button type="primary" htmlType="submit">
</Button>
<Button
className="ml-15"
htmlType="button"
onClick={() => navigate(-1)}
>
</Button>
</Form.Item>
</Form>
</div>
</Col>
</Row>
</>