From 340f69a467ee6bc9f288b0d03d67359ba8590a82 Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Tue, 18 May 2021 17:09:35 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=E6=8A=A5=E5=91=8A-=E5=AD=90=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E7=9A=84=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 优化场景报告-子请求的展示 --- .../controller/MsTransactionController.java | 2 +- .../io/metersphere/api/jmeter/TestResult.java | 7 + .../report/components/RequestSubResult.vue | 18 ++- .../components/RequestSubResultTail.vue | 138 ++++++++++++++++++ 4 files changed, 162 insertions(+), 3 deletions(-) create mode 100644 frontend/src/business/components/api/automation/report/components/RequestSubResultTail.vue diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsTransactionController.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsTransactionController.java index ce392099a5..63f327215f 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsTransactionController.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsTransactionController.java @@ -47,7 +47,7 @@ public class MsTransactionController extends MsTestElement { this.setName(getLabelName()); } transactionController.setName(this.getName()); - transactionController.setProperty(TestElement.TEST_CLASS, IfController.class.getName()); + transactionController.setProperty(TestElement.TEST_CLASS, TransactionController.class.getName()); transactionController.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("TransactionControllerGui")); transactionController.setGenerateParentSample(generateParentSample); transactionController.setIncludeTimers(includeTimers); diff --git a/backend/src/main/java/io/metersphere/api/jmeter/TestResult.java b/backend/src/main/java/io/metersphere/api/jmeter/TestResult.java index 8cdf2d8221..085337e0af 100644 --- a/backend/src/main/java/io/metersphere/api/jmeter/TestResult.java +++ b/backend/src/main/java/io/metersphere/api/jmeter/TestResult.java @@ -85,6 +85,13 @@ public class TestResult { item.getSubRequestResults().forEach(subItem -> { subItem.setName(array[0]); }); + }else { + item.getSubRequestResults().forEach(subItem -> { + if (StringUtils.isNotEmpty(subItem.getName()) && subItem.getName().indexOf(SEPARATOR) != -1) { + String array[] = subItem.getName().split(SEPARATOR); + subItem.setName(array[0]); + } + }); } }); scenarios.add(result); diff --git a/frontend/src/business/components/api/automation/report/components/RequestSubResult.vue b/frontend/src/business/components/api/automation/report/components/RequestSubResult.vue index f6a0f090df..9c94577a86 100644 --- a/frontend/src/business/components/api/automation/report/components/RequestSubResult.vue +++ b/frontend/src/business/components/api/automation/report/components/RequestSubResult.vue @@ -13,6 +13,7 @@
{{ indexNumber+1 }}
+ {{ request.name }} @@ -52,6 +53,13 @@ + +
+ +
+
@@ -60,10 +68,13 @@ import MsAssertionResults from "./AssertionResults"; import MsRequestText from "./RequestText"; import MsResponseText from "./ResponseText"; + import MsRequestSubResultTail from "./RequestSubResultTail"; export default { - name: "MsRequestResult", - components: {MsResponseText, MsRequestText, MsAssertionResults, MsRequestMetric}, + name: "MsRequestSubResult", + components: { + MsResponseText, MsRequestText, MsAssertionResults, MsRequestMetric,MsRequestSubResultTail + }, props: { request: Object, scenarioName: String, @@ -156,4 +167,7 @@ border-top: 1px solid #e8eaec; } + .icon.is-active { + transform: rotate(90deg); + } diff --git a/frontend/src/business/components/api/automation/report/components/RequestSubResultTail.vue b/frontend/src/business/components/api/automation/report/components/RequestSubResultTail.vue new file mode 100644 index 0000000000..654ce141c3 --- /dev/null +++ b/frontend/src/business/components/api/automation/report/components/RequestSubResultTail.vue @@ -0,0 +1,138 @@ + + + + +