You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
806 B
39 lines
806 B
import { ValidateTextTypes } from '@/components/DesignForm/validateText'
|
|
/**
|
|
@ 作者: 秦东
|
|
@ 时间: 2024-08-13 16:37:23
|
|
@ 功能: 数字类校验规则
|
|
*/
|
|
|
|
const validateIntConfig: ValidateTextTypes[] = [
|
|
{
|
|
type: 'int',
|
|
label: '正整数',
|
|
regExp: /^[0-9]*[1-9][0-9]*$/,
|
|
message: '请输入正整数',
|
|
checkbox: false
|
|
},
|
|
{
|
|
type: 'number',
|
|
label: '数字',
|
|
regExp: /^\d+(\.\d+)?$/,
|
|
message: '请输入数字',
|
|
checkbox: false
|
|
},
|
|
{
|
|
type: 'money',
|
|
label: '金额',
|
|
regExp: /^[0-9]+\.?[0-9]{0,2}$/,
|
|
message: '请输入正确的金额,最多两位小数',
|
|
checkbox: false
|
|
},
|
|
{
|
|
type: 'float',
|
|
label: '浮点数',
|
|
regExp: /^(\-|\+)?\d+(\.\d+)?$/,
|
|
message: '请输入正确的金额,最多两位小数',
|
|
checkbox: false
|
|
}
|
|
]
|
|
|
|
export default validateIntConfig
|
|
|