fix(admin-web): 修复区域账户显示省市名称
- getAccountDisplayName 支持6位区域代码(如 330100) - 330100 → 浙江01市 (330100) - 440600 → 广东06市 (440600) - RegionAccountsSection 使用 regionCode 解析名称,不依赖后端 regionName 🤖 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
2a1d6a6bcc
commit
e01c7efc3c
|
|
@ -383,8 +383,8 @@ function RegionAccountsSection({ data, type }: { data: RegionAccountsSummary; ty
|
|||
<tbody>
|
||||
{data.accounts.map((account) => (
|
||||
<tr key={account.id}>
|
||||
{/* [2026-01-07] 更新:合并显示区域名称和编码 */}
|
||||
<td>{account.regionName ? `${account.regionName} (${account.regionCode})` : account.regionCode || '-'}</td>
|
||||
{/* [2026-01-07] 更新:使用 getAccountDisplayName 解析区域代码为省市名称 */}
|
||||
<td>{account.regionCode ? getAccountDisplayName(account.regionCode) : '-'}</td>
|
||||
<td>{formatAmount(account.usdtBalance)}</td>
|
||||
<td>{formatAmount(account.totalReceived)}</td>
|
||||
<td>
|
||||
|
|
|
|||
|
|
@ -479,7 +479,25 @@ export function getAccountDisplayName(accountSequence: string): string {
|
|||
if (SYSTEM_ACCOUNT_NAMES[accountSequence]) {
|
||||
return `${SYSTEM_ACCOUNT_NAMES[accountSequence]} (${accountSequence})`;
|
||||
}
|
||||
// 检查是否是7位数字的区域账户
|
||||
// 检查是否是6位数字的区域代码(如 330100)
|
||||
if (/^\d{6}$/.test(accountSequence)) {
|
||||
const provinceCode = accountSequence.substring(0, 2);
|
||||
const cityPart = accountSequence.substring(2, 4);
|
||||
const provinceName = PROVINCE_CODE_NAMES[provinceCode];
|
||||
|
||||
if (provinceName) {
|
||||
// 判断是省级还是市级
|
||||
if (cityPart === '00') {
|
||||
// 省级
|
||||
return `${provinceName} (${accountSequence})`;
|
||||
} else {
|
||||
// 市级 - 显示省份简称 + 市级代码
|
||||
const shortProvinceName = provinceName.replace(/省|市|自治区|特别行政区|壮族|回族|维吾尔/g, '');
|
||||
return `${shortProvinceName}${cityPart}市 (${accountSequence})`;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 检查是否是7位数字的区域账户序列号
|
||||
if (/^\d{7}$/.test(accountSequence)) {
|
||||
const provinceCode = accountSequence.substring(0, 2);
|
||||
const cityPart = accountSequence.substring(2, 4);
|
||||
|
|
|
|||
Loading…
Reference in New Issue