fix: 脑图用例编辑
This commit is contained in:
parent
51e0461dc3
commit
03818c53ee
|
@ -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());
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 = [];
|
||||
|
|
Loading…
Reference in New Issue