From 3bac042c45171166c571f3f419c8ea4d23b5a460 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=A2=A6=E8=BF=9C?= <1063331231@qq.com> Date: Sun, 6 Jul 2025 22:42:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A8=E5=8D=95=E6=8F=90=E4=BA=A4=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E5=A1=AB=E5=86=99......?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/formula/FormulaConfig.vue | 3 +++ src/components/formula/RunFormulaConfig.vue | 3 +++ src/components/formula/SettingFormulaConfig.vue | 3 +++ 3 files changed, 9 insertions(+) diff --git a/src/components/formula/FormulaConfig.vue b/src/components/formula/FormulaConfig.vue index bd8092d..778acc5 100644 --- a/src/components/formula/FormulaConfig.vue +++ b/src/components/formula/FormulaConfig.vue @@ -195,6 +195,9 @@ const validatePass = (rule: any, value: any, callback: any, config: Formula.Form if (!value && value !== 0 && value !== '0') { callback(new Error('此为必填项')) } + else if (value !== '.' && value.split('.').length > 2) { + callback(new Error('输入数值项')) + } else if (config.val_type === 'int' || config.val_type === 'float') { const temp = Number(value) if (temp < config.val_lower_limit || temp > config.val_upper_limit) { diff --git a/src/components/formula/RunFormulaConfig.vue b/src/components/formula/RunFormulaConfig.vue index a077b97..2cbc129 100644 --- a/src/components/formula/RunFormulaConfig.vue +++ b/src/components/formula/RunFormulaConfig.vue @@ -47,6 +47,9 @@ const validatePass = (rule: any, value: any, callback: any, config: Formula.Form if (!value && value !== 0 && value !== '0') { callback(new Error('此为必填项')) } + else if (value.split('.').length > 2) { + callback(new Error('输入数值项')) + } else if (config.val_type === 'int' || config.val_type === 'float') { const temp = Number(value) if (temp < config.val_lower_limit || temp > config.val_upper_limit) { diff --git a/src/components/formula/SettingFormulaConfig.vue b/src/components/formula/SettingFormulaConfig.vue index 454f373..60d33fe 100644 --- a/src/components/formula/SettingFormulaConfig.vue +++ b/src/components/formula/SettingFormulaConfig.vue @@ -67,6 +67,9 @@ const validatePass = (rule: any, value: any, callback: any, config: Formula.Form if (!value && value !== 0 && value !== '0') { callback(new Error('此为必填项')) } + else if (value.split('.').length > 2) { + callback(new Error('输入数值项')) + } else if (config.val_type === 'int' || config.val_type === 'float') { const temp = Number(value) if (temp < config.val_lower_limit || temp > config.val_upper_limit) {