From e4801202f714b279ea28f89b9626e8b13ea68633 Mon Sep 17 00:00:00 2001 From: lq1405 <2769838458@qq.com> Date: Wed, 30 Oct 2024 15:36:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=94=A8=E6=88=B7=E5=A4=87?= =?UTF-8?q?=E6=B3=A8=EF=BC=8C=E7=AE=A1=E7=90=86=E5=91=98=E5=8F=AF=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E5=92=8C=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/User/ModifyUser/index.tsx | 25 +++++++++++++------- src/pages/User/UserManagement/index.tsx | 31 +++++++++++++++++++++---- src/services/typing/user.d.ts | 3 ++- 3 files changed, 46 insertions(+), 13 deletions(-) diff --git a/src/pages/User/ModifyUser/index.tsx b/src/pages/User/ModifyUser/index.tsx index b3fda5c..32107cf 100644 --- a/src/pages/User/ModifyUser/index.tsx +++ b/src/pages/User/ModifyUser/index.tsx @@ -113,7 +113,7 @@ const ModifyUser: React.FC = ({ userId, setFormRef, open }) => @@ -123,7 +123,7 @@ const ModifyUser: React.FC = ({ userId, setFormRef, open }) => @@ -132,7 +132,7 @@ const ModifyUser: React.FC = ({ userId, setFormRef, open }) => @@ -149,7 +149,7 @@ const ModifyUser: React.FC = ({ userId, setFormRef, open }) => + + + + + diff --git a/src/pages/User/UserManagement/index.tsx b/src/pages/User/UserManagement/index.tsx index 6bdb9e8..71586bd 100644 --- a/src/pages/User/UserManagement/index.tsx +++ b/src/pages/User/UserManagement/index.tsx @@ -4,7 +4,7 @@ import { QueryRoleOption } from "@/services/services/role"; import { QueryUserList } from "@/services/services/user"; import { FormatDate } from "@/util/time"; import { useAccess, useModel } from "@umijs/max"; -import { Button, Form, Input, InputNumber, message, Modal, Select, SelectProps, Table, Tag } from "antd"; +import { Button, Form, Input, InputNumber, message, Modal, Select, SelectProps, Table, Tag, Tooltip } from "antd"; import { ColumnsType, TablePaginationConfig } from "antd/es/table"; import { FilterValue, SorterResult, TableCurrentDataSource } from "antd/es/table/interface"; import { useEffect, useState } from "react"; @@ -172,18 +172,31 @@ const UserManagement: React.FC = () => { title: '创建时间', dataIndex: 'createdDate', render: (text, record) => FormatDate(record.createdDate), - width: '200px', + width: '160px', }, { title: '上次登录时间', dataIndex: 'lastLoginDate', render: (text, record) => FormatDate(record.lastLoginDate), - width: '200px', + width: '160px', }, { title: '上次登录IP', dataIndex: 'lastLoginIp', - width: '200px', + width: '120px', + }, + { + title: '备注', + dataIndex: 'remark', + hidden: !access.isAdminOrSuperAdmin, + ellipsis: { + showTitle: false, + }, + render: (remark) => ( + + {remark} + + ), }, { title: '操作', @@ -243,6 +256,16 @@ const UserManagement: React.FC = () => { : null + } + + + { + access.isAdminOrSuperAdmin ? + + + : + null + } diff --git a/src/services/typing/user.d.ts b/src/services/typing/user.d.ts index c1ba9be..a5d12b7 100644 --- a/src/services/typing/user.d.ts +++ b/src/services/typing/user.d.ts @@ -43,7 +43,8 @@ declare namespace UserModel { freeCount: number; affiliateCode: string; createdDate: Date; - options: userOptions + options: userOptions; + remark?: string; } type userOptions = {