fix(mining-admin-web): update account type categorization to match backend

Update categorizeAccounts to use correct account types returned by backend:
- Core accounts: HEADQUARTERS, OPERATION, FEE
- Region accounts: PROVINCE, CITY

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-01-14 01:53:11 -08:00
parent fa6826dde3
commit a7a2282ba7
1 changed files with 9 additions and 9 deletions

View File

@ -25,19 +25,19 @@ export const systemAccountsApi = {
// Helper to categorize accounts for display
export function categorizeAccounts(accounts: SystemAccount[]) {
const mainPools = ['DISTRIBUTION_POOL', 'BLACK_HOLE', 'CIRCULATION_POOL'];
const systemAccounts = ['SYSTEM_OPERATION', 'SYSTEM_PROVINCE', 'SYSTEM_CITY'];
const fixedAccounts = ['COST_ACCOUNT', 'OPERATION_ACCOUNT', 'HQ_COMMUNITY', 'RWAD_POOL_PENDING'];
// 核心系统账户类型HQ、运营、手续费
const coreAccounts = ['HEADQUARTERS', 'OPERATION', 'FEE'];
// 区域账户类型(省、市)
const regionAccounts = ['PROVINCE', 'CITY'];
return {
mainPools: accounts.filter((a) => mainPools.includes(a.accountType)),
systemAccounts: accounts.filter((a) => systemAccounts.includes(a.accountType)),
fixedAccounts: accounts.filter((a) => fixedAccounts.includes(a.accountType)),
mainPools: [], // 池账户现在从 poolAccounts API 获取
systemAccounts: accounts.filter((a) => coreAccounts.includes(a.accountType)),
fixedAccounts: accounts.filter((a) => regionAccounts.includes(a.accountType)),
otherAccounts: accounts.filter(
(a) =>
!mainPools.includes(a.accountType) &&
!systemAccounts.includes(a.accountType) &&
!fixedAccounts.includes(a.accountType)
!coreAccounts.includes(a.accountType) &&
!regionAccounts.includes(a.accountType)
),
};
}