fix(distribution-admin): 优化分销收号管理表格列宽与中文化,补全已结单货架状态
This commit is contained in:
@@ -80,8 +80,12 @@ const REVIEW_STATUS_LABELS: Record<string, { label: string; color: string }> = {
|
||||
|
||||
const LISTING_STATUS_LABELS: Record<string, { label: string; color: string }> = {
|
||||
published: { label: '上架在售', color: 'green' },
|
||||
rented: { label: '出租中', color: 'cyan' },
|
||||
completed: { label: '已结单/售出', color: 'blue' },
|
||||
offline: { label: '已下架', color: 'default' },
|
||||
closed: { label: '已关闭', color: 'error' },
|
||||
abnormal: { label: '异常冻结', color: 'error' },
|
||||
sealed: { label: '已封存', color: 'magenta' },
|
||||
draft: { label: '草稿', color: 'warning' },
|
||||
}
|
||||
|
||||
@@ -537,6 +541,7 @@ export default function Orders({ kind }: { kind: 'all' | 'sold' | 'receive' }) {
|
||||
rowKey="listing_id"
|
||||
loading={recvLoading}
|
||||
dataSource={receivedListings}
|
||||
scroll={{ x: 1200 }}
|
||||
pagination={{
|
||||
current: recvPage,
|
||||
pageSize,
|
||||
@@ -548,26 +553,43 @@ export default function Orders({ kind }: { kind: 'all' | 'sold' | 'receive' }) {
|
||||
{
|
||||
title: '商品编号',
|
||||
dataIndex: 'listing_no',
|
||||
width: 140,
|
||||
width: 170,
|
||||
render: (v: string) => (
|
||||
<Typography.Text strong copyable>
|
||||
{v}
|
||||
</Typography.Text>
|
||||
<div style={{ whiteSpace: 'nowrap' }}>
|
||||
<Typography.Text
|
||||
copyable={{ text: v, tooltips: ['复制商品编号', '已复制'] }}
|
||||
strong
|
||||
style={{
|
||||
fontSize: 13,
|
||||
color: '#1677ff',
|
||||
fontFamily: 'monospace',
|
||||
whiteSpace: 'nowrap',
|
||||
display: 'inline-flex',
|
||||
alignItems: 'center',
|
||||
}}
|
||||
>
|
||||
{v}
|
||||
</Typography.Text>
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '账号标题与游戏',
|
||||
dataIndex: 'title',
|
||||
minWidth: 220,
|
||||
width: 260,
|
||||
render: (_: unknown, row: ReceivedListing) => (
|
||||
<div>
|
||||
<Typography.Text strong style={{ display: 'block' }}>
|
||||
<Typography.Text
|
||||
strong
|
||||
style={{ fontSize: 14, lineHeight: '20px', display: 'block' }}
|
||||
ellipsis={{ tooltip: row.title }}
|
||||
>
|
||||
{row.title || '无标题'}
|
||||
</Typography.Text>
|
||||
<Space size={4} style={{ marginTop: 4 }}>
|
||||
<Space size={4} style={{ marginTop: 4 }} wrap>
|
||||
<Tag color="blue">{formatGameName(row.game_name)}</Tag>
|
||||
{row.server_region && <Tag>{row.server_region}</Tag>}
|
||||
{row.login_platform && <Tag>{row.login_platform}</Tag>}
|
||||
{row.login_platform && <Tag color="cyan">{row.login_platform}</Tag>}
|
||||
{row.rank_level && <Tag color="purple">{row.rank_level}</Tag>}
|
||||
</Space>
|
||||
</div>
|
||||
@@ -576,12 +598,12 @@ export default function Orders({ kind }: { kind: 'all' | 'sold' | 'receive' }) {
|
||||
{
|
||||
title: '上传卖家',
|
||||
dataIndex: 'owner_phone',
|
||||
width: 150,
|
||||
width: 140,
|
||||
render: (_: unknown, row: ReceivedListing) => (
|
||||
<div>
|
||||
<div>{row.owner_nickname || '匿名卖家'}</div>
|
||||
<Typography.Text type="secondary" style={{ fontSize: 12 }}>
|
||||
{row.owner_phone || '-'}
|
||||
<div style={{ fontWeight: 500, whiteSpace: 'nowrap' }}>{row.owner_nickname || '匿名卖家'}</div>
|
||||
<Typography.Text type="secondary" style={{ fontSize: 12, whiteSpace: 'nowrap' }}>
|
||||
{maskPhone(row.owner_phone)}
|
||||
</Typography.Text>
|
||||
</div>
|
||||
),
|
||||
@@ -591,10 +613,10 @@ export default function Orders({ kind }: { kind: 'all' | 'sold' | 'receive' }) {
|
||||
width: 140,
|
||||
render: (_: unknown, row: ReceivedListing) => (
|
||||
<div>
|
||||
<Typography.Text strong style={{ color: '#cf1322' }}>
|
||||
<Typography.Text strong style={{ color: '#cf1322', fontSize: 15, whiteSpace: 'nowrap', display: 'block' }}>
|
||||
{formatMoney(row.price_cent)}
|
||||
</Typography.Text>
|
||||
<div style={{ fontSize: 12, color: '#888' }}>
|
||||
<div style={{ fontSize: 12, color: '#888', whiteSpace: 'nowrap', marginTop: 2 }}>
|
||||
押金: {formatMoney(row.deposit_amount_cent)}
|
||||
</div>
|
||||
</div>
|
||||
@@ -610,7 +632,7 @@ export default function Orders({ kind }: { kind: 'all' | 'sold' | 'receive' }) {
|
||||
<div>
|
||||
<Tag color={conf.color}>{conf.label}</Tag>
|
||||
{row.review_reason && (
|
||||
<Typography.Text type="danger" style={{ display: 'block', fontSize: 11 }}>
|
||||
<Typography.Text type="danger" style={{ display: 'block', fontSize: 11, marginTop: 2 }}>
|
||||
{row.review_reason}
|
||||
</Typography.Text>
|
||||
)}
|
||||
@@ -621,7 +643,7 @@ export default function Orders({ kind }: { kind: 'all' | 'sold' | 'receive' }) {
|
||||
{
|
||||
title: '货架状态',
|
||||
dataIndex: 'status',
|
||||
width: 110,
|
||||
width: 120,
|
||||
render: (v: string) => {
|
||||
const conf = LISTING_STATUS_LABELS[v] || { label: v, color: 'default' }
|
||||
return <Tag color={conf.color}>{conf.label}</Tag>
|
||||
@@ -631,17 +653,23 @@ export default function Orders({ kind }: { kind: 'all' | 'sold' | 'receive' }) {
|
||||
title: '上传时间',
|
||||
dataIndex: 'created_at',
|
||||
width: 160,
|
||||
render: (v: string) => <span style={{ fontSize: 12, color: '#666' }}>{v}</span>,
|
||||
render: (v: string) => (
|
||||
<span style={{ fontSize: 12, color: '#666', whiteSpace: 'nowrap' }}>
|
||||
{v ? new Date(v).toLocaleString('zh-CN', { hour12: false }) : '-'}
|
||||
</span>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: 110,
|
||||
width: 90,
|
||||
fixed: 'right' as const,
|
||||
render: (_: unknown, row: ReceivedListing) => (
|
||||
<Button
|
||||
type="link"
|
||||
size="small"
|
||||
danger={row.status !== 'offline'}
|
||||
icon={row.status === 'offline' ? <CheckCircleOutlined /> : <StopOutlined />}
|
||||
style={{ padding: 0 }}
|
||||
onClick={() => void handleToggleListingStatus(row)}
|
||||
>
|
||||
{row.status === 'offline' ? '上架' : '下架'}
|
||||
|
||||
Reference in New Issue
Block a user