fix(distribution-admin): 优化分销收号管理表格列宽与中文化,补全已结单货架状态

This commit is contained in:
yml2213
2026-09-09 19:38:07 +08:00
parent b16c45ce6f
commit dd709fc12c
+46 -18
View File
@@ -80,8 +80,12 @@ const REVIEW_STATUS_LABELS: Record<string, { label: string; color: string }> = {
const LISTING_STATUS_LABELS: Record<string, { label: string; color: string }> = { const LISTING_STATUS_LABELS: Record<string, { label: string; color: string }> = {
published: { label: '上架在售', color: 'green' }, published: { label: '上架在售', color: 'green' },
rented: { label: '出租中', color: 'cyan' },
completed: { label: '已结单/售出', color: 'blue' },
offline: { label: '已下架', color: 'default' }, offline: { label: '已下架', color: 'default' },
closed: { label: '已关闭', color: 'error' }, closed: { label: '已关闭', color: 'error' },
abnormal: { label: '异常冻结', color: 'error' },
sealed: { label: '已封存', color: 'magenta' },
draft: { label: '草稿', color: 'warning' }, draft: { label: '草稿', color: 'warning' },
} }
@@ -537,6 +541,7 @@ export default function Orders({ kind }: { kind: 'all' | 'sold' | 'receive' }) {
rowKey="listing_id" rowKey="listing_id"
loading={recvLoading} loading={recvLoading}
dataSource={receivedListings} dataSource={receivedListings}
scroll={{ x: 1200 }}
pagination={{ pagination={{
current: recvPage, current: recvPage,
pageSize, pageSize,
@@ -548,26 +553,43 @@ export default function Orders({ kind }: { kind: 'all' | 'sold' | 'receive' }) {
{ {
title: '商品编号', title: '商品编号',
dataIndex: 'listing_no', dataIndex: 'listing_no',
width: 140, width: 170,
render: (v: string) => ( render: (v: string) => (
<Typography.Text strong copyable> <div style={{ whiteSpace: 'nowrap' }}>
{v} <Typography.Text
</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: '账号标题与游戏', title: '账号标题与游戏',
dataIndex: 'title', dataIndex: 'title',
minWidth: 220, width: 260,
render: (_: unknown, row: ReceivedListing) => ( render: (_: unknown, row: ReceivedListing) => (
<div> <div>
<Typography.Text strong style={{ display: 'block' }}> <Typography.Text
strong
style={{ fontSize: 14, lineHeight: '20px', display: 'block' }}
ellipsis={{ tooltip: row.title }}
>
{row.title || '无标题'} {row.title || '无标题'}
</Typography.Text> </Typography.Text>
<Space size={4} style={{ marginTop: 4 }}> <Space size={4} style={{ marginTop: 4 }} wrap>
<Tag color="blue">{formatGameName(row.game_name)}</Tag> <Tag color="blue">{formatGameName(row.game_name)}</Tag>
{row.server_region && <Tag>{row.server_region}</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>} {row.rank_level && <Tag color="purple">{row.rank_level}</Tag>}
</Space> </Space>
</div> </div>
@@ -576,12 +598,12 @@ export default function Orders({ kind }: { kind: 'all' | 'sold' | 'receive' }) {
{ {
title: '上传卖家', title: '上传卖家',
dataIndex: 'owner_phone', dataIndex: 'owner_phone',
width: 150, width: 140,
render: (_: unknown, row: ReceivedListing) => ( render: (_: unknown, row: ReceivedListing) => (
<div> <div>
<div>{row.owner_nickname || '匿名卖家'}</div> <div style={{ fontWeight: 500, whiteSpace: 'nowrap' }}>{row.owner_nickname || '匿名卖家'}</div>
<Typography.Text type="secondary" style={{ fontSize: 12 }}> <Typography.Text type="secondary" style={{ fontSize: 12, whiteSpace: 'nowrap' }}>
{row.owner_phone || '-'} {maskPhone(row.owner_phone)}
</Typography.Text> </Typography.Text>
</div> </div>
), ),
@@ -591,10 +613,10 @@ export default function Orders({ kind }: { kind: 'all' | 'sold' | 'receive' }) {
width: 140, width: 140,
render: (_: unknown, row: ReceivedListing) => ( render: (_: unknown, row: ReceivedListing) => (
<div> <div>
<Typography.Text strong style={{ color: '#cf1322' }}> <Typography.Text strong style={{ color: '#cf1322', fontSize: 15, whiteSpace: 'nowrap', display: 'block' }}>
{formatMoney(row.price_cent)} {formatMoney(row.price_cent)}
</Typography.Text> </Typography.Text>
<div style={{ fontSize: 12, color: '#888' }}> <div style={{ fontSize: 12, color: '#888', whiteSpace: 'nowrap', marginTop: 2 }}>
押金: {formatMoney(row.deposit_amount_cent)} 押金: {formatMoney(row.deposit_amount_cent)}
</div> </div>
</div> </div>
@@ -610,7 +632,7 @@ export default function Orders({ kind }: { kind: 'all' | 'sold' | 'receive' }) {
<div> <div>
<Tag color={conf.color}>{conf.label}</Tag> <Tag color={conf.color}>{conf.label}</Tag>
{row.review_reason && ( {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} {row.review_reason}
</Typography.Text> </Typography.Text>
)} )}
@@ -621,7 +643,7 @@ export default function Orders({ kind }: { kind: 'all' | 'sold' | 'receive' }) {
{ {
title: '货架状态', title: '货架状态',
dataIndex: 'status', dataIndex: 'status',
width: 110, width: 120,
render: (v: string) => { render: (v: string) => {
const conf = LISTING_STATUS_LABELS[v] || { label: v, color: 'default' } const conf = LISTING_STATUS_LABELS[v] || { label: v, color: 'default' }
return <Tag color={conf.color}>{conf.label}</Tag> return <Tag color={conf.color}>{conf.label}</Tag>
@@ -631,17 +653,23 @@ export default function Orders({ kind }: { kind: 'all' | 'sold' | 'receive' }) {
title: '上传时间', title: '上传时间',
dataIndex: 'created_at', dataIndex: 'created_at',
width: 160, 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: '操作', title: '操作',
width: 110, width: 90,
fixed: 'right' as const,
render: (_: unknown, row: ReceivedListing) => ( render: (_: unknown, row: ReceivedListing) => (
<Button <Button
type="link" type="link"
size="small" size="small"
danger={row.status !== 'offline'} danger={row.status !== 'offline'}
icon={row.status === 'offline' ? <CheckCircleOutlined /> : <StopOutlined />} icon={row.status === 'offline' ? <CheckCircleOutlined /> : <StopOutlined />}
style={{ padding: 0 }}
onClick={() => void handleToggleListingStatus(row)} onClick={() => void handleToggleListingStatus(row)}
> >
{row.status === 'offline' ? '上架' : '下架'} {row.status === 'offline' ? '上架' : '下架'}