From 8c1136eb865ce7261dedb6c8a753ff9008f8d96d Mon Sep 17 00:00:00 2001 From: baiqi Date: Fri, 13 Sep 2024 11:11:45 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=8A=A5=E5=91=8A):=20=E6=8A=A5=E5=91=8A?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=A2=9E=E5=8A=A0=E5=AF=BC=E5=87=BA=E6=8C=89?= =?UTF-8?q?=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/modules/api-test/management.ts | 10 +++++-- frontend/src/api/modules/api-test/scenario.ts | 11 ++++++-- frontend/src/api/modules/test-plan/report.ts | 12 +++++++-- .../src/api/requrls/api-test/management.ts | 1 + frontend/src/api/requrls/api-test/scenario.ts | 1 + frontend/src/api/requrls/test-plan/report.ts | 4 +++ .../report/component/caseReportDrawer.vue | 2 +- .../report/component/reportDetailDrawer.vue | 2 +- .../api-test/report/component/reportList.vue | 27 ++++++++++++++----- .../views/api-test/report/exportCasePDF.vue | 4 +-- .../api-test/report/exportScenarioPDF.vue | 4 +-- .../test-plan/report/component/reportList.vue | 26 +++++++++++++----- .../system-card/planDetailHeaderRight.vue | 1 + .../test-plan/report/detail/exportPDF.vue | 6 +++++ 14 files changed, 86 insertions(+), 25 deletions(-) diff --git a/frontend/src/api/modules/api-test/management.ts b/frontend/src/api/modules/api-test/management.ts index bc20fe4c12..c1093e9abe 100644 --- a/frontend/src/api/modules/api-test/management.ts +++ b/frontend/src/api/modules/api-test/management.ts @@ -19,6 +19,7 @@ import { BatchRecoverApiUrl, BatchRecoverCaseUrl, BatchUpdateDefinitionUrl, + CaseBatchExportLogUrl, CaseExportLogUrl, CasePageUrl, caseTableBatchSyncUrl, @@ -620,6 +621,11 @@ export function exportApiDefinition(data: ApiDefinitionBatchExportParams, type: } // 接口用例导出报告日志记录 -export function logCaseExport(reportId: string) { - return MSR.get({ url: `${CaseExportLogUrl}/${reportId}` }); +export function logCaseReportExport(reportId: string) { + return MSR.post({ url: `${CaseExportLogUrl}/${reportId}` }); +} + +// 接口用例导出报告日志记录 +export function logCaseReportBatchExport(data: BatchApiParams) { + return MSR.post({ url: `${CaseBatchExportLogUrl}`, data }); } diff --git a/frontend/src/api/modules/api-test/scenario.ts b/frontend/src/api/modules/api-test/scenario.ts index 414db1933b..5f42a7161b 100644 --- a/frontend/src/api/modules/api-test/scenario.ts +++ b/frontend/src/api/modules/api-test/scenario.ts @@ -29,6 +29,7 @@ import { MoveModuleUrl, RecoverScenarioUrl, RecycleScenarioUrl, + ScenarioBatchExportLogUrl, ScenarioExportLogUrl, ScenarioHistoryUrl, ScenarioPageUrl, @@ -69,6 +70,7 @@ import { } from '@/models/apiTest/scenario'; import { AddModuleParams, + type BatchApiParams, CommonList, DragSortParams, ModuleTreeNode, @@ -307,6 +309,11 @@ export function getStepProjectInfo(id: string, type: ScenarioStepType) { } // 场景导出报告日志记录 -export function logScenarioExport(reportId: string) { - return MSR.get({ url: `${ScenarioExportLogUrl}/${reportId}` }); +export function logScenarioReportExport(reportId: string) { + return MSR.post({ url: `${ScenarioExportLogUrl}/${reportId}` }); +} + +// 场景导出报告日志记录 +export function logScenarioReportBatchExport(data: BatchApiParams) { + return MSR.post({ url: `${ScenarioBatchExportLogUrl}`, data }); } diff --git a/frontend/src/api/modules/test-plan/report.ts b/frontend/src/api/modules/test-plan/report.ts index 305a8006e5..8baa6dc264 100644 --- a/frontend/src/api/modules/test-plan/report.ts +++ b/frontend/src/api/modules/test-plan/report.ts @@ -3,7 +3,7 @@ import * as reportUrl from '@/api/requrls/test-plan/report'; import type { GetShareId } from '@/models/apiTest/report'; import { ReportDetail, ReportStepDetail } from '@/models/apiTest/report'; -import { CommonList, TableQueryParams } from '@/models/common'; +import { type BatchApiParams, CommonList, TableQueryParams } from '@/models/common'; import { ApiOrScenarioCaseItem, FeatureCaseItem, @@ -173,4 +173,12 @@ export function getReportLayout(reportId: string, shareId?: string) { return MSR.get({ url: `${reportUrl.getReportLayoutUrl}/${reportId}` }); } -export default {}; +// 导出报告日志 +export function logTestPlanReportExport(reportId: string) { + return MSR.post({ url: `${reportUrl.TestPlanReportExportUrl}/${reportId}` }); +} + +// 批量导出报告日志 +export function logTestPlanReportBatchExport(data: BatchApiParams) { + return MSR.post({ url: reportUrl.TestPlanBatchReportExportUrl, data }); +} diff --git a/frontend/src/api/requrls/api-test/management.ts b/frontend/src/api/requrls/api-test/management.ts index cc1d39b25f..f21298cc53 100644 --- a/frontend/src/api/requrls/api-test/management.ts +++ b/frontend/src/api/requrls/api-test/management.ts @@ -97,6 +97,7 @@ export const RunCaseUrl = '/api/case/run'; // 执行接口用例 export const GetCaseReportByIdUrl = '/api/report/case/get/'; // 接口用例报告获取 export const GetCaseReportDetailUrl = '/api/report/case/get/detail/'; // 接口用例报告获取 export const CaseExportLogUrl = '/api/report/case/export'; // 接口用例导出报告日志记录 +export const CaseBatchExportLogUrl = '/api/report/case/batch-export'; // 接口用例批量导出报告日志记录 /** * 接口用例回收站 diff --git a/frontend/src/api/requrls/api-test/scenario.ts b/frontend/src/api/requrls/api-test/scenario.ts index 14700f5403..e046ddbbd6 100644 --- a/frontend/src/api/requrls/api-test/scenario.ts +++ b/frontend/src/api/requrls/api-test/scenario.ts @@ -42,3 +42,4 @@ export const BatchDeleteScenarioUrl = '/api/scenario/batch-operation/delete'; export const ExecuteHistoryUrl = '/api/scenario/execute/page'; // 场景执行历史 export const ScenarioHistoryUrl = '/api/scenario/operation-history/page'; // 场景变更历史 export const ScenarioExportLogUrl = '/api/report/scenario/export'; // 场景导出报告日志记录 +export const ScenarioBatchExportLogUrl = '/api/report/scenario/batch-export'; // 场景批量导出报告日志记录 diff --git a/frontend/src/api/requrls/test-plan/report.ts b/frontend/src/api/requrls/test-plan/report.ts index 5eb20cec46..4dd0a3dc23 100644 --- a/frontend/src/api/requrls/test-plan/report.ts +++ b/frontend/src/api/requrls/test-plan/report.ts @@ -68,3 +68,7 @@ export const ManualReportGenUrl = '/test-plan/report/manual-gen'; export const getReportLayoutUrl = '/test-plan/report/get-layout'; // 测试计划-报告-详情-获取报告布局-分享 export const getReportShareLayoutUrl = '/test-plan/report/share/get-layout'; +// 测试计划-报告-导出日志 +export const TestPlanReportExportUrl = '/test-plan/report/export'; +// 测试计划-报告-批量导出日志 +export const TestPlanBatchReportExportUrl = '/test-plan/report/batch-export'; diff --git a/frontend/src/views/api-test/report/component/caseReportDrawer.vue b/frontend/src/views/api-test/report/component/caseReportDrawer.vue index 1039764bb5..973ff25546 100644 --- a/frontend/src/views/api-test/report/component/caseReportDrawer.vue +++ b/frontend/src/views/api-test/report/component/caseReportDrawer.vue @@ -44,7 +44,7 @@ class="mr-4 !rounded-[var(--border-radius-small)]" @click="exportHandler" > - + {{ t('common.export') }} diff --git a/frontend/src/views/api-test/report/component/reportDetailDrawer.vue b/frontend/src/views/api-test/report/component/reportDetailDrawer.vue index 48aa80fc42..f954319e75 100644 --- a/frontend/src/views/api-test/report/component/reportDetailDrawer.vue +++ b/frontend/src/views/api-test/report/component/reportDetailDrawer.vue @@ -36,7 +36,7 @@ class="mr-4 !rounded-[var(--border-radius-small)]" @click="exportHandler" > - + {{ t('common.export') }} diff --git a/frontend/src/views/api-test/report/component/reportList.vue b/frontend/src/views/api-test/report/component/reportList.vue index 57dad902f2..4148e5c9bb 100644 --- a/frontend/src/views/api-test/report/component/reportList.vue +++ b/frontend/src/views/api-test/report/component/reportList.vue @@ -71,12 +71,12 @@ {{ dayjs(record.operationTime).format('YYYY-MM-DD HH:mm:ss') }} { showDetail(); getTime(); diff --git a/frontend/src/views/api-test/report/exportCasePDF.vue b/frontend/src/views/api-test/report/exportCasePDF.vue index fd4ddbd56f..2e4b70b973 100644 --- a/frontend/src/views/api-test/report/exportCasePDF.vue +++ b/frontend/src/views/api-test/report/exportCasePDF.vue @@ -13,7 +13,7 @@ import CaseReportCom from './component/caseReportCom.vue'; - import { logCaseExport } from '@/api/modules/api-test/management'; + import { logCaseReportExport } from '@/api/modules/api-test/management'; import { reportCaseDetail } from '@/api/modules/api-test/report'; import { useI18n } from '@/hooks/useI18n'; import exportPDF from '@/utils/exportPdf'; @@ -45,7 +45,7 @@ async function logExport() { try { - await logCaseExport(route.query.id as string); + await logCaseReportExport(route.query.id as string); } catch (error) { // eslint-disable-next-line no-console console.log(error); diff --git a/frontend/src/views/api-test/report/exportScenarioPDF.vue b/frontend/src/views/api-test/report/exportScenarioPDF.vue index 83fe78919e..13cf08a4b9 100644 --- a/frontend/src/views/api-test/report/exportScenarioPDF.vue +++ b/frontend/src/views/api-test/report/exportScenarioPDF.vue @@ -14,7 +14,7 @@ import ScenarioCom from './component/scenarioCom.vue'; import { reportScenarioDetail } from '@/api/modules/api-test/report'; - import { logScenarioExport } from '@/api/modules/api-test/scenario'; + import { logScenarioReportExport } from '@/api/modules/api-test/scenario'; import { useI18n } from '@/hooks/useI18n'; import exportPDF from '@/utils/exportPdf'; @@ -45,7 +45,7 @@ async function logExport() { try { - await logScenarioExport(route.query.id as string); + await logScenarioReportExport(route.query.id as string); } catch (error) { // eslint-disable-next-line no-console console.log(error); diff --git a/frontend/src/views/test-plan/report/component/reportList.vue b/frontend/src/views/test-plan/report/component/reportList.vue index d55d72b9b9..6b3b3cc8a8 100644 --- a/frontend/src/views/test-plan/report/component/reportList.vue +++ b/frontend/src/views/test-plan/report/component/reportList.vue @@ -80,20 +80,22 @@ {{ dayjs(record.operationTime).format('YYYY-MM-DD HH:mm:ss') }}