feat:Rock Token凭证列增加复制预览快捷图标
This commit is contained in:
@@ -185,7 +185,7 @@ export function TokenRecycleBinDrawer({
|
|||||||
{
|
{
|
||||||
title: 'ID / Token(编号/兑换码 · 包ID/提取码)',
|
title: 'ID / Token(编号/兑换码 · 包ID/提取码)',
|
||||||
key: 'token_info',
|
key: 'token_info',
|
||||||
width: 330,
|
width: 320,
|
||||||
render: (_, record) => <TokenInfoCell record={record} />,
|
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 {
|
import {
|
||||||
CopyOutlined,
|
CopyOutlined,
|
||||||
ExportOutlined,
|
ExportOutlined,
|
||||||
@@ -108,7 +108,7 @@ export function buildTokenColumns({
|
|||||||
{
|
{
|
||||||
title: 'ID / Token(编号/兑换码 · 包ID/提取码)',
|
title: 'ID / Token(编号/兑换码 · 包ID/提取码)',
|
||||||
key: 'token_info',
|
key: 'token_info',
|
||||||
width: 330,
|
width: 320,
|
||||||
render: (_, record) => <TokenInfoCell record={record} />,
|
render: (_, record) => <TokenInfoCell record={record} />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -261,7 +261,7 @@ export function buildTokenColumns({
|
|||||||
{
|
{
|
||||||
title: '关联业务工单',
|
title: '关联业务工单',
|
||||||
dataIndex: 'assigned_order_no',
|
dataIndex: 'assigned_order_no',
|
||||||
width: 168,
|
width: 158,
|
||||||
render: (orderNo, record) => {
|
render: (orderNo, record) => {
|
||||||
if (!orderNo) {
|
if (!orderNo) {
|
||||||
return <Text type="secondary">-</Text>
|
return <Text type="secondary">-</Text>
|
||||||
@@ -350,7 +350,7 @@ export function buildTokenColumns({
|
|||||||
{
|
{
|
||||||
title: '凭证',
|
title: '凭证',
|
||||||
key: 'voucher',
|
key: 'voucher',
|
||||||
width: 56,
|
width: 88,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
render: (_, record) => {
|
render: (_, record) => {
|
||||||
if (record.status !== 'redeemed' && !record.upstream_fulfill_id) {
|
if (record.status !== 'redeemed' && !record.upstream_fulfill_id) {
|
||||||
@@ -362,46 +362,65 @@ export function buildTokenColumns({
|
|||||||
const imgSrc = `/images/products/${sku}.webp`
|
const imgSrc = `/images/products/${sku}.webp`
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dropdown
|
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 6 }}>
|
||||||
trigger={['click']}
|
<Dropdown
|
||||||
menu={{
|
trigger={['click']}
|
||||||
items: [
|
menu={{
|
||||||
{ key: 'copy', icon: <CopyOutlined />, label: '复制发货结果图' },
|
items: [
|
||||||
{ key: 'preview', icon: <EyeOutlined />, label: '预览高清大图' },
|
{ key: 'copy', icon: <CopyOutlined />, label: '复制发货结果图' },
|
||||||
],
|
{ key: 'preview', icon: <EyeOutlined />, label: '预览高清大图' },
|
||||||
onClick: ({ key }) => {
|
],
|
||||||
if (key === 'copy') onCopyVoucher(record)
|
onClick: ({ key }) => {
|
||||||
if (key === 'preview') onPreviewVoucher(record)
|
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',
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{isCopying ? (
|
<div
|
||||||
<Spin size="small" />
|
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
|
<img
|
||||||
src={imgSrc}
|
src={imgSrc}
|
||||||
alt={record.target_skin || '道具'}
|
alt={record.target_skin || '道具'}
|
||||||
style={{ width: '100%', height: '100%', objectFit: 'contain', padding: 2 }}
|
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>
|
</div>
|
||||||
</Dropdown>
|
</div>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user