From c97a2a9135dd63ae7dc69e8a84ed647bd11334f7 Mon Sep 17 00:00:00 2001 From: Phone Date: Tue, 17 Dec 2024 11:52:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=AD=97=E5=85=B8=E5=80=BC=E4=B8=BAtrue=E5=92=8Cfalse=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E9=80=89=E4=B8=ADselect=20value=E5=8F=98nan=E7=9A=84b?= =?UTF-8?q?ug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/dict.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/dict.ts b/src/utils/dict.ts index e6e9386d..424d627b 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -52,7 +52,9 @@ export function getDictOptions(dictType: string, valueType?: 'string' | 'number' ? `${dict.value}` : valueType === 'boolean' ? `${dict.value}` === 'true' - : Number.parseInt(`${dict.value}`), + : valueType === 'number' && !isNaN(parseFloat(`${dict.value}`)) + ? Number.parseInt(`${dict.value}`) + : dict.value, }) }) }