fix:复制按钮只复制兑换码和提取码

This commit is contained in:
2026-10-31 17:13:48 +08:00
parent 8fcc486c5d
commit ce8d99ad95
@@ -183,10 +183,41 @@ export function TokenRecycleBinDrawer({
const columns: ColumnsType<RockTokenItem> = [
{ title: 'ID', dataIndex: 'id', width: 80 },
{
title: '0666 编号',
title: '0666 编号 / 兑换码',
dataIndex: 'upstream_token_id',
width: 180,
render: (value?: string) => value || '-',
width: 360,
onCell: () => ({ style: { whiteSpace: 'nowrap' } }),
render: (_, record) => {
const text = `${record.upstream_token_id || '-'}/${record.redeem_code || '-'}`
// 复制按钮只复制兑换码,编号不参与复制
const copyText = (record.redeem_code || '').trim()
return (
<Text
copyable={copyText ? { text: copyText } : false}
style={{ fontSize: 12, fontFamily: 'monospace', fontWeight: 600, whiteSpace: 'nowrap' }}
>
{text}
</Text>
)
},
},
{
title: '包ID / 提取码',
width: 260,
render: (_, record) => {
const packageText = record.package_id ? String(record.package_id) : '-'
const text = `${packageText}/${record.token || '-'}`
// 复制按钮只复制提取码,包 ID 不参与复制
const copyText = (record.token || '').trim()
return (
<Text
copyable={copyText ? { text: copyText } : false}
style={{ fontSize: 12, fontFamily: 'monospace', fontWeight: 600, wordBreak: 'break-all' }}
>
{text}
</Text>
)
},
},
{
title: '状态',
@@ -244,7 +275,7 @@ export function TokenRecycleBinDrawer({
<Drawer
open={open}
onClose={handleClose}
width={1100}
width={1280}
title="回收站 · 已删除 Token"
styles={{ body: { paddingTop: 16 } }}
>
@@ -316,7 +347,7 @@ export function TokenRecycleBinDrawer({
columns={columns}
dataSource={rows}
loading={loading}
scroll={{ x: 1100 }}
scroll={{ x: 1560 }}
rowSelection={{
selectedRowKeys: selectedIds,
onChange: (keys, selected) => {