[update] 配置必填长度校验
This commit is contained in:
@@ -216,6 +216,60 @@ export default {
|
|||||||
this.visible = false
|
this.visible = false
|
||||||
},
|
},
|
||||||
handleSubmit() {
|
handleSubmit() {
|
||||||
|
let flag = 1
|
||||||
|
this.paramsConfigEOList.forEach((item) => {
|
||||||
|
// 配置名称
|
||||||
|
if(item.configName == ''){
|
||||||
|
this.$message.warning(this.$t('configurationName')+this.$t('cannotEmpty'))
|
||||||
|
flag = 0
|
||||||
|
return
|
||||||
|
} else if(item.configName.length > 25){
|
||||||
|
this.$message.warning(this.$t('configurationName')+this.$t('cantExeed')+'25'+this.$t('characters'))
|
||||||
|
flag = 0
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 车型
|
||||||
|
if(item.carType == ''){
|
||||||
|
this.$message.warning(this.$t('Model')+this.$t('cannotEmpty'))
|
||||||
|
flag = 0
|
||||||
|
return
|
||||||
|
} else if(item.carType.length > 20){
|
||||||
|
this.$message.warning(this.$t('Model')+this.$t('cantExeed')+'20'+this.$t('characters'))
|
||||||
|
flag = 0
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 版本
|
||||||
|
if(item.version == ''){
|
||||||
|
this.$message.warning(this.$t('Version')+this.$t('cannotEmpty'))
|
||||||
|
flag = 0
|
||||||
|
return
|
||||||
|
} else if(item.version.length > 20){
|
||||||
|
this.$message.warning(this.$t('Version')+this.$t('cantExeed')+'20'+this.$t('characters'))
|
||||||
|
flag = 0
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 电池
|
||||||
|
if(item.battery == ''){
|
||||||
|
this.$message.warning(this.$t('Battery')+this.$t('cannotEmpty'))
|
||||||
|
flag = 0
|
||||||
|
return
|
||||||
|
} else if(item.battery.length > 20){
|
||||||
|
this.$message.warning(this.$t('Battery')+this.$t('cantExeed')+'20'+this.$t('characters'))
|
||||||
|
flag = 0
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 电机
|
||||||
|
if(item.motor == ''){
|
||||||
|
this.$message.warning(this.$t('electricMachinery')+this.$t('cannotEmpty'))
|
||||||
|
flag = 0
|
||||||
|
return
|
||||||
|
} else if(item.motor.length > 20){
|
||||||
|
this.$message.warning(this.$t('electricMachinery')+this.$t('cantExeed')+'20'+this.$t('characters'))
|
||||||
|
flag = 0
|
||||||
|
return
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if(flag == 1){
|
||||||
this.$refs.ruleForm.validate(valid => {
|
this.$refs.ruleForm.validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
let querycontentList = {}
|
let querycontentList = {}
|
||||||
@@ -239,6 +293,7 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user