From 4098f8f50f824581609e6070c61077bbccfc270a Mon Sep 17 00:00:00 2001 From: yml2213 Date: Wed, 9 Sep 2026 19:40:31 +0800 Subject: [PATCH] =?UTF-8?q?fix(distribution-admin):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=95=86=E5=93=81=E4=B8=8E=E8=B4=A6=E5=8F=B7=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E8=A1=A8=E6=A0=BC=E5=88=97=E5=AE=BD=E3=80=81?= =?UTF-8?q?=E4=B8=AD=E6=96=87=E5=8C=96=E5=8F=8A=E9=98=B2=E6=8D=A2=E8=A1=8C?= =?UTF-8?q?=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- distribution-admin/src/pages/Accounts.tsx | 105 ++++++++++++++-------- 1 file changed, 69 insertions(+), 36 deletions(-) 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) => (