From 3756231d5b3e15f4515b50841b5783f2ef2522bc Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Mon, 30 May 2022 17:44:27 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E5=88=86=E4=BA=AB=E6=8A=A5=E5=91=8A=E7=99=BB=E5=BD=95=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --user=郭雨琦 --bug=1013301 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001013301 --- .../controller/ShareController.java | 9 +++++++ .../api/automation/report/ApiReportDetail.vue | 13 ++++++---- .../report/components/RequestResult.vue | 24 ++++++++++++++----- .../report/components/ScenarioResult.vue | 4 ++++ .../report/components/ScenarioResults.vue | 8 ++++--- 5 files changed, 44 insertions(+), 14 deletions(-) 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 {