From 4c0d0afceb82d6c9472f1995e2e42d1aaaf26c54 Mon Sep 17 00:00:00 2001 From: WrBug Date: Sat, 14 Feb 2026 06:24:12 +0800 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20=E5=8A=A0=E5=AF=86=E5=B0=BE?= =?UTF-8?q?=E7=9B=98=E7=AD=96=E7=95=A5=E5=88=97=E8=A1=A8=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E4=B8=8E=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 编辑时按 marketSlugPrefix 取 interval,修复 15 分钟市场时间区间校验误报 - 投入方式:表格/卡片统一显示「投入方式: 比例/固定金额 + 数值」,兼容后端小写 amountMode - 比例数值用 formatNumber(..., 2) 控制小数位,固定金额沿用 formatUSDC Co-authored-by: Cursor --- frontend/src/pages/CryptoTailStrategyList.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/frontend/src/pages/CryptoTailStrategyList.tsx b/frontend/src/pages/CryptoTailStrategyList.tsx index fb99ca4..3549a8f 100644 --- a/frontend/src/pages/CryptoTailStrategyList.tsx +++ b/frontend/src/pages/CryptoTailStrategyList.tsx @@ -119,7 +119,6 @@ const CryptoTailStrategyList: React.FC = () => { accountId: record.accountId, name: record.name, marketSlugPrefix: record.marketSlugPrefix, - intervalSeconds: record.intervalSeconds, windowStartMinutes: Math.floor(record.windowStartSeconds / 60), windowStartSeconds: record.windowStartSeconds % 60, windowEndMinutes: Math.floor(record.windowEndSeconds / 60), @@ -136,7 +135,8 @@ const CryptoTailStrategyList: React.FC = () => { const handleFormSubmit = async () => { try { const v = await form.validateFields() - const interval = (editingId ? v.intervalSeconds : marketOptions.find((m) => m.slug === v.marketSlugPrefix)?.intervalSeconds) ?? 300 + // 新建与编辑均按当前选择的市场 slug 取周期,编辑时无 Form.Item 的 intervalSeconds 不会在 v 中 + const interval = marketOptions.find((m) => m.slug === v.marketSlugPrefix)?.intervalSeconds ?? 300 const windowStartSeconds = (v.windowStartMinutes ?? 0) * 60 + (v.windowStartSeconds ?? 0) const windowEndSeconds = (v.windowEndMinutes ?? 0) * 60 + (v.windowEndSeconds ?? 0) if (windowStartSeconds > windowEndSeconds) { @@ -306,8 +306,8 @@ const CryptoTailStrategyList: React.FC = () => { key: 'amountMode', width: isMobile ? 90 : 120, render: (_: unknown, r: CryptoTailStrategyDto) => - r.amountMode === 'RATIO' - ? `${t('cryptoTailStrategy.list.ratio')} ${r.amountValue}%` + (r.amountMode?.toUpperCase() ?? '') === 'RATIO' + ? `${t('cryptoTailStrategy.list.ratio')} ${formatNumber(r.amountValue, 2) || '0'}%` : `${t('cryptoTailStrategy.list.fixed')} ${formatUSDC(r.amountValue)} USDC` }, { @@ -446,7 +446,10 @@ const CryptoTailStrategyList: React.FC = () => { {t('cryptoTailStrategy.list.priceRange')}: {formatPriceRange(item.minPrice, item.maxPrice)}
- {item.amountMode === 'RATIO' ? `${item.amountValue}%` : `${formatUSDC(item.amountValue)} USDC`} + {t('cryptoTailStrategy.list.amountMode')}:{' '} + {(item.amountMode?.toUpperCase() ?? '') === 'RATIO' + ? `${t('cryptoTailStrategy.list.ratio')} ${formatNumber(item.amountValue, 2) || '0'}%` + : `${t('cryptoTailStrategy.list.fixed')} ${formatUSDC(item.amountValue)} USDC`}
{t('cryptoTailStrategy.list.totalRealizedPnl')}:{' '}