diff --git a/distribution-admin/src/pages/Accounts.tsx b/distribution-admin/src/pages/Accounts.tsx index cc7aa59..da05caf 100644 --- a/distribution-admin/src/pages/Accounts.tsx +++ b/distribution-admin/src/pages/Accounts.tsx @@ -70,6 +70,17 @@ const TX_OPTIONS = [ { label: '出租中 (租赁履约)', value: 'rented' }, ] +const MAIN_LISTING_STATUS_MAP: Record = { + 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' }, +} + function formatGameName(name?: string) { if (!name) return '默认游戏' const lower = name.toLowerCase().trim() @@ -431,7 +442,7 @@ export default function Accounts() { const kw = keyword.trim().toLowerCase() const matchTitle = item.title && item.title.toLowerCase().includes(kw) const matchNo = item.listing_no && item.listing_no.toLowerCase().includes(kw) - const matchGame = item.game_name && item.game_name.toLowerCase().includes(kw) + const matchGame = (item.game_name && item.game_name.toLowerCase().includes(kw)) || formatGameName(item.game_name).includes(kw) const matchRegion = item.server_region && item.server_region.toLowerCase().includes(kw) const matchPlatform = item.login_platform && item.login_platform.toLowerCase().includes(kw) const matchId = String(item.account_id).includes(kw) || String(item.listing_id).includes(kw) @@ -675,6 +686,7 @@ export default function Accounts() { rowKey="id" loading={loading} dataSource={filteredItems} + scroll={{ x: 1200 }} locale={{ emptyText: ( ( - - - {v || `#${row.listing_id}`} - - {row.in_transaction ? ( - - 出租中 - - ) : ( - - 在售空闲 - - )} - +
+
+ + {v || `#${row.listing_id}`} + +
+
+ {row.in_transaction ? ( + + 出租中 + + ) : ( + + 在售空闲 + + )} +
+
), }, { @@ -761,28 +788,32 @@ export default function Accounts() { { title: '账号信息', dataIndex: 'title', - minWidth: 240, + width: 260, render: (_: unknown, row: AccountDisplay) => (
- + {row.title || `账号 #${row.account_id}`} - + {formatGameName(row.game_name)} {row.server_region && {row.server_region}} - {row.login_platform && {row.login_platform}} + {row.login_platform && {row.login_platform}}
), }, { title: '段位 / 资产', - width: 140, + width: 130, render: (_: unknown, row: AccountDisplay) => (
{row.rank_level ? {row.rank_level} : '-'}
{row.haf_coin_amount !== undefined && row.haf_coin_amount > 0 && ( - + 哈夫币: {row.haf_coin_amount.toLocaleString()} )} @@ -791,21 +822,21 @@ export default function Accounts() { }, { title: '租金 / 押金', - width: 170, + width: 150, render: (_: unknown, row: AccountDisplay) => { const finalPrice = row.site_price_cent || row.price_cent const hasMarkup = row.shelf_ratio_delta && row.shelf_ratio_delta > 0 return (
- + {formatMoney(finalPrice)} -
+
押金: {formatMoney(row.deposit_amount_cent)}
{hasMarkup && ( -
- 含提价溢价: +{formatMoney(row.markup_amount_cent)} +
+ 含加价: +{formatMoney(row.markup_amount_cent)}
)}
@@ -815,7 +846,7 @@ export default function Accounts() { { title: '加价比例', dataIndex: 'shelf_ratio_delta', - width: 120, + width: 110, render: (v: number | undefined) => { if (v && v > 0) { return ( @@ -830,12 +861,11 @@ export default function Accounts() { { title: '主站状态', dataIndex: 'listing_status', - width: 100, - render: (v: string | undefined) => ( - - {v === 'published' ? '主站在售' : v || '未知'} - - ), + width: 110, + render: (v: string | undefined) => { + const conf = MAIN_LISTING_STATUS_MAP[v || ''] || { label: v || '未知', color: 'default' } + return {conf.label} + }, }, { title: '分销展示', @@ -849,13 +879,15 @@ export default function Accounts() { }, { title: '操作', - width: 140, + width: 110, + fixed: 'right' as const, render: (_: unknown, row: AccountDisplay) => (