From ff3b24b50ecd9e44e5dd9b5cc263750077cc749b Mon Sep 17 00:00:00 2001 From: WrBug Date: Sat, 31 Jan 2026 20:58:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E5=9B=9E=E6=B5=8B?= =?UTF-8?q?=E4=BA=A4=E6=98=93=E8=AE=B0=E5=BD=95=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 盈亏颜色逻辑:仅盈利(>0)显示绿色,亏损(<0)显示红色,持平(=0)无颜色 - 手续费显示:确保null值显示为 $0.00 - 遵守绿涨红跌原则 --- frontend/src/pages/BacktestDetail.tsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/frontend/src/pages/BacktestDetail.tsx b/frontend/src/pages/BacktestDetail.tsx index 5026ff2..f83504b 100644 --- a/frontend/src/pages/BacktestDetail.tsx +++ b/frontend/src/pages/BacktestDetail.tsx @@ -237,18 +237,23 @@ const BacktestDetail: React.FC = () => { dataIndex: 'fee', key: 'fee', width: 120, - render: (value: string) => formatUSDC(value) + render: (value: string) => formatUSDC(value || '0') }, { title: t('backtest.profitLoss') + ' (USDC)', dataIndex: 'profitLoss', key: 'profitLoss', width: 120, - render: (value: string | null) => value ? ( - = 0 ? '#52c41a' : '#ff4d4f' }}> - {formatUSDC(value)} - - ) : '-' + render: (value: string | null) => { + if (!value) return '-' + const num = parseFloat(value) + const color = num > 0 ? '#52c41a' : num < 0 ? '#ff4d4f' : undefined + return ( + + {formatUSDC(value)} + + ) + } }, { title: t('backtest.balanceAfter') + ' (USDC)',