fix(*): 全量 UI 审查与 undefined 展示异常修复
This commit is contained in:
@@ -16,7 +16,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import { formatIdReference } from '../../helpers/safeDisplay';
|
||||
import {
|
||||
formatCurrency,
|
||||
formatIdReference,
|
||||
formatPercent,
|
||||
toFiniteNumber,
|
||||
} from '../../helpers/safeDisplay';
|
||||
|
||||
import React, {
|
||||
useCallback,
|
||||
@@ -89,7 +94,8 @@ const { Title, Text } = Typography;
|
||||
const emptyState = (description) => (
|
||||
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description={description} />
|
||||
);
|
||||
const money = (value) => `¥${(Number(value || 0) / 1e6).toFixed(2)}`;
|
||||
const money = (value) =>
|
||||
formatCurrency((toFiniteNumber(value) ?? 0) / 1e6, '¥', 2, '¥0.00');
|
||||
const protectionUntil = (row) =>
|
||||
Number(row.extended_until || row.protected_until || 0);
|
||||
const date = (value) =>
|
||||
@@ -222,7 +228,7 @@ function TierSummary({ items }) {
|
||||
{
|
||||
title: t('比例'),
|
||||
dataIndex: 'rate_bps',
|
||||
render: (value) => `${Number(value || 0) / 100}%`,
|
||||
render: (value) => formatPercent(Number(value || 0) / 100, 2),
|
||||
},
|
||||
{ title: t('调用笔数'), dataIndex: 'count' },
|
||||
{ title: t('有效销售额'), dataIndex: 'sales', render: money },
|
||||
@@ -1076,7 +1082,7 @@ function AdminPage() {
|
||||
? t('企业组织')
|
||||
: t('个人用户'))
|
||||
}
|
||||
reference={`${commissionLabel(t, 'subjectType', row.subject_type)} #${row.subject_id}`}
|
||||
reference={`${commissionLabel(t, 'subjectType', row.subject_type)} ${formatIdReference(row.subject_id)}`}
|
||||
/>
|
||||
),
|
||||
},
|
||||
@@ -1282,7 +1288,7 @@ function AdminPage() {
|
||||
{
|
||||
title: t('比例'),
|
||||
dataIndex: 'rate_bps',
|
||||
render: (v) => `${(Number(v || 0) / 100).toFixed(2)}%`,
|
||||
render: (v) => formatPercent(Number(v) / 100, 2),
|
||||
},
|
||||
{
|
||||
title: t('生效时间'),
|
||||
|
||||
Reference in New Issue
Block a user