fix: 元素库模块未展示模块下元素数量

This commit is contained in:
chenjianxing 2022-04-27 11:31:16 +08:00 committed by zhangdahai112
parent 581492464b
commit 29a6d9bcc6
3 changed files with 33 additions and 8 deletions

View File

@ -144,8 +144,15 @@ public class BaseModuleService extends NodeTreeService<ModuleNodeDTO> {
return getNodeTreeByProjectIdWithCount(projectId, null, defaultName);
}
private void buildNodeCount(String projectId, List<ModuleNodeDTO> moduleNodes, Function<QueryNodeRequest, List<Map<String, Object>>> getModuleCountFunc) {
QueryNodeRequest request = new QueryNodeRequest();
protected void buildNodeCount(String projectId, List<ModuleNodeDTO> moduleNodes, Function<QueryNodeRequest, List<Map<String, Object>>> getModuleCountFunc) {
this.buildNodeCount(projectId, moduleNodes, getModuleCountFunc, null);
}
protected void buildNodeCount(String projectId, List<ModuleNodeDTO> moduleNodes, Function<QueryNodeRequest, List<Map<String, Object>>> getModuleCountFunc,
QueryNodeRequest request) {
if (request == null) {
request = new QueryNodeRequest();
}
request.setProjectId(projectId);
//优化将for循环内的SQL抽出来只查一次

View File

@ -1,17 +1,35 @@
package io.metersphere.track.request.testcase;
import io.metersphere.controller.request.BaseQueryRequest;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
@Getter
@Setter
public class QueryNodeRequest {
public class QueryNodeRequest extends BaseQueryRequest {
private String id;
private String testPlanId;
private String projectId;
private String reviewId;
private String excludeId;
private String moduleId;
private String name;
private String userId;
private String planId;
private boolean recent = false;
private boolean isSelectThisWeedData;
private long createTime = 0;
private String executeStatus;
private boolean notInTestPlan;
private String versionId;
private String refId;
private List<String> moduleIds;
//操作人
private String operator;
//操作时间
private Long operationTime;
/**
* 是否需要查询环境字段
*/
private boolean selectEnvironment = false;
}

View File

@ -30,7 +30,7 @@
<i class="el-icon-folder"/>
</span>
<span v-if="!data.isEdit" class="node-title" v-text="data.name"/>
<span class="count-title" v-if="isDisplay!=='relevance'">
<span class="count-title" v-if="isDisplay !== 'relevance'">
<span style="color: #6C317C">{{ data.caseNum }}</span>
</span>
<span v-if="!disabled" class="node-operate child">