feat: edit show
parent
fa7e0b0964
commit
c6d594216e
|
@ -61,16 +61,20 @@ const Page = () => {
|
|||
align: 'center',
|
||||
hideInSearch: true,
|
||||
render: (_, record: User.UserItem) => {
|
||||
const isExpired = Reflect.has(record, 'isExpired') && record.isExpired === true;
|
||||
return (
|
||||
<>
|
||||
<Button
|
||||
type="link"
|
||||
className={`${isExpired ? 'text-[red] font-bold' : ''} `}
|
||||
onClick={() => {
|
||||
setEditRow(record);
|
||||
setUserDetailsVisible(true);
|
||||
}}
|
||||
>
|
||||
{record.email}
|
||||
{record.email} {isExpired && <span>(套餐过期)</span>}
|
||||
</Button>
|
||||
</>
|
||||
);
|
||||
},
|
||||
},
|
||||
|
@ -204,9 +208,11 @@ const Page = () => {
|
|||
dataIndex: 'option',
|
||||
valueType: 'option',
|
||||
align: 'center',
|
||||
render: (_: React.ReactNode, record: User.UserItem) => (
|
||||
render: (_: React.ReactNode, record: User.UserItem) => {
|
||||
const isExpired = !record.packageId || (Reflect.has(record, 'isExpired') && record.isExpired === true);
|
||||
return (
|
||||
<div className="space-x-4">
|
||||
{!record.packageId && (
|
||||
{isExpired && (
|
||||
<Button
|
||||
key={'openPackage'}
|
||||
type="primary"
|
||||
|
@ -248,7 +254,8 @@ const Page = () => {
|
|||
删除用户
|
||||
</Button>
|
||||
</div>
|
||||
),
|
||||
);
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ declare namespace User {
|
|||
packageId?: string;
|
||||
|
||||
expired?: string;
|
||||
isExpired?: boolean | null;
|
||||
// 用户来源 1. ux 注册 2. 后台创建
|
||||
userSource?: number;
|
||||
// 用户总空间
|
||||
|
|
Loading…
Reference in New Issue