From b8fc99bf9694eee02b7e878a8b84d398146a0803 Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Mon, 10 May 2021 16:00:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=A9=BA=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E4=B8=8B=E7=82=B9=E5=87=BB=E7=8E=AF=E5=A2=83=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=81=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E5=A4=8D=E9=80=89=E6=A1=86=E5=85=A8=E9=80=89?= =?UTF-8?q?=E6=97=B6=E7=9A=84=E5=B1=95=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复空项目下点击环境报错的问题、修复表格复选框全选时的展示问题 --- .../api/service/ApiTestEnvironmentService.java | 11 ++++++----- .../plan/view/comonents/api/TestPlanApiCaseList.vue | 1 + .../view/comonents/api/TestPlanApiScenarioList.vue | 1 + .../comonents/functional/FunctionalTestCaseList.vue | 1 + .../plan/view/comonents/load/TestPlanLoadCaseList.vue | 1 + 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/service/ApiTestEnvironmentService.java b/backend/src/main/java/io/metersphere/api/service/ApiTestEnvironmentService.java index 8566837a20..652928d30e 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiTestEnvironmentService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiTestEnvironmentService.java @@ -12,15 +12,13 @@ import io.metersphere.controller.request.EnvironmentRequest; import io.metersphere.dto.BaseSystemConfigDTO; import io.metersphere.i18n.Translator; import io.metersphere.service.SystemParameterService; +import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; +import java.util.*; @Service @Transactional(rollbackFor = Exception.class) @@ -36,11 +34,14 @@ public class ApiTestEnvironmentService { } public List listByConditions(EnvironmentRequest environmentRequest) { + if (CollectionUtils.isEmpty(environmentRequest.getProjectIds())) { + return new ArrayList<>(); + } ApiTestEnvironmentExample example = new ApiTestEnvironmentExample(); ApiTestEnvironmentExample.Criteria criteria = example.createCriteria(); criteria.andProjectIdIn(environmentRequest.getProjectIds()); if (StringUtils.isNotBlank(environmentRequest.getName())) { - environmentRequest.setName(StringUtils.wrapIfMissing(environmentRequest.getName(),'%')); //使搜索文本变成数据库中的正则表达式 + environmentRequest.setName(StringUtils.wrapIfMissing(environmentRequest.getName(), '%')); //使搜索文本变成数据库中的正则表达式 criteria.andNameLike(environmentRequest.getName()); } return apiTestEnvironmentMapper.selectByExampleWithBLOBs(example); diff --git a/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiCaseList.vue b/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiCaseList.vue index 4f1d0138fc..16675a3eb3 100644 --- a/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiCaseList.vue +++ b/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiCaseList.vue @@ -302,6 +302,7 @@ export default { }, watch: { selectNodeIds() { + this.condition.selectAll = false; this.initTable(); }, currentProtocol() { diff --git a/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiScenarioList.vue b/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiScenarioList.vue index 49a88ad460..bb144384f4 100644 --- a/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiScenarioList.vue +++ b/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiScenarioList.vue @@ -217,6 +217,7 @@ export default { }, watch: { selectNodeIds() { + this.condition.selectAll = false; this.search(); }, planId() { diff --git a/frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseList.vue b/frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseList.vue index 5f31e26ba2..540cfe4567 100644 --- a/frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseList.vue +++ b/frontend/src/business/components/track/plan/view/comonents/functional/FunctionalTestCaseList.vue @@ -414,6 +414,7 @@ export default { this.refreshTableAndPlan(); }, selectNodeIds() { + this.condition.selectAll = false; this.search(); }, tableLabel: { diff --git a/frontend/src/business/components/track/plan/view/comonents/load/TestPlanLoadCaseList.vue b/frontend/src/business/components/track/plan/view/comonents/load/TestPlanLoadCaseList.vue index be4c672ce7..58c61332d2 100644 --- a/frontend/src/business/components/track/plan/view/comonents/load/TestPlanLoadCaseList.vue +++ b/frontend/src/business/components/track/plan/view/comonents/load/TestPlanLoadCaseList.vue @@ -231,6 +231,7 @@ export default { }, watch: { selectProjectId() { + this.condition.selectAll = false; this.initTable(); }, planId() {