From 02fa87f6c8a117b8998ed8cb32822733a37432f9 Mon Sep 17 00:00:00 2001 From: hailin Date: Wed, 7 Jan 2026 05:41:58 -0800 Subject: [PATCH] =?UTF-8?q?fix(admin-web):=20=E8=BF=87=E6=BB=A4=E6=8E=89?= =?UTF-8?q?=E4=B8=8D=E5=AD=98=E5=9C=A8=E7=9A=84=E5=9B=BA=E5=AE=9A=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E8=B4=A6=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加 filter 过滤掉 data 为 null 的账户 - 修复空白卡片显示问题(账户数据不存在时不显示卡片) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../system-account-report/SystemAccountsTab.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 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 344e3b55..8244e3a0 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 @@ -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(null);