feat:Rock Token凭证列增加复制预览快捷图标

This commit is contained in:
2026-11-08 14:48:11 +08:00
parent 852debb635
commit 46ac332502
2 changed files with 56 additions and 37 deletions
@@ -185,7 +185,7 @@ export function TokenRecycleBinDrawer({
{
title: 'ID / Token(编号/兑换码 · 包ID/提取码)',
key: 'token_info',
width: 330,
width: 320,
render: (_, record) => <TokenInfoCell record={record} />,
},
{
@@ -1,4 +1,4 @@
import { Button, Dropdown, Popconfirm, Space, Spin, Tag, Tooltip, Typography } from 'antd'
import { Button, Dropdown, Popconfirm, Space, Tag, Tooltip, Typography } from 'antd'
import {
CopyOutlined,
ExportOutlined,
@@ -108,7 +108,7 @@ export function buildTokenColumns({
{
title: 'ID / Token(编号/兑换码 · 包ID/提取码)',
key: 'token_info',
width: 330,
width: 320,
render: (_, record) => <TokenInfoCell record={record} />,
},
{
@@ -261,7 +261,7 @@ export function buildTokenColumns({
{
title: '关联业务工单',
dataIndex: 'assigned_order_no',
width: 168,
width: 158,
render: (orderNo, record) => {
if (!orderNo) {
return <Text type="secondary">-</Text>
@@ -350,7 +350,7 @@ export function buildTokenColumns({
{
title: '凭证',
key: 'voucher',
width: 56,
width: 88,
align: 'center',
render: (_, record) => {
if (record.status !== 'redeemed' && !record.upstream_fulfill_id) {
@@ -362,46 +362,65 @@ export function buildTokenColumns({
const imgSrc = `/images/products/${sku}.webp`
return (
<Dropdown
trigger={['click']}
menu={{
items: [
{ key: 'copy', icon: <CopyOutlined />, label: '复制发货结果图' },
{ key: 'preview', icon: <EyeOutlined />, label: '预览高清大图' },
],
onClick: ({ key }) => {
if (key === 'copy') onCopyVoucher(record)
if (key === 'preview') onPreviewVoucher(record)
},
}}
>
<div
title={`${record.target_skin || '黑色ROCK长袖T恤'} · 点击复制或预览发货凭据`}
style={{
width: 34,
height: 34,
borderRadius: 8,
border: '1px solid #e2e8f0',
background: '#f8fafc',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
cursor: 'pointer',
overflow: 'hidden',
margin: '0 auto',
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 6 }}>
<Dropdown
trigger={['click']}
menu={{
items: [
{ key: 'copy', icon: <CopyOutlined />, label: '复制发货结果图' },
{ key: 'preview', icon: <EyeOutlined />, label: '预览高清大图' },
],
onClick: ({ key }) => {
if (key === 'copy') onCopyVoucher(record)
if (key === 'preview') onPreviewVoucher(record)
},
}}
>
{isCopying ? (
<Spin size="small" />
) : (
<div
title={`${record.target_skin || '黑色ROCK长袖T恤'} · 点击展开复制/预览`}
style={{
width: 30,
height: 30,
flexShrink: 0,
borderRadius: 6,
border: '1px solid #e2e8f0',
background: '#f8fafc',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
cursor: 'pointer',
overflow: 'hidden',
}}
>
<img
src={imgSrc}
alt={record.target_skin || '道具'}
style={{ width: '100%', height: '100%', objectFit: 'contain', padding: 2 }}
/>
)}
</div>
</Dropdown>
<div style={{ display: 'flex', flexDirection: 'column', gap: 2 }}>
<Tooltip title={isCopying ? '正在生成发货结果图…' : '复制发货结果图'}>
<Button
size="small"
type="text"
icon={<CopyOutlined />}
loading={isCopying}
onClick={() => onCopyVoucher(record)}
style={{ width: 20, height: 20, padding: 0, fontSize: 11 }}
/>
</Tooltip>
<Tooltip title="预览高清大图">
<Button
size="small"
type="text"
icon={<EyeOutlined />}
onClick={() => onPreviewVoucher(record)}
style={{ width: 20, height: 20, padding: 0, fontSize: 11 }}
/>
</Tooltip>
</div>
</Dropdown>
</div>
)
},
},