From 8ba6de40aa5b0969a372899e9af3a2cd2a22bd7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=9C=84?= Date: Mon, 25 Sep 2023 17:49:01 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=9B=BD=E5=86=85=E3=80=81=E6=B5=B7?= =?UTF-8?q?=E5=A4=96=E6=A0=87=E5=87=86=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commonPage/StandardDetailPage.vue | 31 +++++++++++++------ 1 file changed, 21 insertions(+), 10 deletions(-) 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() + }) }) }, // 获取数据