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

This commit is contained in:
zhanjunhao
2026-11-20 10:18:17 +08:00
parent 04cc45bbb7
commit 605cff1d58
65 changed files with 507 additions and 274 deletions
@@ -45,6 +45,11 @@ import { CHANNEL_OPTIONS } from '../../../constants';
import { IconTreeTriangleDown } from '@/components/ui/icons';
import { ShuffleBrandIcon } from '../../common/icons/BrandIcons';
const formatDisplayPercent = (value, digits = 0) => {
const number = Number(value);
return Number.isFinite(number) ? `${number.toFixed(digits)}%` : '-';
};
function ChannelStatusSwitch({ record, manageChannel, t }) {
const [loading, setLoading] = useState(false);
return (
@@ -311,7 +316,7 @@ const renderDailyQuota = (record, dailyQuotaInfo, t) => {
{t('已使用')}: {formatQuotaCount(info.daily_quota)}
</div>
<div>
{t('使用率')}: {percent}%
{t('使用率')}: {formatDisplayPercent(percent)}
</div>
{isExceeded && (
<div style={{ color: 'var(--ui-color-danger)' }}>
@@ -327,7 +332,7 @@ const renderDailyQuota = (record, dailyQuotaInfo, t) => {
strokeColor={strokeColor}
size='small'
showInfo
format={(percent) => `${percent}%`}
format={(percent) => formatDisplayPercent(percent)}
/>
</div>
</Tooltip>