diff --git a/backend/src/main/java/io/metersphere/api/controller/APIScenarioReportController.java b/backend/src/main/java/io/metersphere/api/controller/APIScenarioReportController.java index d1989a3d9d..04c93eb1c8 100644 --- a/backend/src/main/java/io/metersphere/api/controller/APIScenarioReportController.java +++ b/backend/src/main/java/io/metersphere/api/controller/APIScenarioReportController.java @@ -34,6 +34,11 @@ public class APIScenarioReportController { return apiReportService.get(reportId,false); } + @GetMapping("/getAll/{reportId}") + public APIScenarioReportResult getAll(@PathVariable String reportId) { + return apiReportService.get(reportId,true); + } + @PostMapping("/list/{goPage}/{pageSize}") public Pager> list(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryAPIReportRequest request) { Page page = PageHelper.startPage(goPage, pageSize, true); diff --git a/frontend/src/business/components/api/automation/report/ApiReportDetail.vue b/frontend/src/business/components/api/automation/report/ApiReportDetail.vue index 9ce9d81ae8..38498a3fcb 100644 --- a/frontend/src/business/components/api/automation/report/ApiReportDetail.vue +++ b/frontend/src/business/components/api/automation/report/ApiReportDetail.vue @@ -40,7 +40,9 @@ { + this.checkReport(data); + this.handleGetScenarioReport(data); + this.exportReportIsOk = true; + this.startExport(); + }); + } } else { getScenarioReport(this.reportId, (data) => { this.checkReport(data); @@ -483,7 +497,7 @@ export default { formatExportApi(array, scenario) { array.forEach(item => { if (this.stepFilter && this.stepFilter.get("AllSamplerProxy").indexOf(item.type) !== -1) { - if(item.errorCode){ + if (item.errorCode) { item.value.errorCode = item.errorCode; } scenario.requestResults.push(item.value); @@ -493,7 +507,11 @@ export default { } }) }, + handleExport() { + this.getReport(true); + }, + startExport() { if (this.report.reportVersion && this.report.reportVersion > 1) { if (this.report.reportType === 'API_INTEGRATED' || this.report.reportType === 'UI_INTEGRATED') { let scenario = {name: "", requestResults: []}; @@ -550,7 +568,7 @@ export default { this.getReport(); this.$EventBus.$on('projectChange', this.handleProjectChange); }, - destroyed () { + destroyed() { this.$EventBus.$off('projectChange', this.handleProjectChange); }, computed: { diff --git a/frontend/src/network/api.js b/frontend/src/network/api.js index a1fe17cc64..255ba17d6f 100644 --- a/frontend/src/network/api.js +++ b/frontend/src/network/api.js @@ -12,6 +12,10 @@ export function getScenarioReport(reportId, callback) { return reportId ? baseGet('/api/scenario/report/get/' + reportId, callback) : {}; } +export function getScenarioReportAll(reportId, callback) { + return reportId ? baseGet('/api/scenario/report/getAll/' + reportId, callback) : {}; +} + export function getApiReport(testId, callback) { return testId ? baseGet('/api/definition/report/getReport/' + testId, callback) : {}; }