fix(admin-web): 过滤掉不存在的固定系统账户

- 添加 filter 过滤掉 data 为 null 的账户
- 修复空白卡片显示问题(账户数据不存在时不显示卡片)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-01-07 05:41:58 -08:00
parent 04a23a30a4
commit 02fa87f6c8
1 changed files with 7 additions and 5 deletions

View File

@ -300,7 +300,7 @@ export default function SystemAccountsTab() {
* [2026-01-07]
*/
function FixedAccountsSection({ data }: { data: SystemAccountReportResponse['fixedAccounts'] }) {
// [2026-01-07] 修复:从后端返回数据中读取真实的 accountSequence而不是硬编码
// [2026-01-07] 修复:从后端返回数据中读取真实的 accountSequence过滤掉不存在的账户
// 后端映射S0000000001=HQ_COMMUNITY, S0000000002=COST_ACCOUNT, S0000000003=OPERATION_ACCOUNT
const accounts = [
{ key: 'costAccount', data: data.costAccount },
@ -308,10 +308,12 @@ function FixedAccountsSection({ data }: { data: SystemAccountReportResponse['fix
{ key: 'hqCommunity', data: data.hqCommunity },
{ key: 'rwadPoolPending', data: data.rwadPoolPending },
{ key: 'platformFee', data: data.platformFee },
].map(item => ({
...item,
sequence: item.data?.accountSequence || '',
}));
]
.filter(item => item.data !== null && item.data !== undefined) // 过滤掉不存在的账户
.map(item => ({
...item,
sequence: item.data?.accountSequence || '',
}));
// [2026-01-07] 新增:选中账户和分类账数据
const [selectedAccount, setSelectedAccount] = useState<string | null>(null);