feat(测试计划): 批量取消性能测试用例关联

This commit is contained in:
shiziyuan9527 2021-01-08 14:20:04 +08:00
parent ed819b4710
commit 2f8d0e9163
3 changed files with 28 additions and 2 deletions

View File

@ -52,4 +52,9 @@ public class TestPlanLoadCaseController {
public Boolean isExistReport(@RequestBody LoadCaseReportRequest request) {
return testPlanLoadCaseService.isExistReport(request);
}
@PostMapping("/batch/delete")
public void batchDelete(@RequestBody List<String> ids) {
testPlanLoadCaseService.batchDelete(ids);
}
}

View File

@ -113,4 +113,13 @@ public class TestPlanLoadCaseService {
}
testPlanLoadCaseMapper.deleteByExample(testPlanLoadCaseExample);
}
public void batchDelete(List<String> ids) {
if (CollectionUtils.isEmpty(ids)) {
return;
}
TestPlanLoadCaseExample example = new TestPlanLoadCaseExample();
example.createCriteria().andIdIn(ids);
testPlanLoadCaseMapper.deleteByExample(example);
}
}

View File

@ -205,7 +205,19 @@ export default {
//
// },
handleDeleteBatch() {
this.$alert(this.$t('test_track.plan_view.confirm_cancel_relevance') + "", '', {
confirmButtonText: this.$t('commons.confirm'),
callback: (action) => {
if (action === 'confirm') {
let ids = Array.from(this.selectRows).map(row => row.id);
this.result = this.$post('/test/plan/load/case/batch/delete', ids, () => {
this.selectRows.clear();
this.initTable();
this.$success(this.$t('test_track.cancel_relevance_success'));
});
}
}
})
},
handleRunBatch() {
@ -221,7 +233,7 @@ export default {
})
},
handleDelete(loadCase) {
this.$get('/test/plan/load/case/delete/' + loadCase.id, () => {
this.result = this.$get('/test/plan/load/case/delete/' + loadCase.id, () => {
this.$success(this.$t('test_track.cancel_relevance_success'));
this.$emit('refresh');
this.initTable();