import { MessageBox, Message } from 'element-ui'; import { addOperation, getOperation } from '@/api/http'; const phoneListen = function(val, form, prop) { if(/^[0-9]*$/.test(val)) { form[prop] = val; } } const mailBoxListen = function(val, form, prop) { if(/^[\u4E00-\u9FA5A-Za-z0-9_]+$/.test(val) || val==='') { form[prop] = val; } } // 校验中文 const checkHanzi = function(val, form, prop) { // 检查符号 const charReg = /[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘',。、]/im; // 检查空格 const tmpCheck = val.substr(val.length-1, 1); if(tmpCheck === ' ' || charReg.test(val) || /[\u4E00-\u9FA5]/i.test(val)) { return; } form[prop] = val; } const checkName = function(val, form, prop) { // 检查符号 const charReg = /[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘',。、]/im; // // 检查数字 const charReg2 = /^[0-9]*$/; const tmpCheck = val.substr(val.length-1, 1); if(val.length