|
@@ -194,12 +194,14 @@ export default { |
|
|
// 依次验证表单项,返回一个所有错误提示的数组,如果为空数组则表示无错误 |
|
|
// 依次验证表单项,返回一个所有错误提示的数组,如果为空数组则表示无错误 |
|
|
verifyValue() { |
|
|
verifyValue() { |
|
|
const errorList = [] |
|
|
const errorList = [] |
|
|
|
|
|
|
|
|
|
|
|
console.log(this.scheme) |
|
|
this.scheme |
|
|
this.scheme |
|
|
.filter(t => t.verify) |
|
|
.filter(t => t.verify) |
|
|
.forEach(schemeItem => { |
|
|
.forEach(schemeItem => { |
|
|
if (schemeItem.table && schemeItem.field) { |
|
|
if (schemeItem.table && schemeItem.field) { |
|
|
|
|
|
console.log(schemeItem.verify,'hemeItem.verify') |
|
|
const verifyFunc = this.verify[schemeItem.verify] |
|
|
const verifyFunc = this.verify[schemeItem.verify] |
|
|
|
|
|
console.log(schemeItem.verify) |
|
|
const verifyResult = verifyFunc(this.getValue(schemeItem.__valuePath__)) |
|
|
const verifyResult = verifyFunc(this.getValue(schemeItem.__valuePath__)) |
|
|
if (verifyResult !== true) { |
|
|
if (verifyResult !== true) { |
|
|
errorList.push(`[${schemeItem.title}]: ${verifyResult}`) |
|
|
errorList.push(`[${schemeItem.title}]: ${verifyResult}`) |
|
@@ -304,7 +306,8 @@ export default { |
|
|
MobileOrPhoneOrNull: t => |
|
|
MobileOrPhoneOrNull: t => |
|
|
t.length <= 0 || /^1[0-9]{10}$/.test(t) || /^[+0-9- ]*$/.test(t) || '须留空或符合手机/电话号码格式', |
|
|
t.length <= 0 || /^1[0-9]{10}$/.test(t) || /^[+0-9- ]*$/.test(t) || '须留空或符合手机/电话号码格式', |
|
|
Uri: t => /^[a-zA-z]+:\/\/[^\s]*$/.test(t) || '须符合网址Url格式', |
|
|
Uri: t => /^[a-zA-z]+:\/\/[^\s]*$/.test(t) || '须符合网址Url格式', |
|
|
UriOrNull: t => t.length <= 0 || /^[a-zA-z]+:\/\/[^\s]*$/.test(t) || '须留空或符合网址Url格式' |
|
|
|
|
|
|
|
|
UriOrNull: t => t.length <= 0 || /^[a-zA-z]+:\/\/[^\s]*$/.test(t) || '须留空或符合网址Url格式', |
|
|
|
|
|
PositiveFloatint:t=> /^([1-9]\d*|(0|[1-9]\d*)\.\d*[1-9])$/.test(t) || '请输入正确的整数或小数(不能为零和负数)' |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|