Ver a proveniência

app2.0 添加校验

娄底高职分支
ndbs há 2 anos
ascendente
cometimento
ad8495f085
1 ficheiros alterados com 5 adições e 2 eliminações
  1. +5
    -2
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/learun-app/customform.vue

+ 5
- 2
Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/learun-app/customform.vue Ver ficheiro

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


Carregando…
Cancelar
Guardar