diff --git a/src/views/standardRegulationLibrary/commonPage/StandardDetailPage.vue b/src/views/standardRegulationLibrary/commonPage/StandardDetailPage.vue index 9c0d77f9..ac3e8682 100644 --- a/src/views/standardRegulationLibrary/commonPage/StandardDetailPage.vue +++ b/src/views/standardRegulationLibrary/commonPage/StandardDetailPage.vue @@ -229,8 +229,8 @@ export default { return func } }, - created () { - this.initForm() + async created () { + await this.initForm() this.initDetailData() }, methods: { @@ -238,14 +238,25 @@ export default { * 获取页面字段 */ initForm () { - this.operateApiFunc.getFormFunc({ type: 1 }).then(res => { - if (res.success) { - const data = res.result || {} - this.partList = Object.keys(data) - this.form = data - } else { - this.$message.warn(res.message) - } + return new Promise(resolve => { + this.operateApiFunc.getFormFunc({ type: 1 }).then(res => { + if (res.success) { + const data = res.result || {} + this.partList = Object.keys(data) + const formList = Object.values(data).reduce((acc, cur) => acc.concat(cur), []) + this.fileField = [] + formList.forEach(item => { + if (item.fieldShowType === FieldType.FILE_UP.value) { + this.fileField.push(item.dbFieldName) + } + }) + this.form = data + } else { + this.$message.warn(res.message) + } + }).finally(() => { + resolve() + }) }) }, // 获取数据