diff --git a/jero-web/src/views/parameter/parameterlist/components/addModel.vue b/jero-web/src/views/parameter/parameterlist/components/addModel.vue index cb0288e00..d56be0d6e 100644 --- a/jero-web/src/views/parameter/parameterlist/components/addModel.vue +++ b/jero-web/src/views/parameter/parameterlist/components/addModel.vue @@ -15,15 +15,15 @@
- * - {{$t('NNiONumber')}} + * + {{ $t('NNiONumber') }}
+ :placeholder="$t('PleaseEnter')+$t('NNiONumber')" />
@@ -31,14 +31,14 @@
* - {{$t('NRequired')}} + {{ $t('NRequired') }}
- {{$t('yes')}} + :placeholder="$t('PleaseSelect')+$t('NRequired')" v-model="formInline.isMust"> + {{ $t('yes') }} - {{$t('notOnlyRz')}} + {{ $t('notOnlyRz') }} @@ -49,51 +49,52 @@
- * - {{$t('Paraname')}} + * + {{ $t('Paraname') }}
+ :placeholder="$t('PleaseEnter')+$t('Paraname')" />
- - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + +
* - {{$t('NareaOfResponsibility')}} + {{ $t('NareaOfResponsibility') }}
+ :triggerChange="false" :dictCode="'duty_territory'" />
@@ -102,16 +103,16 @@
- * - {{$t('Parabatch')}} + * + {{ $t('Parabatch') }}
+ :triggerChange="false" :dictCode="'params_batch'" />
@@ -122,47 +123,47 @@
{{$t('NParameterDescription')}} + :title="$t('NParameterDescription')">{{ $t('NParameterDescription') }}
+ :placeholder="$t('PleaseEnter')+$t('NParameterDescription')" />
- - + +
- * - {{$t('NcertificationCategory')}} + * + {{ $t('NcertificationCategory') }}
+ @change="Onchange" + v-on:changelabel="Onchangelabel" + :disabled="disabled" + :placeholder="$t('PleaseSelect')+$t('NcertificationCategory')" + :type="'checkbox'" + :triggerChange="false" :dictCode="'cert_category'" />
- +
- * - {{$t('NcontrolType')}} + * + {{ $t('NcontrolType') }}
- - + +
* - {{$t('NcontrolVerification')}} + {{ $t('NcontrolVerification') }}
+ :placeholder="$t('PleaseSelect')+$t('NcontrolVerification')" allowClear + v-model="formInline.controlVerify"> {{ item.label }} @@ -202,7 +206,7 @@
* {{$t('DefaultValue')}} + :title="$t('DefaultValue')">{{ $t('DefaultValue') }}
+ :placeholder="$t('PleaseEnter')+$t('DefaultValue')" />
- + - +
- * - {{$t('NcontrolAlternatives')}} + * + {{ $t('NcontrolAlternatives') }}
+ :placeholder="$t('PleaseEnter')+$t('NcontrolAlternatives')" />
- - + +
{{$t('NattachmentTemplate')}} + :title="$t('NattachmentTemplate')">{{ $t('NattachmentTemplate') }}
- {{ (formInline.fileTemplateConnectId === 'null' || formInline.fileTemplateConnectId === '' || - formInline.fileTemplateConnectId == null) ? $t('clickUpload') : $t('viewUploadedFiles')}} + {{ (formInline.fileTemplateConnectId === 'null' || formInline.fileTemplateConnectId === '' || + formInline.fileTemplateConnectId == null) ? $t('clickUpload') : $t('viewUploadedFiles') }}
- - - + + + - +
- * - {{$t('ParameterNo')}} + * + {{ $t('ParameterNo') }}
+ :placeholder="$t('PleaseEnter')+$t('ParameterNo')" />
@@ -278,13 +285,13 @@
* - {{$t('NParameterName')}} + {{ $t('NParameterName') }}
+ :placeholder="$t('PleaseEnter')+$t('NParameterName')" />
@@ -294,21 +301,21 @@
{{$t('NParameterDescription')}} + :title="$t('NParameterDescription')">{{ $t('NParameterDescription') }}
+ :placeholder="$t('PleaseEnter')+$t('NParameterDescription')" />
- + @@ -316,8 +323,9 @@
- {{$t('cancel')}} - {{$t('submit')}} + {{ $t('cancel') }} + {{ $t('submit') }} +
@@ -328,6 +336,7 @@ import PersonnelSelection from '@/components/PersonnelSelection/index' import { getAction, postAction, downloadFile, putAction } from '@/api/manage' import uploadFileChange from '@/components/uploadFileChange/file' + export default { name: 'addModel', components: { @@ -335,11 +344,11 @@ export default { PersonnelSelection }, props: { - url: { - type: Object, - default: {}, - require: true - }, + url: { + type: Object, + default: {}, + require: true + }, certCategoryParamsInfoEOListItem: { type: Array, default: [], @@ -349,39 +358,39 @@ export default { data() { return { controlType: [ // 控件类型 - {value:'1', label: this.$t('Ntext') }, - {value:'2', label: this.$t('NDropdownradio') }, - {value:'3', label: this.$t('NDropdownmultipleselection') }, - {value:'4', label: this.$t('Nenclosure') }, - {value:'5', label: this.$t('Atext') }, - {value:'6', label: this.$t('Btext') }, - {value:'7', label: this.$t('Ctext') }, - {value:'8', label: this.$t('Dtext') }, - {value:'9', label: this.$t('Etext') }, - {value:'10', label: this.$t('Ftext') }, - {value:'11', label: this.$t('Gtext') }, + { value: '1', label: this.$t('Ntext') }, + { value: '2', label: this.$t('NDropdownradio') }, + { value: '3', label: this.$t('NDropdownmultipleselection') }, + { value: '4', label: this.$t('Nenclosure') }, + { value: '5', label: this.$t('Atext') }, + { value: '6', label: this.$t('Btext') }, + { value: '7', label: this.$t('Ctext') }, + { value: '8', label: this.$t('Dtext') }, + { value: '9', label: this.$t('Etext') }, + { value: '10', label: this.$t('Ftext') }, + { value: '11', label: this.$t('Gtext') } ], controlVerification: [ // 控件校验 - {value:'1', label: this.$t('Nnothing') }, - {value:'2', label: this.$t('Nchinese') }, - {value:'3', label: this.$t('NpositiveInteger') }, - {value:'4', label: this.$t('NPositivefloatingpointnumber') }, - {value:'5', label: this.$t('NintegerOrDecimal')}, - {value:'6', label: this.$t('NOneDecimalPlace') }, - {value:'7', label: this.$t('NTwoDecimalplaces') }, - {value:'8', label: this.$t('NThreedecimalplaces') }, - {value:'9', label: this.$t('NFourDecimalplaces') }, + { value: '1', label: this.$t('Nnothing') }, + { value: '2', label: this.$t('Nchinese') }, + { value: '3', label: this.$t('NpositiveInteger') }, + { value: '4', label: this.$t('NPositivefloatingpointnumber') }, + { value: '5', label: this.$t('NintegerOrDecimal') }, + { value: '6', label: this.$t('NOneDecimalPlace') }, + { value: '7', label: this.$t('NTwoDecimalplaces') }, + { value: '8', label: this.$t('NThreedecimalplaces') }, + { value: '9', label: this.$t('NFourDecimalplaces') } ], CategoryTreeList: [], // 技术领域 certCategoryParamsInfoEOList: [], // 认证类别得tab栏 formInline: {}, confirmLoading: false, - required:true, + required: true, visible: false, rules: { - nioNumber:[ - { required: true, message: this.$t('PleaseEnter')+this.$t('NiONumber'), trigger: 'blur' }, - { min:1, max: 20, message: this.$t('cantExeed')+'20'+this.$t('characters'), trigger: 'blur' }, + nioNumber: [ + { required: true, message: this.$t('PleaseEnter') + this.$t('NiONumber'), trigger: 'blur' }, + { min: 1, max: 20, message: this.$t('cantExeed') + '20' + this.$t('characters'), trigger: 'blur' }, { pattern: /^[0-9a-zA-Z-/ ]{1,}$/, message: this.$t('onlyThree'), @@ -392,57 +401,57 @@ export default { // { required: true, message: this.$t('pleaseSelect')+this.$t('certificationCategory'), type: 'array', trigger: 'change' }, ], isMust: [ - { required: true, message: this.$t('PleaseEnter')+this.$t('Required'), trigger: 'change' }, + { required: true, message: this.$t('PleaseEnter') + this.$t('Required'), trigger: 'change' } ], paramsName: [ - { required: true, message: this.$t('pleaseSelect')+this.$t('Paraname'), trigger: 'blur' }, - { min:1, max: 500, message: this.$t('cantExeed')+'500'+this.$t('characters'), trigger: 'blur' }, + { required: true, message: this.$t('pleaseSelect') + this.$t('Paraname'), trigger: 'blur' }, + { min: 1, max: 500, message: this.$t('cantExeed') + '500' + this.$t('characters'), trigger: 'blur' } ], technologyTerritory: [ - { required: true, message: this.$t('pleaseSelect')+this.$t('technicalField'), trigger: 'change' }, + { required: true, message: this.$t('pleaseSelect') + this.$t('technicalField'), trigger: 'change' } ], paramsBatch: [ - { required: true, message: this.$t('PleaseSelect')+this.$t('parameterBatch'), trigger: 'change' }, + { required: true, message: this.$t('PleaseSelect') + this.$t('parameterBatch'), trigger: 'change' } ], dutyTerritory: [ - { required: true, message: this.$t('PleaseSelect')+this.$t('areaOfResponsibility'), trigger: 'change' }, + { required: true, message: this.$t('PleaseSelect') + this.$t('areaOfResponsibility'), trigger: 'change' } ], description: [ - { min:1, max: 2000, message: this.$t('cantExeed')+'2000'+this.$t('characters'), trigger: 'blur' }, + { min: 1, max: 2000, message: this.$t('cantExeed') + '2000' + this.$t('characters'), trigger: 'blur' } ], controlType: [ - { required: true, message: this.$t('pleaseSelect')+this.$t('controlType'), trigger: 'change' }, + { required: true, message: this.$t('pleaseSelect') + this.$t('controlType'), trigger: 'change' } ], controlVerify: [ - { required: true, message: this.$t('PleaseEnter')+this.$t('controlVerification'), trigger: 'change' }, + { required: true, message: this.$t('PleaseEnter') + this.$t('controlVerification'), trigger: 'change' } ], controlValues: [ - { required: true, message: this.$t('PleaseEnter')+this.$t('controlAlternatives'), trigger: 'blur' }, - { min:1, max: 500, message: this.$t('cantExeed')+'500'+this.$t('characters'), trigger: 'blur' }, + { required: true, message: this.$t('PleaseEnter') + this.$t('controlAlternatives'), trigger: 'blur' }, + { min: 1, max: 500, message: this.$t('cantExeed') + '500' + this.$t('characters'), trigger: 'blur' }, { validator: this.test } ], titleDefaultValue: [ - { required: true, message: this.$t('PleaseEnter')+this.$t('DefaultValue'), trigger: 'blur' }, - { min:1, max: 100, message: this.$t('cantExeed')+'100'+this.$t('characters'), trigger: 'blur' }, - ], + { required: true, message: this.$t('PleaseEnter') + this.$t('DefaultValue'), trigger: 'blur' }, + { min: 1, max: 100, message: this.$t('cantExeed') + '100' + this.$t('characters'), trigger: 'blur' } + ] }, rulesItem: { paramsNumber: [ - { required: true, message: this.$t('PleaseEnter')+this.$t('standard'), trigger: 'change' } + { required: true, message: this.$t('PleaseEnter') + this.$t('standard'), trigger: 'change' } ] }, disabled: false, projectNameList: [], title: '', - cut:'', + cut: '', stateOne: '', - contentList : [], + contentList: [], contentListed: [], // 编辑 contentList 所带出来的数据 SelectChangelabel: false, // 控件校验 inputChangelabel: false, // 控件备选值校验 buttonChangelabel: false, // 模板校验 contentListStart: [], // 认证类别编辑 - flag: 1, // 判断师新增,编辑 默认新增 + flag: 1 // 判断师新增,编辑 默认新增 } }, mounted() { @@ -466,7 +475,7 @@ export default { } }, getcontentListedEdit() { - getAction('sys/dict/getDictItems/cert_category', { }).then((res) => { + getAction('sys/dict/getDictItems/cert_category', {}).then((res) => { if (res.success) { let tt = [] res.result.forEach((item) => { @@ -474,17 +483,17 @@ export default { certCategory: item.value, paramsNumber: item.paramsNumber, // 编号 paramsName: item.paramsName, //参数名称 - description: item.description, // 描述 + description: item.description // 描述 } - tt.push(Object.assign(obj,item)) + tt.push(Object.assign(obj, item)) }) this.contentListStart = tt console.log(this.contentListStart) } }) }, - controlTypeChange(value){ - this.$refs.ruleForm.clearValidate(['controlVerify','titleDefaultValue','controlValues']) + controlTypeChange(value) { + this.$refs.ruleForm.clearValidate(['controlVerify', 'titleDefaultValue', 'controlValues']) // if(value == 11){ // this.required = false // }else { @@ -515,20 +524,20 @@ export default { }, Onchangelabel(val) { let _tt = [] - if(this.flag == 1) { - if(this.cut == 'cn'){ + if (this.flag == 1) { + if (this.cut == 'cn') { this.contentListStart.forEach((itemVal) => { val.forEach((item) => { - if(itemVal.value === item.value) { + if (itemVal.value === item.value) { itemVal.cut = 'cn' _tt.push(itemVal) } }) }) - }else { + } else { this.contentListStart.forEach((itemVal) => { val.forEach((item) => { - if(itemVal.value === item.value) { + if (itemVal.value === item.value) { itemVal.cut = 'en' _tt.push(itemVal) } @@ -540,10 +549,10 @@ export default { } else { let _mm = [] - if(this.cut == 'cn'){ + if (this.cut == 'cn') { this.contentListStart.forEach((itemVal) => { val.forEach((item) => { - if(itemVal.value === item.value) { + if (itemVal.value === item.value) { itemVal.cut = 'cn' _mm.push(itemVal) } @@ -552,20 +561,20 @@ export default { _mm.forEach((item) => { this.contentListed.forEach((itemVal) => { // 原编辑的数据 - if(itemVal.certCategory === item.value) { - item.textVal= itemVal.textVal, - item.certCategory= itemVal.certCategory, - item.paramsNumber= itemVal.paramsNumber, // 编号 - item.paramsName= itemVal.paramsName, //参数名称 - item.cut= itemVal.cut, //中英文标识 - item.description= itemVal.description // 描述 + if (itemVal.certCategory === item.value) { + item.textVal = itemVal.textVal, + item.certCategory = itemVal.certCategory, + item.paramsNumber = itemVal.paramsNumber, // 编号 + item.paramsName = itemVal.paramsName, //参数名称 + item.cut = itemVal.cut, //中英文标识 + item.description = itemVal.description // 描述 } }) }) - }else { + } else { this.contentListStart.forEach((itemVal) => { val.forEach((item) => { - if(itemVal.value === item.value) { + if (itemVal.value === item.value) { itemVal.cut = 'en' _mm.push(itemVal) } @@ -574,13 +583,13 @@ export default { _mm.forEach((item) => { this.contentListed.forEach((itemVal) => { // 原编辑的数据 - if(itemVal.certCategory === item.value) { - item.textVal= itemVal.textVal, - item.certCategory= itemVal.certCategory, - item.paramsNumber= itemVal.paramsNumber, // 编号 - item.paramsName= itemVal.paramsName, //参数名称 - item.cut= itemVal.cut, //中英文标识 - item.description= itemVal.description // 描述 + if (itemVal.certCategory === item.value) { + item.textVal = itemVal.textVal, + item.certCategory = itemVal.certCategory, + item.paramsNumber = itemVal.paramsNumber, // 编号 + item.paramsName = itemVal.paramsName, //参数名称 + item.cut = itemVal.cut, //中英文标识 + item.description = itemVal.description // 描述 } }) }) @@ -594,23 +603,24 @@ export default { let arr = [] let newArray = [] this.arr = [] - this.contentListStart.forEach((item,index) => { + this.contentListStart.forEach((item, index) => { this.arr.push(item.certCategory) }) console.log(this.arr) this.tabList = val.split(',') this.arr.forEach(item => { if (!this.tabList.includes(item)) { - newArray.push(item); - this.contentList.forEach((item1,index1) => { - if(item == item1.certCategory){ - item1.paramsNumber= '', // 编号 - item1.paramsName= '', //参数名称 - item1.description= '' // 描述 + newArray.push(item) + this.contentList.forEach((item1, index1) => { + if (item == item1.certCategory) { + item1.paramsNumber = '', // 编号 + item1.paramsName = '', //参数名称 + item1.description = '' // 描述 } }) console.log(this.contentList) - }; + } + }) }, @@ -618,7 +628,7 @@ export default { let value = r.target.value r.target.value = value.replace(/[!!#]/g, '') this.formInline.controlValues = r.target.value - this.formInline = {...this.formInline} + this.formInline = { ...this.formInline } }, getSysCategoryTree() { getAction('/sys/category/getSysCategoryTree', {}).then((res) => { @@ -647,7 +657,7 @@ export default { // 获取认证类别 this.getcontentListedEdit() this.formInline.isMust = '0' - this.formInline = {...this.formInline} + this.formInline = { ...this.formInline } this.contentListed = [] // 防止编辑数据带出 this.contentList = [] this.$nextTick(() => { @@ -674,19 +684,19 @@ export default { this.flag = 0 // 获取认证类别 this.getcontentListedEdit() - value.certCategoryParamsInfoEOList.map((item, index) => { - if(this.cut == 'cn'){ - item.cut = 'cn' - this.contentListed.push(item) - item.text = item.certCategory_dictText - }else { - item.cut = 'en' - this.contentListed.push(item) - item.textEn = item.certCategory_dictText - } + value.certCategoryParamsInfoEOList.map((item, index) => { + if (this.cut == 'cn') { + item.cut = 'cn' + this.contentListed.push(item) + item.text = item.certCategory_dictText + } else { + item.cut = 'en' + this.contentListed.push(item) + item.textEn = item.certCategory_dictText + } - }) - this.contentList = this.contentListed + }) + this.contentList = this.contentListed console.log(this.contentList) }, viewModel(value) { @@ -710,11 +720,11 @@ export default { // 获取认证类别 this.getcontentListedEdit() value.certCategoryParamsInfoEOList.map((item, index) => { - if(this.cut == 'cn'){ + if (this.cut == 'cn') { item.cut = 'cn' this.contentListed.push(item) item.text = item.certCategory_dictText - }else { + } else { item.cut = 'en' this.contentListed.push(item) item.textEn = item.certCategory_dictText @@ -729,49 +739,49 @@ export default { this.$refs['ruleForm'].resetFields() }, handleSubmit() { - // && this.formInline.controlType != 11 - if(this.formInline.certCategory == undefined ) { - this.$message.warning(this.$t('certificationCategory')+this.$t('cannotEmpty')) + // && this.formInline.controlType != 11 + 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 == '' || item.paramsNumber === undefined ) { - this.$message.warning(this.$t('standard')+this.$t('cannotEmpty')) - falg = 0 - return - } else if(item.paramsNumber.length > 20){ - this.$message.warning(this.$t('standard')+this.$t('cantExeed')+'20'+this.$t('Characters')) - falg = 0 - return - } else if(item.paramsNumber.match(reg) === null) { - this.$message.warning(this.$t('standard')+this.$t('onlyThree')) + this.contentList.forEach((item, index) => { + let reg = /^[0-9a-zA-Z-/. ]{1,}$/ + // 编号的限制 + if (item.paramsNumber == '' || item.paramsNumber === undefined) { + this.$message.warning(this.$t('standard') + this.$t('cannotEmpty')) + falg = 0 + return + } else if (item.paramsNumber.length > 20) { + this.$message.warning(this.$t('standard') + this.$t('cantExeed') + '20' + 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.paramsNumber == '' || item.paramsNumber === undefined) { + this.$message.warning(this.$t('ParameterName') + this.$t('cannotEmpty')) + falg = 0 + return + } else if (item.paramsName.length > 500) { + this.$message.warning(this.$t('ParameterName') + this.$t('cantExeed') + '500' + this.$t('Characters')) + falg = 0 + return + } + if (item.description !== undefined && item.description !== null) { + // 参数说明的限制 + if (item.description.length > 2000) { + this.$message.warning(this.$t('ParameterDescription') + this.$t('cantExeed') + '2000' + this.$t('Characters')) falg = 0 return } - // 参数名称的限制 - if(item.paramsNumber == '' || item.paramsNumber === undefined) { - this.$message.warning(this.$t('ParameterName')+this.$t('cannotEmpty')) - falg = 0 - return - } else if(item.paramsName.length > 500){ - this.$message.warning(this.$t('ParameterName')+this.$t('cantExeed')+'500'+this.$t('Characters')) - falg = 0 - return - } - if(item.description !== undefined && item.description !== null){ - // 参数说明的限制 - if(item.description.length > 2000){ - this.$message.warning(this.$t('ParameterDescription')+this.$t('cantExeed')+'2000'+this.$t('Characters')) - falg = 0 - return - } - } - }) + } + }) - if(falg === 1) { + if (falg === 1) { this.$refs.ruleForm.validate(valid => { if (valid) { let url = '' @@ -791,6 +801,11 @@ export default { } }) let querycontentList = JSON.parse(JSON.stringify(this.contentList)) + if (querycontentList && querycontentList.length > 0) { + for (let i = 0; i < querycontentList.length; i++) { + delete querycontentList[i].id + } + } query.certCategoryParamsInfoEOList = querycontentList // if(this.formInline.controlType == 11){ // query.certCategoryParamsInfoEOList = [] @@ -824,8 +839,8 @@ export default { this.formInline[value] = id this.formInline = { ...this.formInline } }, - projectNameChange(value){ - }, + projectNameChange(value) { + } } } @@ -833,9 +848,11 @@ export default { .formAdd .ant-form-item-label { width: 130px; } -/deep/.add-input{ - min-height: 95px!important; + +/deep/ .add-input { + min-height: 95px !important; } + .formAdd .ant-form-item-control-wrapper { display: inline-block; width: 100%; @@ -886,9 +903,11 @@ export default { display: flex; /*align-items: center;*/ } -/deep/.ant-form-item-control { + +/deep/ .ant-form-item-control { line-height: 10px; } + .title-text { width: 114px; text-align: right; @@ -908,11 +927,13 @@ export default { height: 38px; width: 100%; } + .itemModel-text { width: calc(100% - 130px); display: inline-block; margin-top: 2px; } + .itemModel { width: calc(100% - 130px); display: inline-block; @@ -938,7 +959,7 @@ export default { position: absolute; bottom: 0; width: 100%; - z-index:100; + z-index: 100; border-top: 1px solid #e8e8e8; padding: 10px 16px; text-align: right; @@ -951,7 +972,8 @@ export default { .ant-input-disabled { color: rgba(0, 0, 0, 0.65) !important; } -.ant-select-disabled{ + +.ant-select-disabled { color: rgba(0, 0, 0, 0.65) !important; } \ No newline at end of file