From 5bd094d3a87c4bf3297a01a253d7d09ccfca70d4 Mon Sep 17 00:00:00 2001 From: "xinxin.wu" Date: Tue, 16 Jul 2024 15:08:06 +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=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E6=8A=A5?= =?UTF-8?q?=E5=91=8A=E9=A2=84=E8=A7=88=E5=88=9D=E5=A7=8B=E5=8C=96=E4=B8=8D?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE=E7=B4=A7=E6=80=A5bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/config/vite.config.dev.ts | 5 +++++ .../component/custom-card/customRichText.vue | 2 ++ .../system-card/apiAndScenarioTable.vue | 20 ++++++++++++------- .../detail/component/system-card/bugTable.vue | 18 +++++++++++------ .../system-card/featureCaseTable.vue | 18 +++++++++++------ .../system-card/reportDetailTable.vue | 18 +++++++++++------ 6 files changed, 56 insertions(+), 25 deletions(-) diff --git a/frontend/config/vite.config.dev.ts b/frontend/config/vite.config.dev.ts index 5a86a4c461..7ead8b015c 100644 --- a/frontend/config/vite.config.dev.ts +++ b/frontend/config/vite.config.dev.ts @@ -41,6 +41,11 @@ export default mergeConfig( changeOrigin: true, rewrite: (path: string) => path.replace(/^\/front\/bug\/attachment/, ''), }, + '/test-plan/report': { + target: process.env.VITE_DEV_DOMAIN, + changeOrigin: true, + rewrite: (path: string) => path.replace(/^\/front\/test-plan\/report/, ''), + }, '/plugin/image': { target: process.env.VITE_DEV_DOMAIN, changeOrigin: true, diff --git a/frontend/src/views/test-plan/report/detail/component/custom-card/customRichText.vue b/frontend/src/views/test-plan/report/detail/component/custom-card/customRichText.vue index aa362e62cc..4224435da0 100644 --- a/frontend/src/views/test-plan/report/detail/component/custom-card/customRichText.vue +++ b/frontend/src/views/test-plan/report/detail/component/custom-card/customRichText.vue @@ -21,6 +21,7 @@ v-model:raw="innerTextForm.content" v-model:filedIds="innerTextForm.richTextTmpFileIds" :upload-image="handleUploadImage" + :preview-url="ReportPlanPreviewImageUrl" class="mt-[8px] w-full" :editable="props.canEdit" @click="handleClick" @@ -41,6 +42,7 @@ import MsRichText from '@/components/pure/ms-rich-text/MsRichText.vue'; import { editorUploadFile } from '@/api/modules/test-plan/report'; + import { ReportPlanPreviewImageUrl } from '@/api/requrls/test-plan/report'; import useDoubleClick from '@/hooks/useDoubleClick'; import { useI18n } from '@/hooks/useI18n'; import { hasAnyPermission } from '@/utils/permission'; diff --git a/frontend/src/views/test-plan/report/detail/component/system-card/apiAndScenarioTable.vue b/frontend/src/views/test-plan/report/detail/component/system-card/apiAndScenarioTable.vue index a819f3bc68..93c0968971 100644 --- a/frontend/src/views/test-plan/report/detail/component/system-card/apiAndScenarioTable.vue +++ b/frontend/src/views/test-plan/report/detail/component/system-card/apiAndScenarioTable.vue @@ -186,12 +186,18 @@ } } - onMounted(() => { - if (props.reportId && props.isPreview) { - currentCaseTable.value.resetPagination(); - loadCaseList(); - } else { - currentCaseTable.value.propsRes.value.data = detailTableExample[props.activeType]; + watch( + [() => props.reportId, () => props.isPreview], + () => { + if (props.reportId && props.isPreview) { + currentCaseTable.value.resetPagination(); + loadCaseList(); + } else { + currentCaseTable.value.propsRes.value.data = detailTableExample[props.activeType]; + } + }, + { + immediate: true, } - }); + ); diff --git a/frontend/src/views/test-plan/report/detail/component/system-card/bugTable.vue b/frontend/src/views/test-plan/report/detail/component/system-card/bugTable.vue index a8707e8d80..5a4938fcd5 100644 --- a/frontend/src/views/test-plan/report/detail/component/system-card/bugTable.vue +++ b/frontend/src/views/test-plan/report/detail/component/system-card/bugTable.vue @@ -84,11 +84,17 @@ loadList(); } - onMounted(() => { - if (props.reportId && props.isPreview) { - loadCaseList(); - } else { - propsRes.value.data = detailTableExample[ReportCardTypeEnum.BUG_DETAIL]; + watch( + [() => props.reportId, () => props.isPreview], + () => { + if (props.reportId && props.isPreview) { + loadCaseList(); + } else { + propsRes.value.data = detailTableExample[ReportCardTypeEnum.BUG_DETAIL]; + } + }, + { + immediate: true, } - }); + ); diff --git a/frontend/src/views/test-plan/report/detail/component/system-card/featureCaseTable.vue b/frontend/src/views/test-plan/report/detail/component/system-card/featureCaseTable.vue index 8183dc800e..cda2d1960f 100644 --- a/frontend/src/views/test-plan/report/detail/component/system-card/featureCaseTable.vue +++ b/frontend/src/views/test-plan/report/detail/component/system-card/featureCaseTable.vue @@ -163,13 +163,19 @@ loadList(); } - onMounted(() => { - if (props.reportId && props.isPreview) { - loadCaseList(); - } else { - propsRes.value.data = detailTableExample[ReportCardTypeEnum.FUNCTIONAL_DETAIL]; + watch( + [() => props.reportId, () => props.isPreview], + () => { + if (props.reportId && props.isPreview) { + loadCaseList(); + } else { + propsRes.value.data = detailTableExample[ReportCardTypeEnum.FUNCTIONAL_DETAIL]; + } + }, + { + immediate: true, } - }); + ); const showDetailVisible = ref(false); diff --git a/frontend/src/views/test-plan/report/detail/component/system-card/reportDetailTable.vue b/frontend/src/views/test-plan/report/detail/component/system-card/reportDetailTable.vue index b6c53a8f9c..ff443073da 100644 --- a/frontend/src/views/test-plan/report/detail/component/system-card/reportDetailTable.vue +++ b/frontend/src/views/test-plan/report/detail/component/system-card/reportDetailTable.vue @@ -143,13 +143,19 @@ loadList(); } - onMounted(() => { - if (props.reportId && props.isPreview) { - loadReportDetailList(); - } else { - propsRes.value.data = detailTableExample[ReportCardTypeEnum.SUB_PLAN_DETAIL]; + watch( + [() => props.reportId, () => props.isPreview], + () => { + if (props.reportId && props.isPreview) { + loadReportDetailList(); + } else { + propsRes.value.data = detailTableExample[ReportCardTypeEnum.SUB_PLAN_DETAIL]; + } + }, + { + immediate: true, } - }); + ); const reportVisible = ref(false);