diff --git a/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugService.java b/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugService.java index c7b709edab..52d910d43c 100644 --- a/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugService.java +++ b/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugService.java @@ -1533,14 +1533,20 @@ public class BugService { // 全选{根据查询条件查询所有数据, 排除取消勾选的数据} BugPageRequest bugPageRequest = new BugPageRequest(); BeanUtils.copyBean(bugPageRequest, request); + if (request.getCondition() != null) { + bugPageRequest.setCombine(request.getCondition().getCombine()); + bugPageRequest.setFilter(request.getCondition().getFilter()); + } List ids = extBugMapper.getIdsByPageRequest(bugPageRequest); + ids.addAll(request.getSelectIds()); if (CollectionUtils.isNotEmpty(request.getExcludeIds())) { ids.removeIf(id -> request.getExcludeIds().contains(id)); } if (CollectionUtils.isEmpty(ids)) { throw new MSException(Translator.get("no_bug_select")); } - return ids; + //返回去重后的id + return new ArrayList<>(ids.stream().distinct().toList()); } else { // 部分勾选 if (CollectionUtils.isEmpty(request.getSelectIds())) { diff --git a/frontend/src/views/api-test/scenario/components/scenarioTable.vue b/frontend/src/views/api-test/scenario/components/scenarioTable.vue index 05a533188d..e20a91603a 100644 --- a/frontend/src/views/api-test/scenario/components/scenarioTable.vue +++ b/frontend/src/views/api-test/scenario/components/scenarioTable.vue @@ -1123,7 +1123,7 @@ selectIds, selectAll: !!params?.selectAll, excludeIds: params?.excludeIds || [], - condition: { keyword: keyword.value }, + condition: { ...params?.condition, keyword: keyword.value }, projectId: appStore.currentProjectId, moduleIds: props.activeModule === 'all' ? [] : [props.activeModule], deleteAll: true, @@ -1449,8 +1449,21 @@ * @param event 批量操作事件对象 */ function handleTableBatch(event: BatchActionParams, params: BatchActionQueryParams) { - tableSelected.value = params?.selectedIds || []; batchParams.value = params; + tableSelected.value = params?.selectedIds || []; + const filterParams = { + lastReportStatus: lastReportStatusListFilters.value, + status: statusFilters.value, + priority: priorityFilters.value, + createUser: createUserFilters.value, + updateUser: updateUserFilters.value, + }; + if (batchParams.value.condition) { + batchParams.value.condition.filter = { ...filterParams }; + } else { + batchParams.value.condition = { filter: { ...filterParams } }; + } + switch (event.eventTag) { case 'delete': deleteScenario(undefined, true, batchParams.value); diff --git a/frontend/src/views/api-test/scenario/recycle/recycleTable.vue b/frontend/src/views/api-test/scenario/recycle/recycleTable.vue index e36b39740f..2e20855333 100644 --- a/frontend/src/views/api-test/scenario/recycle/recycleTable.vue +++ b/frontend/src/views/api-test/scenario/recycle/recycleTable.vue @@ -328,6 +328,7 @@ dataIndex: 'environmentName', width: 159, showDrag: true, + showTooltip: true, }, { title: 'apiScenario.table.columns.steps', @@ -514,7 +515,7 @@ }); // 恢复 - async function recover(record?: ApiScenarioTableItem, isBatch?: boolean) { + async function recover(record?: ApiScenarioTableItem, isBatch?: boolean, params?: BatchActionQueryParams) { try { if (isBatch) { recoverLoading.value = true; @@ -522,7 +523,7 @@ selectIds: batchParams.value?.selectedIds || [], selectAll: !!batchParams.value?.selectAll, excludeIds: batchParams.value?.excludeIds || [], - condition: { keyword: keyword.value }, + condition: { ...params?.condition, keyword: keyword.value }, projectId: appStore.currentProjectId, moduleIds: props.activeModule === 'all' ? [] : [props.activeModule], }); @@ -607,12 +608,25 @@ function handleTableBatch(event: BatchActionParams, params: BatchActionQueryParams) { tableSelected.value = params?.selectedIds || []; batchParams.value = params; + const filterParams = { + lastReportStatus: lastReportStatusListFilters.value, + status: statusFilters.value, + priority: priorityFilters.value, + createUser: createUserFilters.value, + updateUser: updateUserFilters.value, + }; + if (batchParams.value.condition) { + batchParams.value.condition.filter = { ...filterParams }; + } else { + batchParams.value.condition = { filter: { ...filterParams } }; + } + switch (event.eventTag) { case 'delete': deleteOperation(undefined, true, batchParams.value); break; case 'recover': - recover(undefined, true); + recover(undefined, true, batchParams.value); break; default: break; diff --git a/frontend/src/views/bug-management/index.vue b/frontend/src/views/bug-management/index.vue index 4703a9b0fd..db228e0c90 100644 --- a/frontend/src/views/bug-management/index.vue +++ b/frontend/src/views/bug-management/index.vue @@ -791,7 +791,20 @@ } function handleTableBatch(event: BatchActionParams, params: BatchActionQueryParams) { + const filterParams = { + status: statusFilterValue.value, + handleUser: handleUserFilterValue.value, + updateUser: updateUserFilterValue.value, + createUser: createUserFilterValue.value, + }; + filterParams[severityColumnId.value] = severityFilterValue.value; + if (params.condition) { + params.condition.filter = { ...filterParams }; + } else { + params.condition = { filter: { ...filterParams } }; + } currentSelectParams.value = params; + switch (event.eventTag) { case 'export': handleExport(); diff --git a/frontend/src/views/bug-management/recycle.vue b/frontend/src/views/bug-management/recycle.vue index 14f737eaac..0d83be470b 100644 --- a/frontend/src/views/bug-management/recycle.vue +++ b/frontend/src/views/bug-management/recycle.vue @@ -477,6 +477,18 @@ // 处理表格选中后批量操作 function handleTableBatch(event: BatchActionParams, params: BatchActionQueryParams) { + const filterParams = { + status: statusFilterValue.value, + handleUser: handleUserFilterValue.value, + updateUser: updateUserFilterValue.value, + createUser: createUserFilterValue.value, + }; + filterParams[severityColumnId.value] = severityFilterValue.value; + if (params.condition) { + params.condition.filter = { ...filterParams }; + } else { + params.condition = { filter: { ...filterParams } }; + } switch (event.eventTag) { case 'recover': handleBatchRecover(params);