update 国内标准-编辑完善,AddForm组件完善

This commit is contained in:
赵霄
2023-09-13 17:48:01 +08:00
parent f42ecf2832
commit b159585660
6 changed files with 66 additions and 24 deletions
@@ -14,9 +14,9 @@
<add-form ref="addForm"
:get-form-func="getFormFunc"
:get-document-info-func="getDocumentInfoFunc"
:special-placeholder="{
standard_number: `${$t('standardRegulationLibrary.inputExample')}7258`
}"
:special-placeholder="specialPlaceholder"
:default-value="defaultValue"
:disabled-field-list="disabledField"
@submitFormData="submitFormData" />
</a-spin>
</div>
@@ -50,18 +50,39 @@ export default {
form: {},
confirmLoading: false,
getFormFunc: getDomesticStandardFormModal,
getDocumentInfoFunc: getDomesticStandardDocumentInfo
getDocumentInfoFunc: getDomesticStandardDocumentInfo,
// 特殊的placeholder
specialPlaceholder: {
standard_number: `${this.$t('standardRegulationLibrary.inputExample')}7258`
},
defaultValue: {
year_number: new Date().getFullYear()
},
isEdit: null // 是否编辑
}
},
computed: {
// 不可编辑的字段
disabledField () {
console.log(this.isEdit)
if (this.isEdit) {
// 标准编号,被代替标准号,被引用标准号
return ['standard_number', 'replaced_by_standard_number', 'referenced_standard']
}
return ['replaced_by_standard_number', 'referenced_standard']
}
},
methods: {
add () {
this.visible = true
this.isEdit = false
this.$nextTick(() => {
this.$refs.addForm.add()
})
},
edit (record) {
this.visible = true
this.isEdit = true
this.$nextTick(() => {
this.$refs.addForm.edit(record)
})