From 82248b22daea8fc3900f2cfb8cacb79d508d0e7e Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Mon, 14 Dec 2020 16:57:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89):=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9Tree=20=E6=A0=B7=E5=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/service/ApiScenarioModuleService.java | 9 +-- .../automation/scenario/ApiScenarioModule.vue | 11 ++-- .../api/definition/components/ApiModule.vue | 58 +++++++++---------- 3 files changed, 37 insertions(+), 41 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/service/ApiScenarioModuleService.java b/backend/src/main/java/io/metersphere/api/service/ApiScenarioModuleService.java index 24d2c3412b..374f6a8c58 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiScenarioModuleService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiScenarioModuleService.java @@ -123,16 +123,17 @@ public class ApiScenarioModuleService { } } - private List queryByModuleIds(List nodeIds) { + private List queryByModuleIds(DragApiScenarioModuleRequest request) { ApiScenarioRequest apiScenarioRequest = new ApiScenarioRequest(); - apiScenarioRequest.setModuleIds(nodeIds); + apiScenarioRequest.setProjectId(request.getProjectId()); + apiScenarioRequest.setModuleIds(request.getNodeIds()); return apiAutomationService.list(apiScenarioRequest); } public int editNode(DragApiScenarioModuleRequest request) { request.setUpdateTime(System.currentTimeMillis()); checkApiScenarioModuleExist(request); - List apiScenarios = queryByModuleIds(request.getNodeIds()); + List apiScenarios = queryByModuleIds(request); apiScenarios.forEach(apiScenario -> { StringBuilder path = new StringBuilder(apiScenario.getModulePath()); @@ -171,7 +172,7 @@ public class ApiScenarioModuleService { List nodeIds = request.getNodeIds(); - List apiScenarios = queryByModuleIds(nodeIds); + List apiScenarios = queryByModuleIds(request); ApiScenarioModuleDTO nodeTree = request.getNodeTree(); diff --git a/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue b/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue index 1f728d338d..edbd91f712 100644 --- a/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue +++ b/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue @@ -30,11 +30,9 @@ class="ms-el-input" size="mini"> - - - - - + + + - + -
- - - -
- + + + i { - color: #409eff; - margin: 0px 5px; - } - /deep/ .el-tree-node__content { height: 33px; } @@ -503,4 +477,26 @@ width: 90px; } + .father .child { + display: none; + } + + .father:hover .child { + display: block; + } + + .node-title { + width: 0px; + text-overflow: ellipsis; + white-space: nowrap; + flex: 1 1 auto; + padding: 0px 5px; + overflow: hidden; + } + + .node-operate > i { + color: #409eff; + margin: 0px 5px; + } +