fix 节点拖拽

This commit is contained in:
chenjianxing 2020-05-18 11:22:34 +08:00
parent be6d48f497
commit 0285b4cd59
1 changed files with 10 additions and 4 deletions

View File

@ -124,11 +124,17 @@ public class TestCaseNodeService {
testCases.forEach(testCase -> {
StringBuilder path = new StringBuilder(testCase.getNodePath());
List<String> list = Arrays.asList(path.toString().split("/"));
list.set(request.getLevel(), request.getName());
List<String> pathLists = Arrays.asList(path.toString().split("/"));
if (request.getLevel() <= pathLists.size()) {
pathLists.set(request.getLevel(), request.getName());
} else {
pathLists.add(request.getName());
}
path.delete( 0, path.length());
for (int i = 1; i < list.size(); i++) {
path = path.append("/").append(list.get(i));
for (int i = 1; i < pathLists.size(); i++) {
path = path.append("/").append(pathLists.get(i));
}
testCase.setNodePath(path.toString());
});