20240205
luoJunYong.123 3 years ago
parent 487dd67e82
commit 59f7f7d005
  1. 9
      src/components/case/index.vue
  2. 63
      src/utils/verification.js

@ -203,11 +203,10 @@ export default {
if(status !== 1) {
this.popContainer = true
clearInterval(this.intervalJudge)
this.$confirm('考试已结束,已自动为您提交。', '提示', {
confirmButtonText: '确定',
type: 'info',
center: true
})
this.$alert('考试已结束,已自动为您提交。', '提示', {
confirmButtonText: '确定',
type: 'warning'
});
//
this.sureSubmit(false)
}else {

@ -0,0 +1,63 @@
const verification = {
vernull: function(value){//非空校验
if(value.trim(value).length == 0){
return false;
}else{
return true;
}
},
veridc: function(value){ //身份证校验
var ext = /(^\d{15}&)|(^\d{18})|(^\d{17}(\d|X|x)$)/;
if(ext.test(value)) {
return '身份证校验有误'
}
},
veren: function(value){ //英文校验
var ext = /(^[a-zA-Z]+$)/;
if(ext.test(value)) {
return '英文校验有误'
}
},
vernum: function(value){ //数字校验
var ext = /^[0-9]*$/;
if(ext.test(value)) {
return '请输入数字'
}else {
return ''
}
},
verdou: function(value){ //小数校验
var ext = /^[0-9]+(.[0-9]{1,3})?$/;
if(ext.test(value)) {
return ''
}else {
return ''
}
},
vermail: function(value){ //邮箱校验
var ext = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/;
if(ext.test(value)) {
return '请输入正确的邮箱'
}else {
return ''
}
},
vermob: function(value){ //手机号校验
var ext = /^1[3456789][0-9]{9}$/;
if(ext.test(value)) {
return '请输入正确的手机号'
}else {
return ''
}
},
vername: function(name) { // 名字校验
var ext =/^[\u4e00-\u9fa5]{2,4}$/;
if(!ext.test(name)){
return '请检查名字是否有误';
}else {
return ''
}
}
}
export default verification
Loading…
Cancel
Save