From d2b3305ca6e5e7bd29b1994b4497285473e7c6aa Mon Sep 17 00:00:00 2001 From: lanyuanxiaoyao Date: Tue, 16 Sep 2025 18:40:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BB=B7=E6=A0=BC?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- leopard-web/src/pages/stock/StockDetail.tsx | 49 ++++++++++----------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/leopard-web/src/pages/stock/StockDetail.tsx b/leopard-web/src/pages/stock/StockDetail.tsx index a776e3f..1237d7c 100644 --- a/leopard-web/src/pages/stock/StockDetail.tsx +++ b/leopard-web/src/pages/stock/StockDetail.tsx @@ -3,6 +3,7 @@ import {useParams} from 'react-router' import {amisRender, commonInfo, readOnlyDialogOptions, remoteMappings} from '../../util/amis.tsx' import type {Schema} from 'amis' import {isNil} from 'es-toolkit' +import {toNumber} from 'es-toolkit/compat' const formatFinanceNumber = (value: number): string => { if (isNil(value)) { @@ -433,30 +434,28 @@ function StockDetail() { padding: 12, formatter: function (params: any) { const param = params[0] - const open = param.data[0] - const close = param.data[1] - const lowest = param.data[2] - const highest = param.data[3] + const open = toNumber(param.data[1]).toFixed(2) + const close = toNumber(param.data[2]).toFixed(2) + const lowest = toNumber(param.data[3]).toFixed(2) + const highest = toNumber(param.data[4]).toFixed(2) - return [ - `
${param.name}
`, - `
`, - `开盘:`, - `${open}`, - `
`, - `
`, - `收盘:`, - `${close}`, - `
`, - `
`, - `最低:`, - `${lowest}`, - `
`, - `
`, - `最高:`, - `${highest}`, - `
`, - ].join('') + return `
${param.name}
+
+ 开盘: + ${open} +
+
+ 收盘: + ${close} +
+
+ 最低: + ${lowest} +
+
+ 最高: + ${highest} +
` }, }, grid: { @@ -495,7 +494,7 @@ function StockDetail() { color: '#666', fontWeight: 'bold', formatter: function (value: number) { - return value.toFixed(0) + return value.toFixed(2) }, }, splitLine: { @@ -538,7 +537,7 @@ function StockDetail() { ], }, }, - "12月线数据" + "12月线数据", ], }, ],