From 147767a389e6a6a5b1766a61814a55236b458616 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Tue, 22 Nov 2022 10:01:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9C=BA=E6=99=AF=E5=88=97=E8=A1=A8=E5=85=A8?= =?UTF-8?q?=E9=80=89=E5=90=8E=E5=8D=95=E6=9D=A1=E5=88=A0=E9=99=A4=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1020015 --user=赵勇 【接口测试】场景列表-全选-选择所有数据-单独删除一条数据-会把所有数据都删了 https://www.tapd.cn/55049933/s/1300386 --- .../metersphere/service/scenario/ApiScenarioService.java | 9 ++++++--- .../src/business/automation/scenario/ApiScenarioList.vue | 8 ++------ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/service/scenario/ApiScenarioService.java b/api-test/backend/src/main/java/io/metersphere/service/scenario/ApiScenarioService.java index 53879f4f9d..a559300722 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/scenario/ApiScenarioService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/scenario/ApiScenarioService.java @@ -1708,13 +1708,16 @@ public class ApiScenarioService { } 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()); } public void deleteBatchByCondition(ApiScenarioBatchRequest request) { - ServiceUtils.getSelectAllIds(request, request.getCondition(), (query) -> extApiScenarioMapper.selectIdsByQuery(query)); + ServiceUtils.getSelectAllIds(request, request.getCondition(), (query) -> + extApiScenarioMapper.selectIdsByQuery(query)); List ids = request.getIds(); this.deleteBatch(ids); } diff --git a/api-test/frontend/src/business/automation/scenario/ApiScenarioList.vue b/api-test/frontend/src/business/automation/scenario/ApiScenarioList.vue index c2738839a1..95209b2dd9 100644 --- a/api-test/frontend/src/business/automation/scenario/ApiScenarioList.vue +++ b/api-test/frontend/src/business/automation/scenario/ApiScenarioList.vue @@ -1409,12 +1409,8 @@ export default { this.$refs.apiDeleteConfirmVersion.close(); this.search(); }); - } - // 删除全部版本 - else { - let param = {}; - this.buildBatchParam(param); - param.ids = [api.id]; + } else { + let param = { ids: [api.id] }; removeScenarioToGcByBatch(param).then(() => { this.$success(this.$t('commons.delete_success')); this.$refs.apiDeleteConfirmVersion.close();