diff --git a/backend/src/main/java/io/metersphere/track/controller/TestPlanUiScenarioCaseController.java b/backend/src/main/java/io/metersphere/track/controller/TestPlanUiScenarioCaseController.java index 50394139b7..f26e5c5919 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestPlanUiScenarioCaseController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestPlanUiScenarioCaseController.java @@ -54,6 +54,11 @@ public class TestPlanUiScenarioCaseController { return testPlanUiScenarioCaseService.relevanceList(request, goPage, pageSize); } + @PostMapping("/relevance/list/ids") + public List relevanceListIds(@RequestBody UiScenarioRequest request) { + return testPlanUiScenarioCaseService.relevanceListIds(request); + } + @GetMapping("/delete/{id}") @MsAuditLog(module = OperLogModule.TRACK_TEST_CASE_REVIEW, type = OperLogConstants.UN_ASSOCIATE_CASE, beforeEvent = "#msClass.getLogDetails(#id)", msClass = TestPlanScenarioCaseService.class) public int deleteTestCase(@PathVariable String id) { diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanUiScenarioCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanUiScenarioCaseService.java index a02b762afb..ca46c6ccc4 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanUiScenarioCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanUiScenarioCaseService.java @@ -618,4 +618,12 @@ public class TestPlanUiScenarioCaseService { extTestPlanUiScenarioCaseMapper::getLastOrder, testPlanUiScenarioMapper::updateByPrimaryKeySelective); } + + public List relevanceListIds(UiScenarioRequest request) { + request.setNotInTestPlan(true); + if (testPlanService.isAllowedRepeatCase(request.getPlanId())) { + request.setNotInTestPlan(false); + } + return uiAutomationServiceProxy.list(request).stream().map(UiScenarioDTO::getId).collect(Collectors.toList()); + } } diff --git a/frontend/src/business/components/track/plan/view/comonents/api/TestCaseUiScenarioRelevance.vue b/frontend/src/business/components/track/plan/view/comonents/api/TestCaseUiScenarioRelevance.vue index 64c0013775..ea4b99188a 100644 --- a/frontend/src/business/components/track/plan/view/comonents/api/TestCaseUiScenarioRelevance.vue +++ b/frontend/src/business/components/track/plan/view/comonents/api/TestCaseUiScenarioRelevance.vue @@ -132,6 +132,13 @@ export default { this.$refs.baseRelevance.close(); }); }, + getAllId(param) { + return new Promise((resolve) => { + this.$post("/test/plan/uiScenario/case/relevance/list/ids", param, (data) => { + resolve(data.data); + }) + }); + }, async saveCaseRelevance() { let selectIds = []; let url = '/ui/automation/relevance'; @@ -154,10 +161,8 @@ export default { //查找所有数据 let params = this.$refs.apiScenarioList.condition; if (params.selectAll) { - let result = await this.$post("/ui/automation/listAllIds", { - projectId: params.projectId - }); - param.selectIds = result.data.data; + let result = await this.getAllId(params); + param.selectIds = result; } this.result = this.$post(url, param, () => {