From 711e25bb836bbf5a54b56945d1998e8e97842825 Mon Sep 17 00:00:00 2001 From: "xinxin.wu" Date: Wed, 17 Jul 2024 10:43:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=87=AA=E5=8A=A8=E7=94=9F=E6=88=90=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E6=8A=A5=E5=91=8A=E7=BC=96=E8=BE=91=E6=8A=A5=E5=91=8A?= =?UTF-8?q?=E6=80=BB=E7=BB=93=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/detail/component/viewReport.vue | 38 ++++++++++++++----- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/frontend/src/views/test-plan/report/detail/component/viewReport.vue b/frontend/src/views/test-plan/report/detail/component/viewReport.vue index e19d42727a..d1de70c682 100644 --- a/frontend/src/views/test-plan/report/detail/component/viewReport.vue +++ b/frontend/src/views/test-plan/report/detail/component/viewReport.vue @@ -174,11 +174,7 @@ /> (false); + watchEffect(() => { if (props.detailInfo) { detail.value = cloneDeep(props.detailInfo); - richText.value.summary = detail.value.summary; - reportForm.value.reportName = detail.value.name; + const { defaultLayout, id, name, summary } = detail.value; + isDefaultLayout.value = defaultLayout; + richText.value.summary = summary; + reportForm.value.reportName = name; initOptionsData(); if (props.isPreview) { - if (!detail.value.defaultLayout && detail.value.id) { + if (!defaultLayout && id) { getDefaultLayout(); } else { innerCardList.value = props.isGroup ? cloneDeep(defaultGroupConfig) : cloneDeep(defaultSingleConfig); @@ -496,6 +496,22 @@ } }); + // 获取内容详情 + function getContent(item: configItem): customValueForm { + if (isDefaultLayout.value) { + return { + content: richText.value.summary || '', + label: t(item.label), + richTextTmpFileIds: [], + }; + } + return { + content: item.content || '', + label: t(item.label), + richTextTmpFileIds: item.richTextTmpFileIds, + }; + } + onMounted(async () => { nextTick(() => { const editorContent = document.querySelector('.editor-content'); @@ -516,7 +532,11 @@ } function handleSummary(content: string, cardItem: configItem) { - cardItem.content = content; + if (isDefaultLayout.value) { + richText.value.summary = content; + } else { + cardItem.content = content; + } } const currentMode = ref('drawer');