mirror of
https://github.com/PlayEdu/backend
synced 2025-06-08 15:38:36 +08:00
学员添加、编辑去除昵称字段及其它优化
This commit is contained in:
parent
5a12f0d79f
commit
1555c361d5
Binary file not shown.
@ -51,7 +51,6 @@ export function updateUser(
|
|||||||
id: number,
|
id: number,
|
||||||
email: string,
|
email: string,
|
||||||
name: string,
|
name: string,
|
||||||
nickname: string,
|
|
||||||
avatar: string,
|
avatar: string,
|
||||||
password: string,
|
password: string,
|
||||||
idCard: string,
|
idCard: string,
|
||||||
@ -59,7 +58,6 @@ export function updateUser(
|
|||||||
) {
|
) {
|
||||||
return client.put(`/backend/v1/user/${id}`, {
|
return client.put(`/backend/v1/user/${id}`, {
|
||||||
email,
|
email,
|
||||||
nickname,
|
|
||||||
name,
|
name,
|
||||||
avatar,
|
avatar,
|
||||||
password,
|
password,
|
||||||
|
@ -117,16 +117,16 @@ export const MemberCreate: React.FC<PropInterface> = ({ open, onCancel }) => {
|
|||||||
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: 200 }} placeholder="请输入姓名" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="学员头像"
|
label="头像"
|
||||||
name="avatar"
|
name="avatar"
|
||||||
rules={[{ required: true, message: "请上传学员头像!" }]}
|
rules={[{ required: true, message: "请上传头像!" }]}
|
||||||
>
|
>
|
||||||
<div className="c-flex">
|
<div className="c-flex">
|
||||||
<div className="d-flex">
|
<div className="d-flex">
|
||||||
@ -153,11 +153,11 @@ export const MemberCreate: React.FC<PropInterface> = ({ open, onCancel }) => {
|
|||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="学员邮箱"
|
label="邮箱"
|
||||||
name="email"
|
name="email"
|
||||||
rules={[{ required: true, message: "请输入学员邮箱!" }]}
|
rules={[{ required: true, message: "请输入邮箱!" }]}
|
||||||
>
|
>
|
||||||
<Input style={{ width: 200 }} placeholder="请输入学员邮箱" />
|
<Input style={{ width: 200 }} placeholder="请输入邮箱" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="身份证号"
|
label="身份证号"
|
||||||
@ -166,14 +166,18 @@ export const MemberCreate: React.FC<PropInterface> = ({ open, onCancel }) => {
|
|||||||
>
|
>
|
||||||
<Input style={{ width: 200 }} placeholder="请输入身份证号" />
|
<Input style={{ width: 200 }} placeholder="请输入身份证号" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="学员部门" name="dep_ids">
|
<Form.Item
|
||||||
|
label="部门"
|
||||||
|
name="dep_ids"
|
||||||
|
rules={[{ required: true, message: "请选择部门!" }]}
|
||||||
|
>
|
||||||
<Cascader
|
<Cascader
|
||||||
style={{ width: 200 }}
|
style={{ width: 200 }}
|
||||||
options={departments}
|
options={departments}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
multiple
|
multiple
|
||||||
maxTagCount="responsive"
|
maxTagCount="responsive"
|
||||||
placeholder="请选择学员部门"
|
placeholder="请选择部门"
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Form>
|
</Form>
|
||||||
|
@ -79,7 +79,6 @@ export const MemberUpdate: React.FC<PropInterface> = ({
|
|||||||
form.setFieldsValue({
|
form.setFieldsValue({
|
||||||
email: user.email,
|
email: user.email,
|
||||||
name: user.name,
|
name: user.name,
|
||||||
nickname: user.nickname,
|
|
||||||
avatar: user.avatar,
|
avatar: user.avatar,
|
||||||
idCard: user.id_card,
|
idCard: user.id_card,
|
||||||
dep_ids: depIds,
|
dep_ids: depIds,
|
||||||
@ -131,7 +130,6 @@ export const MemberUpdate: React.FC<PropInterface> = ({
|
|||||||
id,
|
id,
|
||||||
values.email,
|
values.email,
|
||||||
values.name,
|
values.name,
|
||||||
values.nickname,
|
|
||||||
values.avatar,
|
values.avatar,
|
||||||
values.password || "",
|
values.password || "",
|
||||||
values.idCard,
|
values.idCard,
|
||||||
@ -173,16 +171,16 @@ export const MemberUpdate: React.FC<PropInterface> = ({
|
|||||||
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: 200 }} placeholder="请输入姓名" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="学员头像"
|
label="头像"
|
||||||
name="avatar"
|
name="avatar"
|
||||||
rules={[{ required: true, message: "请上传学员头像!" }]}
|
rules={[{ required: true, message: "请上传头像!" }]}
|
||||||
>
|
>
|
||||||
<div className="c-flex">
|
<div className="c-flex">
|
||||||
<div className="d-flex">
|
<div className="d-flex">
|
||||||
@ -198,38 +196,34 @@ export const MemberUpdate: React.FC<PropInterface> = ({
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item label="登录密码" name="password">
|
||||||
label="登录密码"
|
|
||||||
name="password"
|
|
||||||
rules={[{ required: true, message: "请输入登录密码!" }]}
|
|
||||||
>
|
|
||||||
<Input.Password
|
<Input.Password
|
||||||
style={{ width: 200 }}
|
style={{ width: 200 }}
|
||||||
placeholder="请输入登录密码"
|
placeholder="请输入登录密码"
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label="学员邮箱"
|
label="邮箱"
|
||||||
name="email"
|
name="email"
|
||||||
rules={[{ required: true, message: "请输入学员邮箱!" }]}
|
rules={[{ required: true, message: "请输入邮箱!" }]}
|
||||||
>
|
>
|
||||||
<Input style={{ width: 200 }} placeholder="请输入学员邮箱" />
|
<Input style={{ width: 200 }} placeholder="请输入邮箱" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item label="身份证号" name="idCard">
|
||||||
label="身份证号"
|
|
||||||
name="idCard"
|
|
||||||
rules={[{ required: true, message: "请输入身份证号!" }]}
|
|
||||||
>
|
|
||||||
<Input style={{ width: 200 }} placeholder="请输入身份证号" />
|
<Input style={{ width: 200 }} placeholder="请输入身份证号" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label="学员部门" name="dep_ids">
|
<Form.Item
|
||||||
|
label="部门"
|
||||||
|
name="dep_ids"
|
||||||
|
rules={[{ required: true, message: "请选择部门!" }]}
|
||||||
|
>
|
||||||
<Cascader
|
<Cascader
|
||||||
style={{ width: 200 }}
|
style={{ width: 200 }}
|
||||||
options={departments}
|
options={departments}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
multiple
|
multiple
|
||||||
maxTagCount="responsive"
|
maxTagCount="responsive"
|
||||||
placeholder="请选择学员部门"
|
placeholder="请选择部门"
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Form>
|
</Form>
|
||||||
|
@ -13,7 +13,6 @@ const { confirm } = Modal;
|
|||||||
|
|
||||||
interface DataType {
|
interface DataType {
|
||||||
id: React.Key;
|
id: React.Key;
|
||||||
nickname: string;
|
|
||||||
name: string;
|
name: string;
|
||||||
email: string;
|
email: string;
|
||||||
created_at: string;
|
created_at: string;
|
||||||
@ -48,12 +47,7 @@ export const MemberPage: React.FC = () => {
|
|||||||
dataIndex: "id",
|
dataIndex: "id",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "学员昵称",
|
title: "姓名",
|
||||||
dataIndex: "nickname",
|
|
||||||
render: (text: string) => <span>{text}</span>,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "学员姓名",
|
|
||||||
dataIndex: "name",
|
dataIndex: "name",
|
||||||
render: (text: string) => <span>{text}</span>,
|
render: (text: string) => <span>{text}</span>,
|
||||||
},
|
},
|
||||||
@ -118,7 +112,7 @@ export const MemberPage: React.FC = () => {
|
|||||||
setLoading(true);
|
setLoading(true);
|
||||||
user
|
user
|
||||||
.userList(page, size, {
|
.userList(page, size, {
|
||||||
nickname: nickname,
|
name: nickname,
|
||||||
email: email,
|
email: email,
|
||||||
id_card: id_card,
|
id_card: id_card,
|
||||||
dep_ids: depIds,
|
dep_ids: depIds,
|
||||||
@ -223,14 +217,14 @@ export const MemberPage: React.FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="d-flex">
|
<div className="d-flex">
|
||||||
<div className="d-flex mr-24">
|
<div className="d-flex mr-24">
|
||||||
<Typography.Text>昵称:</Typography.Text>
|
<Typography.Text>姓名:</Typography.Text>
|
||||||
<Input
|
<Input
|
||||||
value={nickname}
|
value={nickname}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
setNickname(e.target.value);
|
setNickname(e.target.value);
|
||||||
}}
|
}}
|
||||||
style={{ width: 160 }}
|
style={{ width: 160 }}
|
||||||
placeholder="请输入昵称"
|
placeholder="请输入姓名"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="d-flex mr-24">
|
<div className="d-flex mr-24">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user