feat:2、数据显示优化

This commit is contained in:
2026-10-30 10:30:07 +08:00
parent 1a9ff5d03d
commit ea46700fe2
@@ -58,51 +58,39 @@ export function buildTokenColumns({
{ {
title: '0666 编号 / 兑换码', title: '0666 编号 / 兑换码',
dataIndex: 'upstream_token_id', dataIndex: 'upstream_token_id',
width: 250, width: 360,
render: (_, record) => ( onCell: () => ({ style: { whiteSpace: 'nowrap' } }),
<Space direction="vertical" size={2}> render: (_, record) => {
const text = `${record.upstream_token_id || '-'}/${record.redeem_code || '-'}`
const copyText = [record.upstream_token_id, record.redeem_code].filter(Boolean).join('/')
return (
<Text <Text
copyable={record.upstream_token_id ? { text: record.upstream_token_id } : false} copyable={copyText ? { text: copyText } : false}
style={{ fontWeight: 600 }} style={{ fontSize: 12, fontFamily: 'monospace', fontWeight: 600, whiteSpace: 'nowrap' }}
> >
0666 #{record.upstream_token_id || '-'} {text}
</Text> </Text>
<Text )
copyable={record.redeem_code ? { text: record.redeem_code } : false} },
type="secondary"
style={{ fontSize: 12, fontFamily: 'monospace' }}
>
{record.redeem_code || '-'}
</Text>
<Text type="secondary" style={{ fontSize: 11 }}>本地 #{record.id}</Text>
</Space>
),
}, },
{ {
title: '包ID / 提取码', title: '包ID / 提取码',
width: 230, width: 260,
render: (_, record) => ( render: (_, record) => {
<Space direction="vertical" size={2}> const packageText = record.package_id ? String(record.package_id) : '-'
<div style={{ fontSize: 12, color: '#334155' }}> const text = `${packageText}/${record.token || '-'}`
<span style={{ color: '#94a3b8' }}>包ID: </span> const copyText = [record.package_id ? String(record.package_id) : '', record.token || '']
{record.package_id ? `#${record.package_id}` : '-'} .filter(Boolean)
</div> .join('/')
<div style={{ display: 'flex', alignItems: 'center', gap: 6 }}> return (
<span style={{ color: '#94a3b8', fontSize: 12 }}>提取码:</span> <Text
<Text copyable={copyText ? { text: copyText } : false}
copyable={record.token ? { text: record.token } : false} style={{ fontSize: 12, fontFamily: 'monospace', fontWeight: 600, wordBreak: 'break-all' }}
style={{ fontSize: 12, fontFamily: 'monospace', fontWeight: 600 }} >
> {text}
{record.token || '-'} </Text>
</Text> )
</div> },
{record.source === 'package' ? (
<Tag color="purple" style={{ margin: 0, width: 'fit-content', fontSize: 10 }}>
打包导入
</Tag>
) : null}
</Space>
),
}, },
{ {
title: '规格与适用范围', title: '规格与适用范围',