mirror of
https://github.com/PlayEdu/backend
synced 2025-12-23 11:19:45 +08:00
back-bar组件
This commit is contained in:
@@ -3,6 +3,7 @@ import { Row, Col, Form, Input, Select, Switch, Button, message } from "antd";
|
||||
import styles from "./create.module.less";
|
||||
import { adminUser } from "../../../api/index";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { BackBartment } from "../../../compenents";
|
||||
|
||||
export const AdministratorCreatePage: React.FC = () => {
|
||||
const navigate = useNavigate();
|
||||
@@ -62,81 +63,86 @@ export const AdministratorCreatePage: 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="roleIds">
|
||||
<div className="d-flex">
|
||||
<Select
|
||||
style={{ width: 300 }}
|
||||
mode="multiple"
|
||||
allowClear
|
||||
placeholder="请选择角色"
|
||||
onChange={handleChange}
|
||||
options={roles}
|
||||
/>
|
||||
<Button
|
||||
type="link"
|
||||
danger
|
||||
onClick={() => navigate(`/system/adminroles`)}
|
||||
>
|
||||
角色管理
|
||||
</Button>
|
||||
</div>
|
||||
</Form.Item>
|
||||
<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="email"
|
||||
rules={[{ required: true, message: "请输入学员邮箱!" }]}
|
||||
>
|
||||
<Input style={{ width: 300 }} placeholder="请输入学员邮箱" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="密码"
|
||||
name="password"
|
||||
rules={[{ required: true, message: "请输入登录密码!" }]}
|
||||
>
|
||||
<Input.Password
|
||||
style={{ width: 300 }}
|
||||
placeholder="请输入登录密码"
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="禁止登录"
|
||||
name="is_ban_login"
|
||||
valuePropName="checked"
|
||||
rules={[{ required: true, message: "请选择禁止登录!" }]}
|
||||
>
|
||||
<Switch onChange={onChange} />
|
||||
</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="roleIds">
|
||||
<div className="d-flex">
|
||||
<Select
|
||||
style={{ width: 300 }}
|
||||
mode="multiple"
|
||||
allowClear
|
||||
placeholder="请选择角色"
|
||||
onChange={handleChange}
|
||||
options={roles}
|
||||
/>
|
||||
<Button
|
||||
type="link"
|
||||
danger
|
||||
onClick={() => navigate(`/system/adminroles`)}
|
||||
>
|
||||
角色管理
|
||||
</Button>
|
||||
</div>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="姓名"
|
||||
name="name"
|
||||
rules={[{ required: true, message: "请输入姓名!" }]}
|
||||
>
|
||||
取消
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
<Input style={{ width: 300 }} placeholder="请输入姓名" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="邮箱"
|
||||
name="email"
|
||||
rules={[{ required: true, message: "请输入学员邮箱!" }]}
|
||||
>
|
||||
<Input style={{ width: 300 }} placeholder="请输入学员邮箱" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="密码"
|
||||
name="password"
|
||||
rules={[{ required: true, message: "请输入登录密码!" }]}
|
||||
>
|
||||
<Input.Password
|
||||
style={{ width: 300 }}
|
||||
placeholder="请输入登录密码"
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="禁止登录"
|
||||
name="is_ban_login"
|
||||
valuePropName="checked"
|
||||
rules={[{ required: true, message: "请选择禁止登录!" }]}
|
||||
>
|
||||
<Switch onChange={onChange} />
|
||||
</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>
|
||||
</>
|
||||
|
||||
@@ -3,6 +3,7 @@ import { Row, Col, Form, Input, Select, Switch, Button, message } from "antd";
|
||||
import styles from "./update.module.less";
|
||||
import { adminUser } from "../../../api/index";
|
||||
import { useParams, useNavigate } from "react-router-dom";
|
||||
import { BackBartment } from "../../../compenents";
|
||||
|
||||
export const AdministratorUpdatePage: React.FC = () => {
|
||||
const params = useParams();
|
||||
@@ -80,80 +81,85 @@ export const AdministratorUpdatePage: 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="roleIds">
|
||||
<div className="d-flex">
|
||||
<Select
|
||||
style={{ width: 300 }}
|
||||
mode="multiple"
|
||||
allowClear
|
||||
placeholder="请选择角色"
|
||||
onChange={handleChange}
|
||||
options={roles}
|
||||
/>
|
||||
<Button
|
||||
type="link"
|
||||
danger
|
||||
onClick={() => navigate(`/system/adminroles`)}
|
||||
>
|
||||
角色管理
|
||||
</Button>
|
||||
</div>
|
||||
</Form.Item>
|
||||
<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="email"
|
||||
rules={[{ required: true, message: "请输入学员邮箱!" }]}
|
||||
>
|
||||
<Input style={{ width: 300 }} placeholder="请输入学员邮箱" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="密码"
|
||||
name="password"
|
||||
rules={[{ required: true, message: "请输入登录密码!" }]}
|
||||
>
|
||||
<Input.Password
|
||||
style={{ width: 300 }}
|
||||
placeholder="请输入登录密码"
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="禁止登录"
|
||||
name="is_ban_login"
|
||||
valuePropName="checked"
|
||||
>
|
||||
<Switch onChange={onChange} />
|
||||
</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="roleIds">
|
||||
<div className="d-flex">
|
||||
<Select
|
||||
style={{ width: 300 }}
|
||||
mode="multiple"
|
||||
allowClear
|
||||
placeholder="请选择角色"
|
||||
onChange={handleChange}
|
||||
options={roles}
|
||||
/>
|
||||
<Button
|
||||
type="link"
|
||||
danger
|
||||
onClick={() => navigate(`/system/adminroles`)}
|
||||
>
|
||||
角色管理
|
||||
</Button>
|
||||
</div>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="姓名"
|
||||
name="name"
|
||||
rules={[{ required: true, message: "请输入姓名!" }]}
|
||||
>
|
||||
取消
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
<Input style={{ width: 300 }} placeholder="请输入姓名" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="邮箱"
|
||||
name="email"
|
||||
rules={[{ required: true, message: "请输入学员邮箱!" }]}
|
||||
>
|
||||
<Input style={{ width: 300 }} placeholder="请输入学员邮箱" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="密码"
|
||||
name="password"
|
||||
rules={[{ required: true, message: "请输入登录密码!" }]}
|
||||
>
|
||||
<Input.Password
|
||||
style={{ width: 300 }}
|
||||
placeholder="请输入登录密码"
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="禁止登录"
|
||||
name="is_ban_login"
|
||||
valuePropName="checked"
|
||||
>
|
||||
<Switch onChange={onChange} />
|
||||
</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>
|
||||
</>
|
||||
|
||||
@@ -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>
|
||||
</>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user