修改参数模版添加问题

This commit is contained in:
gaosong
2023-12-13 16:24:42 +08:00
parent 981fb5af3e
commit eac1e31c68
@@ -35,7 +35,7 @@
</div> </div>
<a-form-model-item class="itemModel" prop="isMust"> <a-form-model-item class="itemModel" prop="isMust">
<a-select allowClear :disabled="disabled" <a-select allowClear :disabled="disabled"
:placeholder="$t('PleaseSelect')+$t('NRequired')" v-model='formInline.isMust'> :placeholder="$t('PleaseSelect')+$t('NRequired')" v-model="formInline.isMust">
<a-select-option :key="'1'" :value="'1'">{{ $t('yes') }} <a-select-option :key="'1'" :value="'1'">{{ $t('yes') }}
</a-select-option> </a-select-option>
<a-select-option :key="'0'" :value="'0'">{{ $t('notOnlyRz') }} <a-select-option :key="'0'" :value="'0'">{{ $t('notOnlyRz') }}
@@ -86,7 +86,8 @@
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required" v-if="!disabled">*</span> <span class="Required" v-if="!disabled">*</span>
<span class="title-text-text" :title="$t('NareaOfResponsibility')">{{$t('NareaOfResponsibility')}}</span> <span class="title-text-text"
:title="$t('NareaOfResponsibility')">{{ $t('NareaOfResponsibility') }}</span>
</div> </div>
<a-form-model-item class="itemModel" prop="dutyTerritory"> <a-form-model-item class="itemModel" prop="dutyTerritory">
<j-dict-select-tag class="box-input" v-model="formInline.dutyTerritory" <j-dict-select-tag class="box-input" v-model="formInline.dutyTerritory"
@@ -126,7 +127,7 @@
</div> </div>
<a-form-model-item class="itemModel-text" prop="description"> <a-form-model-item class="itemModel-text" prop="description">
<a-input class="box-input add-input" <a-input class="box-input add-input"
style='height: 95px; width: 100%' style="height: 95px; width: 100%"
type="textarea" type="textarea"
:disabled="disabled" :disabled="disabled"
v-model.trim="formInline.description" v-model.trim="formInline.description"
@@ -146,8 +147,8 @@
</div> </div>
<a-form-model-item class="itemModel-multi" prop="certCategory"> <a-form-model-item class="itemModel-multi" prop="certCategory">
<j-multi-select-tag-only-rz class="box-input" v-model="formInline.certCategory" <j-multi-select-tag-only-rz class="box-input" v-model="formInline.certCategory"
@change='Onchange' @change="Onchange"
v-on:changelabel='Onchangelabel' v-on:changelabel="Onchangelabel"
:disabled="disabled" :disabled="disabled"
:placeholder="$t('PleaseSelect')+$t('NcertificationCategory')" :placeholder="$t('PleaseSelect')+$t('NcertificationCategory')"
:type="'checkbox'" :type="'checkbox'"
@@ -156,7 +157,7 @@
</div> </div>
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="24" style='margin-top: 5px'> <a-row :gutter="24" style="margin-top: 5px">
<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">
@@ -179,15 +180,18 @@
</div> </div>
</a-col> </a-col>
<!-- 控件校验--> <!-- 控件校验-->
<a-col :span="12" v-if='this.formInline.controlType =="1" || this.formInline.controlType =="5" || this.formInline.controlType =="6" || this.formInline.controlType =="7" || this.formInline.controlType =="10"'> <a-col :span="12"
v-if='this.formInline.controlType =="1" || this.formInline.controlType =="5" || this.formInline.controlType =="6" || this.formInline.controlType =="7" || this.formInline.controlType =="10"'>
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required" v-if="!disabled">*</span> <span class="Required" v-if="!disabled">*</span>
<span class="title-text-text" :title="$t('NcontrolVerification')">{{$t('NcontrolVerification')}}</span> <span class="title-text-text"
:title="$t('NcontrolVerification')">{{ $t('NcontrolVerification') }}</span>
</div> </div>
<a-form-model-item class="itemModel" prop="controlVerify"> <a-form-model-item class="itemModel" prop="controlVerify">
<a-select :disabled="disabled" <a-select :disabled="disabled"
:placeholder="$t('PleaseSelect')+$t('NcontrolVerification')" allowClear v-model="formInline.controlVerify"> :placeholder="$t('PleaseSelect')+$t('NcontrolVerification')" allowClear
v-model="formInline.controlVerify">
<a-select-option v-for="(item, key) in controlVerification" :key="key" :value="item.value"> <a-select-option v-for="(item, key) in controlVerification" :key="key" :value="item.value">
<span style="display: inline-block;width: 100%" :title=" item.label "> <span style="display: inline-block;width: 100%" :title=" item.label ">
{{ item.label }} {{ item.label }}
@@ -217,7 +221,8 @@
</a-row> </a-row>
<!-- 控件备选值--> <!-- 控件备选值-->
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="12" v-if='this.formInline.controlType =="2" || this.formInline.controlType =="3" || this.formInline.controlType =="5" || this.formInline.controlType =="6" || this.formInline.controlType =="8" || this.formInline.controlType =="9" || this.formInline.controlType =="10"'> <a-col :span="12"
v-if='this.formInline.controlType =="2" || this.formInline.controlType =="3" || this.formInline.controlType =="5" || this.formInline.controlType =="6" || this.formInline.controlType =="8" || this.formInline.controlType =="9" || this.formInline.controlType =="10"'>
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required" v-if="!disabled">*</span> <span class="Required" v-if="!disabled">*</span>
@@ -237,7 +242,8 @@
<!-- 附件模板--> <!-- 附件模板-->
<a-col :span="12" v-if='this.formInline.controlType =="4" || this.formInline.controlType =="7" || this.formInline.controlType =="8" || this.formInline.controlType =="9" || this.formInline.controlType =="10"'> <a-col :span="12"
v-if='this.formInline.controlType =="4" || this.formInline.controlType =="7" || this.formInline.controlType =="8" || this.formInline.controlType =="9" || this.formInline.controlType =="10"'>
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="title-text-text" <span class="title-text-text"
@@ -257,7 +263,8 @@
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="24"> <a-col :span="24">
<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">
@@ -298,7 +305,7 @@
</div> </div>
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel">
<a-input class="box-input add-input" <a-input class="box-input add-input"
style='height: 95px; width: 100%' style="height: 95px; width: 100%"
:disabled="disabled" :disabled="disabled"
type="textarea" type="textarea"
:maxLength="1000" :maxLength="1000"
@@ -317,7 +324,8 @@
</a-spin> </a-spin>
<div class="drawer-bootom-button"> <div class="drawer-bootom-button">
<a-button style="margin-right: 8px" @click="handleCancel">{{ $t('cancel') }}</a-button> <a-button style="margin-right: 8px" @click="handleCancel">{{ $t('cancel') }}</a-button>
<a-button @click="handleSubmit" type="primary" v-if="!disabled" :loading="confirmLoading">{{$t('submit')}}</a-button> <a-button @click="handleSubmit" type="primary" v-if="!disabled" :loading="confirmLoading">{{ $t('submit') }}
</a-button>
</div> </div>
</a-drawer> </a-drawer>
<uploadFileChange :isParameter="true" ref="uploadFile" @uploadSuccess="uploadSuccess"></uploadFileChange> <uploadFileChange :isParameter="true" ref="uploadFile" @uploadSuccess="uploadSuccess"></uploadFileChange>
@@ -328,6 +336,7 @@
import PersonnelSelection from '@/components/PersonnelSelection/index' import PersonnelSelection from '@/components/PersonnelSelection/index'
import { getAction, postAction, downloadFile, putAction } from '@/api/manage' import { getAction, postAction, downloadFile, putAction } from '@/api/manage'
import uploadFileChange from '@/components/uploadFileChange/file' import uploadFileChange from '@/components/uploadFileChange/file'
export default { export default {
name: 'addModel', name: 'addModel',
components: { components: {
@@ -359,7 +368,7 @@ export default {
{ value: '8', label: this.$t('Dtext') }, { value: '8', label: this.$t('Dtext') },
{ value: '9', label: this.$t('Etext') }, { value: '9', label: this.$t('Etext') },
{ value: '10', label: this.$t('Ftext') }, { value: '10', label: this.$t('Ftext') },
{value:'11', label: this.$t('Gtext') }, { value: '11', label: this.$t('Gtext') }
], ],
controlVerification: [ // 控件校验 controlVerification: [ // 控件校验
{ value: '1', label: this.$t('Nnothing') }, { value: '1', label: this.$t('Nnothing') },
@@ -370,7 +379,7 @@ export default {
{ value: '6', label: this.$t('NOneDecimalPlace') }, { value: '6', label: this.$t('NOneDecimalPlace') },
{ value: '7', label: this.$t('NTwoDecimalplaces') }, { value: '7', label: this.$t('NTwoDecimalplaces') },
{ value: '8', label: this.$t('NThreedecimalplaces') }, { value: '8', label: this.$t('NThreedecimalplaces') },
{value:'9', label: this.$t('NFourDecimalplaces') }, { value: '9', label: this.$t('NFourDecimalplaces') }
], ],
CategoryTreeList: [], // 技术领域 CategoryTreeList: [], // 技术领域
certCategoryParamsInfoEOList: [], // 认证类别得tab栏 certCategoryParamsInfoEOList: [], // 认证类别得tab栏
@@ -392,29 +401,29 @@ export default {
// { 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: [ isMust: [
{ required: true, message: this.$t('PleaseEnter')+this.$t('Required'), trigger: 'change' }, { required: true, message: this.$t('PleaseEnter') + this.$t('Required'), trigger: 'change' }
], ],
paramsName: [ paramsName: [
{ required: true, message: this.$t('pleaseSelect') + this.$t('Paraname'), 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' }, { min: 1, max: 500, message: this.$t('cantExeed') + '500' + this.$t('characters'), trigger: 'blur' }
], ],
technologyTerritory: [ technologyTerritory: [
{ required: true, message: this.$t('pleaseSelect')+this.$t('technicalField'), trigger: 'change' }, { required: true, message: this.$t('pleaseSelect') + this.$t('technicalField'), trigger: 'change' }
], ],
paramsBatch: [ paramsBatch: [
{ required: true, message: this.$t('PleaseSelect')+this.$t('parameterBatch'), trigger: 'change' }, { required: true, message: this.$t('PleaseSelect') + this.$t('parameterBatch'), trigger: 'change' }
], ],
dutyTerritory: [ dutyTerritory: [
{ required: true, message: this.$t('PleaseSelect')+this.$t('areaOfResponsibility'), trigger: 'change' }, { required: true, message: this.$t('PleaseSelect') + this.$t('areaOfResponsibility'), trigger: 'change' }
], ],
description: [ 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: [ controlType: [
{ required: true, message: this.$t('pleaseSelect')+this.$t('controlType'), trigger: 'change' }, { required: true, message: this.$t('pleaseSelect') + this.$t('controlType'), trigger: 'change' }
], ],
controlVerify: [ controlVerify: [
{ required: true, message: this.$t('PleaseEnter')+this.$t('controlVerification'), trigger: 'change' }, { required: true, message: this.$t('PleaseEnter') + this.$t('controlVerification'), trigger: 'change' }
], ],
controlValues: [ controlValues: [
{ required: true, message: this.$t('PleaseEnter') + this.$t('controlAlternatives'), trigger: 'blur' }, { required: true, message: this.$t('PleaseEnter') + this.$t('controlAlternatives'), trigger: 'blur' },
@@ -423,8 +432,8 @@ export default {
], ],
titleDefaultValue: [ titleDefaultValue: [
{ required: true, message: this.$t('PleaseEnter') + this.$t('DefaultValue'), 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' }, { min: 1, max: 100, message: this.$t('cantExeed') + '100' + this.$t('characters'), trigger: 'blur' }
], ]
}, },
rulesItem: { rulesItem: {
paramsNumber: [ paramsNumber: [
@@ -442,7 +451,7 @@ export default {
inputChangelabel: false, // 控件备选值校验 inputChangelabel: false, // 控件备选值校验
buttonChangelabel: false, // 模板校验 buttonChangelabel: false, // 模板校验
contentListStart: [], // 认证类别编辑 contentListStart: [], // 认证类别编辑
flag: 1, // 判断师新增,编辑 默认新增 flag: 1 // 判断师新增,编辑 默认新增
} }
}, },
mounted() { mounted() {
@@ -474,7 +483,7 @@ export default {
certCategory: item.value, certCategory: item.value,
paramsNumber: item.paramsNumber, // 编号 paramsNumber: item.paramsNumber, // 编号
paramsName: item.paramsName, //参数名称 paramsName: item.paramsName, //参数名称
description: item.description, // 描述 description: item.description // 描述
} }
tt.push(Object.assign(obj, item)) tt.push(Object.assign(obj, item))
}) })
@@ -601,7 +610,7 @@ export default {
this.tabList = val.split(',') this.tabList = val.split(',')
this.arr.forEach(item => { this.arr.forEach(item => {
if (!this.tabList.includes(item)) { if (!this.tabList.includes(item)) {
newArray.push(item); newArray.push(item)
this.contentList.forEach((item1, index1) => { this.contentList.forEach((item1, index1) => {
if (item == item1.certCategory) { if (item == item1.certCategory) {
item1.paramsNumber = '', // 编号 item1.paramsNumber = '', // 编号
@@ -610,7 +619,8 @@ export default {
} }
}) })
console.log(this.contentList) console.log(this.contentList)
}; }
}) })
}, },
@@ -791,6 +801,11 @@ export default {
} }
}) })
let querycontentList = JSON.parse(JSON.stringify(this.contentList)) 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 query.certCategoryParamsInfoEOList = querycontentList
// if(this.formInline.controlType == 11){ // if(this.formInline.controlType == 11){
// query.certCategoryParamsInfoEOList = [] // query.certCategoryParamsInfoEOList = []
@@ -825,7 +840,7 @@ export default {
this.formInline = { ...this.formInline } this.formInline = { ...this.formInline }
}, },
projectNameChange(value) { projectNameChange(value) {
}, }
} }
} }
</script> </script>
@@ -833,9 +848,11 @@ export default {
.formAdd .ant-form-item-label { .formAdd .ant-form-item-label {
width: 130px; width: 130px;
} }
/deep/ .add-input { /deep/ .add-input {
min-height: 95px !important; min-height: 95px !important;
} }
.formAdd .ant-form-item-control-wrapper { .formAdd .ant-form-item-control-wrapper {
display: inline-block; display: inline-block;
width: 100%; width: 100%;
@@ -886,9 +903,11 @@ export default {
display: flex; display: flex;
/*align-items: center;*/ /*align-items: center;*/
} }
/deep/ .ant-form-item-control { /deep/ .ant-form-item-control {
line-height: 10px; line-height: 10px;
} }
.title-text { .title-text {
width: 114px; width: 114px;
text-align: right; text-align: right;
@@ -908,11 +927,13 @@ export default {
height: 38px; height: 38px;
width: 100%; width: 100%;
} }
.itemModel-text { .itemModel-text {
width: calc(100% - 130px); width: calc(100% - 130px);
display: inline-block; display: inline-block;
margin-top: 2px; margin-top: 2px;
} }
.itemModel { .itemModel {
width: calc(100% - 130px); width: calc(100% - 130px);
display: inline-block; display: inline-block;
@@ -951,6 +972,7 @@ export default {
.ant-input-disabled { .ant-input-disabled {
color: rgba(0, 0, 0, 0.65) !important; color: rgba(0, 0, 0, 0.65) !important;
} }
.ant-select-disabled { .ant-select-disabled {
color: rgba(0, 0, 0, 0.65) !important; color: rgba(0, 0, 0, 0.65) !important;
} }