fix(admin-web): 修复固定账户明细显示错误
问题:点击某账户卡片时显示其他账户的明细 原因:前端硬编码了 accountSequence 与字段名的对应关系,与后端映射不一致 修复:从后端返回数据中读取真实的 accountSequence,而不是硬编码 - accounts 数组现在从 data.xxx.accountSequence 动态获取序列号 - 更新类型定义注释,说明序列号由后端分配 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
eb40b658f6
commit
1354055f09
|
|
@ -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<string | null>(null);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue