{ required: true, message: '请输入', trigger: 'blur' },
{
type: 'number',
message: '请输入正整数',
trigger: 'blur',
transform(value) {
if(value !== null && value !== '') {
if (String(value).trim() === '' || Number(value) <= 0) {
return false
}else if (String(value).indexOf('.') !== -1 || String(value).indexOf('-') !== -1) {
return false
}else{
return Number(value)
}
}else {
return null
}
}
}
offset: [
{ required: true, message: '请输入点位地址'},
{ type: 'number',
message: '请输入正整数',
trigger: 'blur',
transform (value) {
if (!/^[1-9]\d*$/.test(value)) {
return true
}else{
}
}
}
],