编号校验修改

This commit is contained in:
zyx.net
2022-08-09 11:04:23 +08:00
parent bc3f1be1a0
commit 4806477a9a
@@ -249,14 +249,14 @@
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="24" > <a-col :span="24" v-if='contentList != []'>
<a-tabs> <a-tabs>
<a-tab-pane v-for='(item,index) in contentList' :tab="item.cut == 'cn' ? item.text : item.textEn" :key="index + 1"> <a-tab-pane v-for='(item,index) in contentList' :tab="item.cut == 'cn' ? item.text : item.textEn" :key="index + 1">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12"> <a-col :span="12">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required">*</span> <span class="Required" v-if='required'>*</span>
<span class="title-text-text" <span class="title-text-text"
:title="$t('ParameterNo')">{{$t('ParameterNo')}}</span> :title="$t('ParameterNo')">{{$t('ParameterNo')}}</span>
</div> </div>
@@ -271,7 +271,7 @@
<a-col :span="12"> <a-col :span="12">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required">*</span> <span class="Required" v-if='required'>*</span>
<span class="title-text-text" :title="$t('NParameterName')">{{$t('NParameterName')}}</span> <span class="title-text-text" :title="$t('NParameterName')">{{$t('NParameterName')}}</span>
</div> </div>
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel">
@@ -448,7 +448,6 @@ export default {
} else if (long && long == 'en-us') { } else if (long && long == 'en-us') {
this.cut = 'en' this.cut = 'en'
} }
console.log(this.cut)
}, },
methods: { methods: {
getcontentListedEdit() { getcontentListedEdit() {
@@ -595,6 +594,7 @@ export default {
item1.description= '' // 描述 item1.description= '' // 描述
} }
}) })
console.log(this.contentList)
}; };
}) })
@@ -644,6 +644,11 @@ export default {
// } else { // } else {
// value.technologyTerritory = value.technologyTerritory.split(',') // value.technologyTerritory = value.technologyTerritory.split(',')
// } // }
if(this.formInline.controlType == 11){
this.required = false
}else{
this.required = true
}
this.formInline = value this.formInline = value
this.title = this.$t('edit') this.title = this.$t('edit')
this.flag = 0 this.flag = 0
@@ -674,10 +679,11 @@ export default {
return return
} }
let falg = 1 let falg = 1
if(this.formInline.controlType != 11){
this.contentList.forEach((item,index) => { this.contentList.forEach((item,index) => {
let reg = /^[0-9a-zA-Z-/. ]{1,}$/ let reg = /^[0-9a-zA-Z-/. ]{1,}$/
// 编号的限制 // 编号的限制
if(item.paramsNumber == '' || item.paramsNumber === undefined) { if(item.paramsNumber == '' || item.paramsNumber === undefined ) {
this.$message.warning(this.$t('standard')+this.$t('cannotEmpty')) this.$message.warning(this.$t('standard')+this.$t('cannotEmpty'))
falg = 0 falg = 0
return return
@@ -691,7 +697,7 @@ export default {
return return
} }
// 参数名称的限制 // 参数名称的限制
if(item.paramsName == '' || item.paramsName === undefined) { if(item.paramsNumber == '' || item.paramsNumber === undefined) {
this.$message.warning(this.$t('ParameterName')+this.$t('cannotEmpty')) this.$message.warning(this.$t('ParameterName')+this.$t('cannotEmpty'))
falg = 0 falg = 0
return return
@@ -709,6 +715,8 @@ export default {
} }
} }
}) })
}
if(falg === 1) { if(falg === 1) {
this.$refs.ruleForm.validate(valid => { this.$refs.ruleForm.validate(valid => {
if (valid) { if (valid) {