fix: 修复空项目下点击环境报错的问题、修复表格复选框全选时的展示问题

修复空项目下点击环境报错的问题、修复表格复选框全选时的展示问题
This commit is contained in:
song-tianyang 2021-05-10 16:00:08 +08:00 committed by 刘瑞斌
parent 23a55fd386
commit b8fc99bf96
5 changed files with 10 additions and 5 deletions

View File

@ -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<ApiTestEnvironmentWithBLOBs> 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);

View File

@ -302,6 +302,7 @@ export default {
},
watch: {
selectNodeIds() {
this.condition.selectAll = false;
this.initTable();
},
currentProtocol() {

View File

@ -217,6 +217,7 @@ export default {
},
watch: {
selectNodeIds() {
this.condition.selectAll = false;
this.search();
},
planId() {

View File

@ -414,6 +414,7 @@ export default {
this.refreshTableAndPlan();
},
selectNodeIds() {
this.condition.selectAll = false;
this.search();
},
tableLabel: {

View File

@ -231,6 +231,7 @@ export default {
},
watch: {
selectProjectId() {
this.condition.selectAll = false;
this.initTable();
},
planId() {