From 1354055f09450a96c6e109fcf445ecc00b24cc23 Mon Sep 17 00:00:00 2001 From: hailin Date: Tue, 6 Jan 2026 23:24:09 -0800 Subject: [PATCH] =?UTF-8?q?fix(admin-web):=20=E4=BF=AE=E5=A4=8D=E5=9B=BA?= =?UTF-8?q?=E5=AE=9A=E8=B4=A6=E6=88=B7=E6=98=8E=E7=BB=86=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 问题:点击某账户卡片时显示其他账户的明细 原因:前端硬编码了 accountSequence 与字段名的对应关系,与后端映射不一致 修复:从后端返回数据中读取真实的 accountSequence,而不是硬编码 - accounts 数组现在从 data.xxx.accountSequence 动态获取序列号 - 更新类型定义注释,说明序列号由后端分配 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../SystemAccountsTab.tsx | 18 +++++++++++------- .../src/types/system-account.types.ts | 8 +++++--- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/frontend/admin-web/src/components/features/system-account-report/SystemAccountsTab.tsx b/frontend/admin-web/src/components/features/system-account-report/SystemAccountsTab.tsx index 43e9b4eb..980491f3 100644 --- a/frontend/admin-web/src/components/features/system-account-report/SystemAccountsTab.tsx +++ b/frontend/admin-web/src/components/features/system-account-report/SystemAccountsTab.tsx @@ -299,14 +299,18 @@ export default function SystemAccountsTab() { * [2026-01-07] 更新:添加查看分类账明细按钮,在卡片下方公共区域显示明细 */ function FixedAccountsSection({ data }: { data: SystemAccountReportResponse['fixedAccounts'] }) { - // [2026-01-07] 更新:使用 SYSTEM_ACCOUNT_NAMES 映射获取正式名称 + // [2026-01-07] 修复:从后端返回数据中读取真实的 accountSequence,而不是硬编码 + // 后端映射:S0000000001=HQ_COMMUNITY, S0000000002=COST_ACCOUNT, S0000000003=OPERATION_ACCOUNT const accounts = [ - { key: 'costAccount', sequence: 'S0000000001', data: data.costAccount }, - { key: 'operationAccount', sequence: 'S0000000002', data: data.operationAccount }, - { key: 'hqCommunity', sequence: 'S0000000003', data: data.hqCommunity }, - { key: 'rwadPoolPending', sequence: 'S0000000004', data: data.rwadPoolPending }, - { key: 'platformFee', sequence: 'S0000000005', data: data.platformFee }, - ]; + { key: 'costAccount', data: data.costAccount }, + { key: 'operationAccount', data: data.operationAccount }, + { key: 'hqCommunity', data: data.hqCommunity }, + { key: 'rwadPoolPending', data: data.rwadPoolPending }, + { key: 'platformFee', data: data.platformFee }, + ].map(item => ({ + ...item, + sequence: item.data?.accountSequence || '', + })); // [2026-01-07] 新增:选中账户和分类账数据 const [selectedAccount, setSelectedAccount] = useState(null); diff --git a/frontend/admin-web/src/types/system-account.types.ts b/frontend/admin-web/src/types/system-account.types.ts index 5c30ee68..56fb90a6 100644 --- a/frontend/admin-web/src/types/system-account.types.ts +++ b/frontend/admin-web/src/types/system-account.types.ts @@ -127,11 +127,13 @@ export interface ExpiredRewardsEntriesResponse { /** * 固定系统账户 + * 注意:账户序列号由后端 wallet-service 的 fixedAccountTypes 映射决定 + * 当前后端映射:S0000000001=HQ_COMMUNITY, S0000000002=COST_ACCOUNT, S0000000003=OPERATION_ACCOUNT */ export interface FixedAccounts { - costAccount: SystemAccountWithBalance | null; // 成本账户 S0000000001 - operationAccount: SystemAccountWithBalance | null; // 运营账户 S0000000002 - hqCommunity: SystemAccountWithBalance | null; // 总部社区 S0000000003 + costAccount: SystemAccountWithBalance | null; // 成本账户 (由后端分配序列号) + operationAccount: SystemAccountWithBalance | null; // 运营账户 (由后端分配序列号) + hqCommunity: SystemAccountWithBalance | null; // 总部社区 (由后端分配序列号) rwadPoolPending: SystemAccountWithBalance | null; // RWAD待发放池 S0000000004 platformFee: SystemAccountWithBalance | null; // 平台手续费 S0000000005 }