fix: 脑图bug

This commit is contained in:
chenjianxing 2021-03-22 21:57:12 +08:00
parent 30f8e26146
commit b3c6e17cf7
4 changed files with 18 additions and 8 deletions

View File

@ -10,5 +10,6 @@ import java.util.List;
@Setter
public class TestCaseMinderEditRequest {
private String projectId;
private List<String> ids;
List<TestCaseWithBLOBs> data;
}

View File

@ -780,6 +780,12 @@ public class TestCaseService {
editTestCase(item);
}
});
List<String> ids = request.getIds();
if (CollectionUtils.isNotEmpty(ids)) {
TestCaseBatchRequest deleteRequest = new TestCaseBatchRequest();
deleteRequest.setIds(ids);
deleteTestCaseBath(deleteRequest);
}
}
public List<TestCase> getTestCaseByProjectId(String projectId) {

View File

@ -49,7 +49,7 @@
"xml-js": "^1.6.11",
"yan-progress": "^1.0.3",
"jsonpath": "^1.1.0",
"vue-minder-editor-plus": "^1.0.18",
"vue-minder-editor-plus": "^1.0.19",
"jsencrypt": "^3.1.0"
},
"devDependencies": {

View File

@ -49,26 +49,29 @@ name: "TestCaseMinder",
},
save(data) {
let saveCases = [];
this.buildSaveCase(data.root, saveCases, undefined);
let deleteCases = [];
this.buildSaveCase(data.root, saveCases, deleteCases, undefined);
let param = {
projectId: this.projectId,
data: saveCases
data: saveCases,
ids: deleteCases.map(item => item.id)
}
this.result = this.$post('/test/case/minder/edit', param, () => {
this.$success(this.$t('commons.save_success'));
});
},
buildSaveCase(root, saveCases, parent) {
buildSaveCase(root, saveCases, deleteCases, parent) {
let data = root.data;
if (data.resource && data.resource.indexOf(this.$t('api_test.definition.request.case')) > -1) {
if (root.parent) {
console.log(root.parent);
}
this._buildSaveCase(root, saveCases, parent);
} else {
let deleteChild = data.deleteChild;
if (deleteChild && deleteChild.length > 0) {
deleteCases.push(...deleteChild);
}
if (root.children) {
root.children.forEach((childNode) => {
this.buildSaveCase(childNode, saveCases, root.data);
this.buildSaveCase(childNode, saveCases, deleteCases, root.data);
})
}
}