Merge remote-tracking branch 'origin/master'

This commit is contained in:
Captain.B 2021-03-17 17:22:51 +08:00
commit cbe3b6bc0d
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 = [];