diff --git a/frontend/src/api/modules/api-test/management.ts b/frontend/src/api/modules/api-test/management.ts index 324c4f02fa..bc20fe4c12 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, + CaseExportLogUrl, CasePageUrl, caseTableBatchSyncUrl, CheckDefinitionScheduleUrl, @@ -95,8 +96,6 @@ import { UploadTempFileUrl, UploadTempMockFileUrl, } from '@/api/requrls/api-test/management'; -import { StopCaseExportUrl } from '@/api/requrls/case-management/featureCase'; -import { BatchDownloadFileUrl } from '@/api/requrls/project-management/fileManagement'; import { ApiCaseReportDetail, ExecuteRequestParams } from '@/models/apiTest/common'; import { @@ -619,3 +618,8 @@ export function getCaseReportDetail(reportId: string, stepId: string) { export function exportApiDefinition(data: ApiDefinitionBatchExportParams, type: string) { return MSR.post({ url: `${ExportDefinitionUrl}/${type}`, data }); } + +// 接口用例导出报告日志记录 +export function logCaseExport(reportId: string) { + return MSR.get({ url: `${CaseExportLogUrl}/${reportId}` }); +} diff --git a/frontend/src/api/modules/api-test/scenario.ts b/frontend/src/api/modules/api-test/scenario.ts index 1f77c180df..414db1933b 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, + ScenarioExportLogUrl, ScenarioHistoryUrl, ScenarioPageUrl, ScenarioScheduleConfigDeleteUrl, @@ -304,3 +305,8 @@ export function updateScenarioPro(id: string | number, priority: CaseLevel | und export function getStepProjectInfo(id: string, type: ScenarioStepType) { return MSR.get({ url: `${GetStepProjectInfoUrl}/${id}`, params: { resourceType: type } }); } + +// 场景导出报告日志记录 +export function logScenarioExport(reportId: string) { + return MSR.get({ url: `${ScenarioExportLogUrl}/${reportId}` }); +} diff --git a/frontend/src/api/requrls/api-test/management.ts b/frontend/src/api/requrls/api-test/management.ts index d696d68973..cc1d39b25f 100644 --- a/frontend/src/api/requrls/api-test/management.ts +++ b/frontend/src/api/requrls/api-test/management.ts @@ -96,6 +96,7 @@ export const ToggleFollowCaseUrl = '/api/case/follow'; // 接口定义-关注/ 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'; // 接口用例导出报告日志记录 /** * 接口用例回收站 diff --git a/frontend/src/api/requrls/api-test/scenario.ts b/frontend/src/api/requrls/api-test/scenario.ts index 202ff9592e..14700f5403 100644 --- a/frontend/src/api/requrls/api-test/scenario.ts +++ b/frontend/src/api/requrls/api-test/scenario.ts @@ -41,3 +41,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'; // 场景导出报告日志记录 diff --git a/frontend/src/views/api-test/components/caseAndScenarioReportDrawer.vue b/frontend/src/views/api-test/components/caseAndScenarioReportDrawer.vue index 94ce2b4d69..b71413c106 100644 --- a/frontend/src/views/api-test/components/caseAndScenarioReportDrawer.vue +++ b/frontend/src/views/api-test/components/caseAndScenarioReportDrawer.vue @@ -29,7 +29,7 @@ { if (route.query.id) { initReportDetail(); + logExport(); } }); diff --git a/frontend/src/views/api-test/report/exportScenarioPDF.vue b/frontend/src/views/api-test/report/exportScenarioPDF.vue index 298b2b7d4f..83fe78919e 100644 --- a/frontend/src/views/api-test/report/exportScenarioPDF.vue +++ b/frontend/src/views/api-test/report/exportScenarioPDF.vue @@ -14,6 +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 { useI18n } from '@/hooks/useI18n'; import exportPDF from '@/utils/exportPdf'; @@ -42,9 +43,19 @@ } } + async function logExport() { + try { + await logScenarioExport(route.query.id as string); + } catch (error) { + // eslint-disable-next-line no-console + console.log(error); + } + } + onBeforeMount(() => { if (route.query.id) { initReportDetail(); + logExport(); } }); diff --git a/frontend/src/views/test-plan/report/detail/component/system-card/planDetailHeaderRight.vue b/frontend/src/views/test-plan/report/detail/component/system-card/planDetailHeaderRight.vue index 5918b3053e..4919e550cf 100644 --- a/frontend/src/views/test-plan/report/detail/component/system-card/planDetailHeaderRight.vue +++ b/frontend/src/views/test-plan/report/detail/component/system-card/planDetailHeaderRight.vue @@ -27,7 +27,13 @@ {{ t('common.share') }} - + {{ t('report.detail.exportPdf') }}