fix(*): 全量 UI 审查与 undefined 展示异常修复

分析模块:补齐看板、排行、趋势及报表数值兜底
企业与用户中心:修复统计、成员、技能及资金字段展示
充值与交易:修复充值、发票、订单、订阅及支付字段拼接
平台页面:修复渠道、模型、服务监控与状态空值展示
通用能力:新增安全展示工具,补齐九语言文案与回归测试
文档记录:更新修复范围、影响及回滚说明
This commit is contained in:
zhanjunhao
2026-11-20 10:18:17 +08:00
parent 74ca103334
commit c492e2b7c0
65 changed files with 507 additions and 274 deletions
+13 -6
View File
@@ -49,12 +49,16 @@ import {
} from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { API, copy, showError, showSuccess } from '../../helpers';
import {
formatNumber,
formatPercent,
toFiniteNumber,
} from '../../helpers/safeDisplay';
const { Text, Title } = Typography;
const fmtDate = (ts) => (ts ? new Date(ts * 1000).toLocaleDateString() : '-');
const fmtYuan = (v) =>
v === undefined || v === null ? '-' : Number(v).toFixed(2);
const fmtYuan = (v) => formatNumber(v, 2, '-');
const LEAD_STATUS = {
pending: ['orange', '待审核'],
@@ -845,12 +849,15 @@ function Bills({ t, readOnly }) {
{ title: t('毛利(元)'), dataIndex: 'gross_profit_yuan', render: fmtYuan },
{
title: t('返佣(元)'),
render: (r) => fmtYuan((r.l1_yuan || 0) + (r.l2_yuan || 0)),
render: (r) =>
fmtYuan(
(toFiniteNumber(r.l1_yuan) ?? 0) + (toFiniteNumber(r.l2_yuan) ?? 0),
),
},
{
title: t('应发(元)'),
dataIndex: 'payable_yuan',
render: (v) => Number(v ?? 0).toFixed(2),
render: (v) => formatNumber(v, 2, '0.00'),
},
{
title: '',
@@ -965,7 +972,7 @@ function Bills({ t, readOnly }) {
data={[
{
key: t('定档'),
value: `${t('第 {{tier}} 档', { tier: detail.bill.tier })} · ${(detail.bill.tier_rate * 100).toFixed(0)}%`,
value: `${t('第 {{tier}} 档', { tier: detail.bill.tier })} · ${formatPercent(Number(detail.bill.tier_rate) * 100, 0)}`,
},
{ key: t('一层(元)'), value: fmtYuan(detail.bill.l1_yuan) },
{ key: t('二层(元)'), value: fmtYuan(detail.bill.l2_yuan) },
@@ -980,7 +987,7 @@ function Bills({ t, readOnly }) {
},
{
key: t('应发(元)'),
value: Number(detail.bill.payable_yuan ?? 0).toFixed(2),
value: formatNumber(detail.bill.payable_yuan, 2, '0.00'),
},
]}
/>