From 8110443d04d126678b3e9d64d4b8397b7a35d865 Mon Sep 17 00:00:00 2001 From: zhaomeijing Date: Tue, 7 Jun 2022 17:11:12 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../parameterlist/components/addModel.vue | 107 ++++++++++++------ 1 file changed, 73 insertions(+), 34 deletions(-) diff --git a/jero-web/src/views/parameter/parameterlist/components/addModel.vue b/jero-web/src/views/parameter/parameterlist/components/addModel.vue index a871bfaba..ec671d9e5 100644 --- a/jero-web/src/views/parameter/parameterlist/components/addModel.vue +++ b/jero-web/src/views/parameter/parameterlist/components/addModel.vue @@ -358,7 +358,7 @@ export default { } ], certCategory: [ - { required: true, message: this.$t('pleaseSelect')+this.$t('certificationCategory'), type: 'array', trigger: 'change' }, + // { required: true, message: this.$t('pleaseSelect')+this.$t('certificationCategory'), type: 'array', trigger: 'change' }, ], isMust: [ { required: true, message: this.$t('pleaseSelect')+this.$t('Required'), trigger: 'change' }, @@ -428,7 +428,6 @@ export default { }) }, Onchangelabel(val) { - console.log(val,'lllll') // 新增 if(this.title === '新增') { let _tt = [] @@ -505,40 +504,80 @@ export default { this.visible = false }, handleSubmit() { - this.$refs.ruleForm.validate(valid => { - if (valid) { - let url = '' - let Action - this.formInline.paramsTemplateId = this.$route.query.id - if (this.formInline.id) { - url = this.url.edit - Action = postAction - } else { - url = this.url.add - Action = postAction - } - let query = JSON.parse(JSON.stringify(this.formInline)) - Object.keys(query).forEach(res => { - if (query[res] && query[res] instanceof Array) { - query[res] = query[res].join(',') - } - }) - let querycontentList = JSON.parse(JSON.stringify(this.contentList)) - query.certCategoryParamsInfoEOList = querycontentList - this.confirmLoading = true - Action(url, query).then((res) => { - if (res.success) { - this.confirmLoading = false - this.$message.success(this.$t('OperationSuccessful')) - this.visible = false - this.$emit('addModelList') - } else { - this.$message.warning(res.message) - this.confirmLoading = false - } - }) + if(this.formInline.certCategory == undefined) { + this.$message.warning(this.$t('certificationCategory')+this.$t('cannotEmpty')) + return + } + let falg = 1 + this.contentList.forEach((item,index) => { + let reg = /^[0-9a-zA-Z-]{1,}$/ + // 编号的限制 + if(item.paramsNumber == '') { + this.$message.warning(this.$t('standard')+this.$t('cannotEmpty')) + falg = 0 + return + } else if(item.paramsNumber.length > 15){ + this.$message.warning(this.$t('standard')+this.$t('cantExeed')+'15'+this.$t('Characters')) + falg = 0 + return + } else if(item.paramsNumber.match(reg) === null) { + this.$message.warning(this.$t('standard')+this.$t('onlyThree')) + falg = 0 + return + } + // 参数名称的限制 + if(item.paramsName == '') { + this.$message.warning(this.$t('ParameterName')+this.$t('cannotEmpty')) + falg = 0 + return + } else if(item.paramsName.length > 30){ + this.$message.warning(this.$t('ParameterName')+this.$t('cantExeed')+'30'+this.$t('Characters')) + falg = 0 + return + } + // 参数说明的限制 + if(item.description.length > 200){ + this.$message.warning(this.$t('ParameterDescription')+this.$t('cantExeed')+'200'+this.$t('Characters')) + falg = 0 + return } }) + if(falg === 1) { + this.$refs.ruleForm.validate(valid => { + if (valid) { + let url = '' + let Action + this.formInline.paramsTemplateId = this.$route.query.id + if (this.formInline.id) { + url = this.url.edit + Action = postAction + } else { + url = this.url.add + Action = postAction + } + let query = JSON.parse(JSON.stringify(this.formInline)) + Object.keys(query).forEach(res => { + if (query[res] && query[res] instanceof Array) { + query[res] = query[res].join(',') + } + }) + let querycontentList = JSON.parse(JSON.stringify(this.contentList)) + query.certCategoryParamsInfoEOList = querycontentList + this.confirmLoading = true + Action(url, query).then((res) => { + if (res.success) { + this.confirmLoading = false + this.$message.success(this.$t('OperationSuccessful')) + this.visible = false + this.$emit('addModelList') + } else { + this.$message.warning(res.message) + this.confirmLoading = false + } + }) + } + }) + } }, handleInput(value) { this.$nextTick(() => {