diff --git a/backend/src/main/java/io/metersphere/controller/ShareController.java b/backend/src/main/java/io/metersphere/controller/ShareController.java index ac287fed5d..bb3fa4c0b2 100644 --- a/backend/src/main/java/io/metersphere/controller/ShareController.java +++ b/backend/src/main/java/io/metersphere/controller/ShareController.java @@ -17,6 +17,7 @@ import io.metersphere.commons.utils.Pager; import io.metersphere.controller.request.resourcepool.QueryResourcePoolRequest; import io.metersphere.dto.LogDetailDTO; import io.metersphere.dto.ReportDTO; +import io.metersphere.dto.RequestResult; import io.metersphere.dto.TestResourcePoolDTO; import io.metersphere.performance.base.*; import io.metersphere.performance.dto.LoadTestExportJmx; @@ -70,6 +71,8 @@ public class ShareController { MetricQueryService metricService; @Resource private TestResourcePoolService testResourcePoolService; + @Resource + private ApiScenarioReportService apiReportService; @GetMapping("/issues/plan/get/{shareId}/{planId}") public List getIssuesByPlanoId(@PathVariable String shareId, @PathVariable String planId) { @@ -308,4 +311,10 @@ public class ShareController { resourcePoolRequest.setStatus(ResourceStatusEnum.VALID.name()); return testResourcePoolService.listResourcePools(resourcePoolRequest); } + + @GetMapping("/{shareId}/scenario/report/selectReportContent/{stepId}") + public RequestResult selectReportContent(@PathVariable String stepId,@PathVariable String shareId) { + shareInfoService.validateExpired(shareId); + return apiReportService.selectReportContent(stepId); + } } diff --git a/frontend/src/business/components/api/automation/report/ApiReportDetail.vue b/frontend/src/business/components/api/automation/report/ApiReportDetail.vue index 7b259aba0e..c603a4228a 100644 --- a/frontend/src/business/components/api/automation/report/ApiReportDetail.vue +++ b/frontend/src/business/components/api/automation/report/ApiReportDetail.vue @@ -26,6 +26,8 @@ :treeData="fullTreeNodes" :console="content.console" :report="report" + :is-share="isShare" + :share-id="shareId" v-on:requestResult="requestResult" ref="resultsTree"/> @@ -38,6 +40,8 @@ v-on:requestResult="requestResult" :console="content.console" :report="report" + :is-share="isShare" + :share-id="shareId" :treeData="fullTreeNodes" ref="failsTree" :errorReport="content.error"/> @@ -51,6 +55,8 @@ @@ -65,6 +71,8 @@ @@ -171,11 +179,6 @@ if (this.isTemplate) { this.getReport(); } - }, - isShare() { - if(this.isShare()){ - this.handleExport() - } } }, methods: { diff --git a/frontend/src/business/components/api/automation/report/components/RequestResult.vue b/frontend/src/business/components/api/automation/report/components/RequestResult.vue index 7b1ba00b6f..dbf2deb788 100644 --- a/frontend/src/business/components/api/automation/report/components/RequestResult.vue +++ b/frontend/src/business/components/api/automation/report/components/RequestResult.vue @@ -185,7 +185,9 @@ export default { isActive: { type: Boolean, default: false - } + }, + isShare: Boolean, + shareId: String, }, created() { this.showActive = this.isActive; @@ -261,12 +263,22 @@ export default { }, loadRequestInfoExpand() { if (!this.request.responseResult || this.request.responseResult.body === null || this.request.responseResult.body === undefined) { - this.$get("/api/scenario/report/selectReportContent/" + this.stepId, response => { - this.requestInfo = response.data; - this.$nextTick(() => { - this.requestInfo.loading = false; + if (this.isShare) { + this.$get("/share/" + this.shareId + "/scenario/report/selectReportContent/" + this.stepId, response => { + this.requestInfo = response.data; + this.$nextTick(() => { + this.requestInfo.loading = false; + }); }); - }); + } else { + this.$get("/api/scenario/report/selectReportContent/" + this.stepId, response => { + this.requestInfo = response.data; + this.$nextTick(() => { + this.requestInfo.loading = false; + }); + }); + } + } else { this.requestInfo = this.request; } diff --git a/frontend/src/business/components/api/automation/report/components/ScenarioResult.vue b/frontend/src/business/components/api/automation/report/components/ScenarioResult.vue index 9403b7baed..6b8609507d 100644 --- a/frontend/src/business/components/api/automation/report/components/ScenarioResult.vue +++ b/frontend/src/business/components/api/automation/report/components/ScenarioResult.vue @@ -36,6 +36,8 @@ :total-status="node.totalStatus" :console="console" :isActive="isActive" + :is-share="isShare" + :share-id="shareId" v-on:requestResult="requestResult" /> @@ -59,6 +61,8 @@ export default { node: Object, console: String, isActive: Boolean, + isShare:Boolean, + shareId: String, }, data() { return { diff --git a/frontend/src/business/components/api/automation/report/components/ScenarioResults.vue b/frontend/src/business/components/api/automation/report/components/ScenarioResults.vue index 2532f0d9eb..09ad4727ab 100644 --- a/frontend/src/business/components/api/automation/report/components/ScenarioResults.vue +++ b/frontend/src/business/components/api/automation/report/components/ScenarioResults.vue @@ -15,8 +15,8 @@ highlight-current class="ms-tree ms-report-tree" ref="resultsTree"> - + @@ -37,7 +37,9 @@ export default { defaultExpand: { default: false, type: Boolean, - } + }, + isShare:Boolean, + shareId: String, }, data() { return {