diff --git a/src/common/verify/index.js b/src/common/verify/index.js index b217a4af9..eb3e8843a 100644 --- a/src/common/verify/index.js +++ b/src/common/verify/index.js @@ -32,6 +32,16 @@ export default { callback() } }, + validateStandardItem2 (rule, value, callback) { + // return callback() + let testval = /^[A-Za-z0-9/]+$/ + let testval1 = /[.-;;]+/ + if (value && !value.match(testval) && !value.match(testval1)) { + return callback(new Error('只能为(字母、数字、.、-、;、;)')) + } else { + callback() + } + }, /** * 验证字母、数字、.、-的正则且不能重复 diff --git a/src/pages/regulatoryRepository/domesticStandardsAndRegulations/index.vue b/src/pages/regulatoryRepository/domesticStandardsAndRegulations/index.vue index fa5a583a1..c27def6ee 100644 --- a/src/pages/regulatoryRepository/domesticStandardsAndRegulations/index.vue +++ b/src/pages/regulatoryRepository/domesticStandardsAndRegulations/index.vue @@ -2844,7 +2844,7 @@ export default { standNumber: [ {required: true, type: 'string', message: '标准编号不能为空', trigger: 'change'}, {type: 'string', max: 100, message: '标准编号不能超过100个字符', trigger: 'change'}, - {type: 'string', validator: this.verify.validateStandardItem, trigger: 'change'} + {type: 'string', validator: this.verify.validateStandardItem2, trigger: 'change'} ], synopsis: [ {type: 'string', max: 500, message: '文本说明不能超过500个字符', trigger: 'change'}