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