fix(ui): 修复登录和并发请求并统一页面展示
调整登录流程和请求处理,统一各中心的表格交互、主题样式和页面展示。
This commit is contained in:
@@ -16,6 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import { formatPercent } from '../../../helpers/safeDisplay';
|
||||
import { RefreshCw as ActionRefreshCw } from '@/components/common/icons/ActionIcons';
|
||||
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
@@ -93,11 +94,16 @@ const DeltaBadge = ({ cur, prev, t }) => {
|
||||
if (!prev || prev <= 0) {
|
||||
return <small>{t('无上期对比')}</small>;
|
||||
}
|
||||
const pct = ((cur - prev) / prev) * 100;
|
||||
const up = pct >= 0;
|
||||
const pct = Number.isFinite(Number(cur))
|
||||
? ((Number(cur) - Number(prev)) / Number(prev)) * 100
|
||||
: null;
|
||||
const up = pct !== null && pct >= 0;
|
||||
return (
|
||||
<small className={up ? 'is-up' : 'is-down'}>
|
||||
{up ? '↑' : '↓'} {Math.abs(pct).toFixed(1)}%<em>{t('较上期')}</em>
|
||||
{pct === null
|
||||
? '-'
|
||||
: `${up ? '↑' : '↓'} ${formatPercent(Math.abs(pct), 1)}`}
|
||||
<em>{t('较上期')}</em>
|
||||
</small>
|
||||
);
|
||||
};
|
||||
@@ -432,12 +438,14 @@ const OrgAnalyticsPanel = ({
|
||||
width: 300,
|
||||
render: (_, r) => {
|
||||
const pct =
|
||||
breakdownTotal > 0 ? ((r.quota || 0) / breakdownTotal) * 100 : 0;
|
||||
breakdownTotal > 0
|
||||
? ((Number(r.quota) || 0) / breakdownTotal) * 100
|
||||
: null;
|
||||
return (
|
||||
<div className='oc-ea-cost-share'>
|
||||
<div>
|
||||
<strong>{renderQuota(r.quota || 0, 2)}</strong>
|
||||
<span>{pct.toFixed(1)}%</span>
|
||||
<span>{formatPercent(pct, 1)}</span>
|
||||
</div>
|
||||
<Progress
|
||||
percent={Math.round(pct)}
|
||||
|
||||
Reference in New Issue
Block a user