Move employee QR action to operations column
This commit is contained in:
@@ -222,24 +222,14 @@ function EmployeeSerialsPage() {
|
||||
title: '员工码',
|
||||
dataIndex: 'employeeSerials',
|
||||
key: 'employeeSerials',
|
||||
width: 240,
|
||||
width: 180,
|
||||
render: (serials?: EmployeeSerial[]) => {
|
||||
const serial = getDisplaySerial(serials);
|
||||
if (!serial) return '-';
|
||||
|
||||
return (
|
||||
<Space direction="vertical" size={0}>
|
||||
<Space size={8}>
|
||||
<span style={{ fontFamily: 'monospace' }}>{serial.serialNumber}</span>
|
||||
<Button
|
||||
type="link"
|
||||
size="small"
|
||||
icon={<QrcodeOutlined />}
|
||||
onClick={() => handleViewQRCode(serial.serialNumber)}
|
||||
>
|
||||
查看二维码
|
||||
</Button>
|
||||
</Space>
|
||||
<Tag color={serial.isActive ? 'green' : 'red'}>
|
||||
{serial.isActive ? '有效' : '已吊销'}
|
||||
</Tag>
|
||||
@@ -257,9 +247,22 @@ function EmployeeSerialsPage() {
|
||||
{
|
||||
title: '操作',
|
||||
key: 'actions',
|
||||
width: 240,
|
||||
render: (_: unknown, record: User) => (
|
||||
width: 320,
|
||||
render: (_: unknown, record: User) => {
|
||||
const serial = getDisplaySerial(record.employeeSerials);
|
||||
|
||||
return (
|
||||
<Space wrap>
|
||||
{serial && (
|
||||
<Button
|
||||
type="link"
|
||||
size="small"
|
||||
icon={<QrcodeOutlined />}
|
||||
onClick={() => handleViewQRCode(serial.serialNumber)}
|
||||
>
|
||||
查看二维码
|
||||
</Button>
|
||||
)}
|
||||
<Button type="link" size="small" icon={<EditOutlined />} onClick={() => openEdit(record)}>
|
||||
编辑
|
||||
</Button>
|
||||
@@ -274,7 +277,8 @@ function EmployeeSerialsPage() {
|
||||
</Button>
|
||||
)}
|
||||
</Space>
|
||||
),
|
||||
);
|
||||
},
|
||||
},
|
||||
],
|
||||
[currentUser?.id]
|
||||
|
||||
Reference in New Issue
Block a user