From 7956aa5b42d0ba82bf095eac5a862c5e3f7e49a7 Mon Sep 17 00:00:00 2001 From: baiqi Date: Tue, 19 Nov 2024 19:04:53 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E4=BB=BB=E5=8A=A1=E4=B8=AD=E5=BF=83):=20?= =?UTF-8?q?=20=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/modules/test-plan/report.ts | 5 +- frontend/src/api/requrls/test-plan/report.ts | 2 + .../caseAndScenarioReportDrawer.vue | 22 +- .../taskCenter/component/caseTaskTable.vue | 22 +- .../component/testPlanExecuteResultDrawer.vue | 417 ++++++++++++++++++ .../system-card/ReportMetricsItem.vue | 5 +- .../component/system-card/executeAnalysis.vue | 12 +- 7 files changed, 463 insertions(+), 22 deletions(-) create mode 100644 frontend/src/views/taskCenter/component/testPlanExecuteResultDrawer.vue diff --git a/frontend/src/api/modules/test-plan/report.ts b/frontend/src/api/modules/test-plan/report.ts index 2a6808f1f3..92acaf0642 100644 --- a/frontend/src/api/modules/test-plan/report.ts +++ b/frontend/src/api/modules/test-plan/report.ts @@ -209,4 +209,7 @@ export function getCollectScenarioPage(data: TableQueryParams) { return MSR.post>({ url: `${reportUrl.getCollectScenarioUrl}`, data }); } -export default {}; +// 测试计划-获取执行结果 +export function getTestPlanResult(id: string) { + return MSR.get({ url: `${reportUrl.GetTestPlanResultUrl}/${id}` }); +} diff --git a/frontend/src/api/requrls/test-plan/report.ts b/frontend/src/api/requrls/test-plan/report.ts index aa6751d77f..7cc9080322 100644 --- a/frontend/src/api/requrls/test-plan/report.ts +++ b/frontend/src/api/requrls/test-plan/report.ts @@ -86,3 +86,5 @@ export const getShareCollectFunctionalUrl = '/test-plan/report/share/detail/func export const getShareCollectionApiUrl = '/test-plan/report/share/detail/api/collection/page'; // 测试计划-报告-详情-分享-报告-场景明细-测试点 export const getShareCollectScenarioUrl = '/test-plan/report/share/detail/scenario/collection/page'; +// 任务中心-测试计划执行结果 +export const GetTestPlanResultUrl = '/test-plan/report/get-result'; diff --git a/frontend/src/views/api-test/components/caseAndScenarioReportDrawer.vue b/frontend/src/views/api-test/components/caseAndScenarioReportDrawer.vue index 198d89c5e5..bdfb554c7d 100644 --- a/frontend/src/views/api-test/components/caseAndScenarioReportDrawer.vue +++ b/frontend/src/views/api-test/components/caseAndScenarioReportDrawer.vue @@ -40,12 +40,14 @@ - - + + + + @@ -128,8 +130,11 @@ const reportStepDetail = ref({ ...initReportStepDetail, }); + const loading = ref(false); + async function getReportDetail() { try { + loading.value = true; if (props.reportDetail) { reportStepDetail.value = await props.reportDetail(props.reportId, route.query.shareId as string | undefined); return; @@ -142,6 +147,8 @@ } catch (error) { // eslint-disable-next-line no-console console.log(error); + } finally { + loading.value = false; } } @@ -152,6 +159,9 @@ reportStepDetail.value = { ...initReportStepDetail }; await getReportDetail(); } + }, + { + immediate: true, } ); diff --git a/frontend/src/views/taskCenter/component/caseTaskTable.vue b/frontend/src/views/taskCenter/component/caseTaskTable.vue index ea0b79543e..2db1ccdb56 100644 --- a/frontend/src/views/taskCenter/component/caseTaskTable.vue +++ b/frontend/src/views/taskCenter/component/caseTaskTable.vue @@ -70,7 +70,7 @@ {{ t('ms.taskCenter.rerun') }} - {{ t('ms.taskCenter.checkReport') }} + {{ t('ms.taskCenter.executeResult') }} @@ -108,6 +108,11 @@ }" :share-time="shareTime" /> + + + + + diff --git a/frontend/src/views/test-plan/report/detail/component/system-card/ReportMetricsItem.vue b/frontend/src/views/test-plan/report/detail/component/system-card/ReportMetricsItem.vue index 6622af6d4a..f933e66a1e 100644 --- a/frontend/src/views/test-plan/report/detail/component/system-card/ReportMetricsItem.vue +++ b/frontend/src/views/test-plan/report/detail/component/system-card/ReportMetricsItem.vue @@ -46,7 +46,10 @@ padding: 4px 8px; border-radius: 4px; background-color: var(--color-text-n9); - @apply mb-3 flex items-center justify-between; + @apply flex items-center justify-between; + &:not(:last-child) { + margin-bottom: 12px; + } .report-analysis-item-icon { @apply flex items-center; } diff --git a/frontend/src/views/test-plan/report/detail/component/system-card/executeAnalysis.vue b/frontend/src/views/test-plan/report/detail/component/system-card/executeAnalysis.vue index 9c23875fbd..92832d075f 100644 --- a/frontend/src/views/test-plan/report/detail/component/system-card/executeAnalysis.vue +++ b/frontend/src/views/test-plan/report/detail/component/system-card/executeAnalysis.vue @@ -1,5 +1,5 @@