fix(过滤器): 数字区间只能输入整数

This commit is contained in:
fit2cloud-chenyw 2023-03-10 10:32:20 +08:00
parent 6f7e9bf3e9
commit a5badc71d1
4 changed files with 4 additions and 4 deletions

View File

@ -198,7 +198,7 @@ export default {
validateCom(rule, value, callback) { validateCom(rule, value, callback) {
if (!value) return callback() if (!value) return callback()
const one = Number(value) const one = Number(value)
if (Number.isInteger(one)) { if (!Number.isNaN(one)) {
if (one < MIN_NUMBER) { if (one < MIN_NUMBER) {
return callback(new Error(this.$t('denumberrange.out_of_min'))) return callback(new Error(this.$t('denumberrange.out_of_min')))
} else if (one > MAX_NUMBER) { } else if (one > MAX_NUMBER) {

View File

@ -2548,7 +2548,7 @@ export default {
please_key_max: 'Please key max value', please_key_max: 'Please key max value',
out_of_min: 'The min value cannot be less than the min integer -2³²', out_of_min: 'The min value cannot be less than the min integer -2³²',
out_of_max: 'The max value cannot be more than the max integer 2³²-1', out_of_max: 'The max value cannot be more than the max integer 2³²-1',
must_int: 'Please key integer', must_int: 'Please key number',
min_out_max: 'The min value must be less than the max value', min_out_max: 'The min value must be less than the max value',
max_out_min: 'The max value must be more than the min value' max_out_min: 'The max value must be more than the min value'
}, },

View File

@ -2542,7 +2542,7 @@ export default {
please_key_max: '請輸入最大值', please_key_max: '請輸入最大值',
out_of_min: '最小值不能小於最小整數-2³²', out_of_min: '最小值不能小於最小整數-2³²',
out_of_max: '最大值不能大於最大整數2³²-1', out_of_max: '最大值不能大於最大整數2³²-1',
must_int: '請輸入數', must_int: '請輸入',
min_out_max: '最小值必須小於最大值', min_out_max: '最小值必須小於最大值',
max_out_min: '最大值必須大於最小值' max_out_min: '最大值必須大於最小值'
}, },

View File

@ -2542,7 +2542,7 @@ export default {
please_key_max: '请输入最大值', please_key_max: '请输入最大值',
out_of_min: '最小值不能小于最小整数-2³²', out_of_min: '最小值不能小于最小整数-2³²',
out_of_max: '最大值不能大于最大整数2³²-1', out_of_max: '最大值不能大于最大整数2³²-1',
must_int: '请输入数', must_int: '请输入',
min_out_max: '最小值必须小于最大值', min_out_max: '最小值必须小于最大值',
max_out_min: '最大值必须大于最小值' max_out_min: '最大值必须大于最小值'
}, },