| | |
| | | let form = this.form; |
| | | //console.log(form); |
| | | const regNumber = /^[0-9]+\.{0,1}[0-9]*$/; //数字或小数正则校验 |
| | | const regPos = /^[0-9]*[1-9][0-9]*$/; //非负整数正则校验 |
| | | const tipsMsg = "必填项不能为空"; |
| | | if(form.id == ''){ |
| | | this.$message.warning("(码段编号)"+tipsMsg); |
| | |
| | | //固定码段 |
| | | if(form.codeSecLengthType == ''){ |
| | | this.$message.warning("(码段长度类型)"+tipsMsg); |
| | | this.$refs.codeSecLengthType.$el.querySelector('select').focus(); |
| | | // this.$refs.codeSecLengthType.$el.querySelector('select').focus(); |
| | | return false; |
| | | } |
| | | if(form.codeSecLength == ''){ |
| | |
| | | this.$message.warning('(层级类型)'+tipsMsg); |
| | | return false; |
| | | } |
| | | if(!regNumber.test(form.codeLevelValue)){ |
| | | this.$message.warning('层级的值)只能填写数字'); |
| | | if(form.codeLevelType != 'code_level_min'&& !regNumber.test(form.codeLevelValue)){ |
| | | this.$message.warning('(层级的值)只能填写数字'); |
| | | this.$refs.codeLevelValue.$el.querySelector('input').focus(); |
| | | return false; |
| | | } |
| | | if(form.valueCutType == ''){ |
| | | this.$message.warning('(字符截取类型)'+tipsMsg); |
| | | this.$refs.valueCutType.$el.querySelector('select').focus(); |
| | | // this.$refs.valueCutType.$el.querySelector('select').focus(); |
| | | return false; |
| | | } |
| | | if(form.valueCutType != 'code_cut_none' && !regPos.test(form.valueCutLength)){ |
| | | this.$message.warning('(值截取长度)只能填写正整数'); |
| | | this.$refs.valueCutLength.$el.querySelector('input').focus(); |
| | | return false; |
| | | } |
| | | }else if(this.form.secType==='coderefersec'){ |
| | |
| | | // console.log(this.form); |
| | | }, |
| | | // 第一次请求的枚举数据放缓存 |
| | | getLocalStorageEnum(key){ |
| | | let enumCach = JSON.parse(localStorage.getItem(key)); |
| | | getLocalStorageEnum(enumKey){ |
| | | let enumCach = JSON.parse(localStorage.getItem(enumKey)); |
| | | if(enumCach == null) { |
| | | getDictionary({code: key}).then(res=>{ |
| | | getDictionary({code: enumKey}).then(res=>{ |
| | | enumCach = res.data.data; |
| | | localStorage.setItem(key,JSON.stringify(res.data.data)); |
| | | localStorage.setItem(enumKey,JSON.stringify(res.data.data)); |
| | | }) |
| | | } |
| | | return enumCach; |
| | |
| | | loadCodeGetValueType(){ |
| | | this.enumParam.codeGetValueType = this.getLocalStorageEnum("codeGetValueType"); |
| | | }, |
| | | |
| | | |
| | | } |
| | | }; |
| | | |