From 49e91e8f11a3bf68b77381063e2e2d5629820146 Mon Sep 17 00:00:00 2001 From: "nathan.liu" Date: Tue, 19 Jul 2022 16:12:27 +0800 Subject: [PATCH] =?UTF-8?q?fix(UI=E8=87=AA=E5=8A=A8=E5=8C=96):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=85=83=E7=B4=A0=E5=BA=93=E5=AF=BC=E5=85=A5=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=A8=A1=E6=9D=BF=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1014993 --user=刘瑶 【UI测试】元素库-导入-下载模版-提示信息对应列不对-定位类型建议做成下拉选择 https://www.tapd.cn/55049933/s/1204366 --- .../base/mapper/ext/ExtModuleNodeMapper.xml | 2 +- .../service/BaseModuleService.java | 21 +++++++++---------- backend/src/main/java/io/metersphere/xpack | 2 +- frontend/src/business/components/xpack | 2 +- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtModuleNodeMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtModuleNodeMapper.xml index e597b753cc..e2f8482b61 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtModuleNodeMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtModuleNodeMapper.xml @@ -195,7 +195,7 @@ diff --git a/backend/src/main/java/io/metersphere/service/BaseModuleService.java b/backend/src/main/java/io/metersphere/service/BaseModuleService.java index 2629884b07..cfc5929aeb 100644 --- a/backend/src/main/java/io/metersphere/service/BaseModuleService.java +++ b/backend/src/main/java/io/metersphere/service/BaseModuleService.java @@ -73,15 +73,15 @@ public class BaseModuleService extends NodeTreeService { return module.getId(); } - public String getModulePath(ModuleNode module){ + public String getModulePath(ModuleNode module) { Integer level = module.getLevel(); - if( level == null || level <= 1){ - return String.format("/%s",module.getName()); + if (level == null || level <= 1) { + return String.format("/%s", module.getName()); } //获取父级信息 - if(StringUtils.isNotBlank(module.getParentId())){ + if (StringUtils.isNotBlank(module.getParentId())) { ModuleNode parent = extModuleNodeMapper.selectByPrimaryKey(tableName, module.getParentId()); - return parent.getModulePath() + "/" + module.getName(); + return parent.getModulePath() + "/" + module.getName(); } return null; } @@ -166,7 +166,7 @@ public class BaseModuleService extends NodeTreeService { } protected void buildNodeCount(String projectId, List moduleNodes, Function>> getModuleCountFunc, - QueryNodeRequest request) { + QueryNodeRequest request) { if (request == null) { request = new QueryNodeRequest(); } @@ -365,7 +365,7 @@ public class BaseModuleService extends NodeTreeService { moduleNode.setId(UUID.randomUUID().toString()); double pos = getNextLevelPos(projectId, level, pId); moduleNode.setPos(pos); - extModuleNodeMapper.insert(tableName, moduleNode); + extModuleNodeMapper.insertWithModulePath(tableName, moduleNode); return moduleNode.getId(); } @@ -429,10 +429,9 @@ public class BaseModuleService extends NodeTreeService { moduleNode.setId(rootNode.getId()); moduleNode.setLevel(level); moduleNode.setParentId(pId); - if(level <= 1 && StringUtils.isBlank(parentPath)){ + if (level <= 1 && StringUtils.isBlank(parentPath)) { moduleNode.setModulePath("/" + rootNode.getName()); - } - else { + } else { moduleNode.setModulePath(parentPath + "/" + rootNode.getName()); } updateNodes.add(moduleNode); @@ -612,7 +611,7 @@ public class BaseModuleService extends NodeTreeService { return extModuleNodeMapper.selectByExample(tableName, example); } - public List selectByModulePath(ModuleNode node){ + public List selectByModulePath(ModuleNode node) { return extModuleNodeMapper.selectByModulePath(tableName, node.getModulePath(), node.getProjectId()); } } diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index 806edbbea6..9b3c05ac31 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit 806edbbea6b2b3fffbb18b8fb83f4d293a1eed34 +Subproject commit 9b3c05ac310942814b28e2433339e3303a5366e4 diff --git a/frontend/src/business/components/xpack b/frontend/src/business/components/xpack index d357c326a7..1a5c65b84f 160000 --- a/frontend/src/business/components/xpack +++ b/frontend/src/business/components/xpack @@ -1 +1 @@ -Subproject commit d357c326a70088b0827ba1ced1d9cc035866170d +Subproject commit 1a5c65b84fb0c3cdce17b2671e6d80dc4e420337