From 454bff7c8bd154fc66aaa0d01cc3bf4961f1f9f2 Mon Sep 17 00:00:00 2001 From: zyn Date: Tue, 18 Apr 2023 16:21:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=95=E8=A7=84=E5=BA=93-=E7=BC=96=E8=BE=91-?= =?UTF-8?q?=E6=A0=87=E5=87=86=E7=BC=96=E5=8F=B7=E6=B7=BB=E5=8A=A0;?= =?UTF-8?q?=EF=BC=9B=E7=89=B9=E6=AE=8A=E5=AD=97=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/verify/index.js | 10 ++++++++++ .../domesticStandardsAndRegulations/index.vue | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) 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'}