fix(接口测试): 修复场景列表全选后单条删除问题

--bug=1020015 --user=赵勇 【接口测试】场景列表-全选-选择所有数据-单独删除一条数据-会把所有数据都删了 https://www.tapd.cn/55049933/s/1300386
This commit is contained in:
fit2-zhao 2022-11-22 10:01:42 +08:00 committed by fit2-zhao
parent 3aa5676418
commit fa85a19069
2 changed files with 8 additions and 9 deletions

View File

@ -1708,13 +1708,16 @@ public class ApiScenarioService {
} }
public void removeToGcByBatch(ApiScenarioBatchRequest request) { public void removeToGcByBatch(ApiScenarioBatchRequest request) {
ServiceUtils.getSelectAllIds(request, request.getCondition(), (query) -> extApiScenarioMapper.selectIdsByQuery(query)); if (request.getCondition() != null && request.getCondition().isSelectAll()) {
ServiceUtils.getSelectAllIds(request, request.getCondition(), (query) ->
extApiScenarioMapper.selectIdsByQuery(query));
}
this.removeToGc(request.getIds()); this.removeToGc(request.getIds());
} }
public void deleteBatchByCondition(ApiScenarioBatchRequest request) { public void deleteBatchByCondition(ApiScenarioBatchRequest request) {
ServiceUtils.getSelectAllIds(request, request.getCondition(), (query) -> extApiScenarioMapper.selectIdsByQuery(query)); ServiceUtils.getSelectAllIds(request, request.getCondition(), (query) ->
extApiScenarioMapper.selectIdsByQuery(query));
List<String> ids = request.getIds(); List<String> ids = request.getIds();
this.deleteBatch(ids); this.deleteBatch(ids);
} }

View File

@ -1409,12 +1409,8 @@ export default {
this.$refs.apiDeleteConfirmVersion.close(); this.$refs.apiDeleteConfirmVersion.close();
this.search(); this.search();
}); });
} } else {
// let param = { ids: [api.id] };
else {
let param = {};
this.buildBatchParam(param);
param.ids = [api.id];
removeScenarioToGcByBatch(param).then(() => { removeScenarioToGcByBatch(param).then(() => {
this.$success(this.$t('commons.delete_success')); this.$success(this.$t('commons.delete_success'));
this.$refs.apiDeleteConfirmVersion.close(); this.$refs.apiDeleteConfirmVersion.close();