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) {