fix: 脑图用例编辑

This commit is contained in:
chenjianxing 2021-03-17 16:59:33 +08:00
parent 51e0461dc3
commit 03818c53ee
3 changed files with 17 additions and 2 deletions

View File

@ -731,6 +731,9 @@ public class TestCaseService {
public void minderEdit(TestCaseMinderEditRequest request) {
List<TestCaseWithBLOBs> data = request.getData();
data.forEach(item -> {
if (StringUtils.isBlank(item.getNodeId()) || item.getNodeId().equals("root")) {
item.setNodeId("");
}
item.setProjectId(request.getProjectId());
if (StringUtils.isBlank(item.getId()) || item.getId().length() < 20) {
item.setId(UUID.randomUUID().toString());

View File

@ -96,6 +96,15 @@ export default {
},
parse(root, children) {
root.children = [];
if (root.data.id === 'root') {
// nodeId
let rootChildData = this.dataMap.get("");
if (rootChildData) {
rootChildData.forEach((dataNode) => {
root.children.push(dataNode);
})
}
}
//
let dataNodes = this.dataMap.get(root.data.id);
if (dataNodes) {

View File

@ -47,9 +47,9 @@ name: "TestCaseMinder",
}
},
save(data) {
console.log(this.dataMap);
let saveCases = [];
this.buildSaveCase(data.root, saveCases, undefined);
console.log(saveCases);
let param = {
projectId: this.projectId,
data: saveCases
@ -72,6 +72,9 @@ name: "TestCaseMinder",
},
_buildSaveCase(node, saveCases, parent) {
let data = node.data;
if (!data.text) {
return;
}
let isChange = false;
let testCase = {
id: data.id,
@ -81,7 +84,7 @@ name: "TestCaseMinder",
type: data.type ? data.type : 'functional',
method: data.method ? data.method: 'manual',
maintainer: data.maintainer,
priority: 'P' + data.priority,
priority: 'P' + (data.priority ? data.priority : 0),
};
if (data.changed) isChange = true;
let steps = [];