From 8b197849c23e8d037b389401b31e4065aaf908f7 Mon Sep 17 00:00:00 2001 From: zhangdahai112 Date: Thu, 25 Aug 2022 11:53:34 +0800 Subject: [PATCH] =?UTF-8?q?fix(UI=20=E8=87=AA=E5=8A=A8=E5=8C=96):=20?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E6=9D=A1=E4=BB=B6=E5=85=B3=E8=81=94=E7=94=A8?= =?UTF-8?q?=E4=BE=8B=E5=88=B0=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1016273 --user=张大海 【测试跟踪】测试计划-UI测试用例-关联测试用例-弹框-输入关键字搜索用例-全选符合搜索结果的所有数据确定-实际关联的是项目下所有数据 https://www.tapd.cn/55049933/s/1233644 --- .../TestPlanUiScenarioCaseController.java | 5 +++++ .../service/TestPlanUiScenarioCaseService.java | 8 ++++++++ .../comonents/api/TestCaseUiScenarioRelevance.vue | 13 +++++++++---- 3 files changed, 22 insertions(+), 4 deletions(-) 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, () => {