refactor: 缺陷列表点击关联用例跳转到用例列表过滤
This commit is contained in:
parent
7228cbc6ff
commit
4e8bff7cc4
|
@ -3,6 +3,8 @@ package io.metersphere.base.domain;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class IssuesDao extends IssuesWithBLOBs {
|
public class IssuesDao extends IssuesWithBLOBs {
|
||||||
|
@ -11,4 +13,5 @@ public class IssuesDao extends IssuesWithBLOBs {
|
||||||
private String creatorName;
|
private String creatorName;
|
||||||
private String resourceName;
|
private String resourceName;
|
||||||
private long caseCount;
|
private long caseCount;
|
||||||
|
private List<String> caseIds;
|
||||||
}
|
}
|
||||||
|
|
|
@ -348,6 +348,12 @@
|
||||||
or test_case.tags like CONCAT('%', #{request.name},'%')
|
or test_case.tags like CONCAT('%', #{request.name},'%')
|
||||||
or test_case.custom_num like CONCAT('%', #{request.name},'%'))
|
or test_case.custom_num like CONCAT('%', #{request.name},'%'))
|
||||||
</if>
|
</if>
|
||||||
|
<if test="request.ids != null">
|
||||||
|
and test_case.id in
|
||||||
|
<foreach collection="request.ids" item="id" separator="," open="(" close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
<if test="request.relevanceCreateTime >0">
|
<if test="request.relevanceCreateTime >0">
|
||||||
and test_case.id in (select test_case_id from test_case_test where test_case_test.create_time >=
|
and test_case.id in (select test_case_id from test_case_test where test_case_test.create_time >=
|
||||||
#{request.createTime})
|
#{request.createTime})
|
||||||
|
|
|
@ -363,8 +363,12 @@ public class IssuesService {
|
||||||
}
|
}
|
||||||
TestCaseIssuesExample example = new TestCaseIssuesExample();
|
TestCaseIssuesExample example = new TestCaseIssuesExample();
|
||||||
example.createCriteria().andIssuesIdEqualTo(item.getId());
|
example.createCriteria().andIssuesIdEqualTo(item.getId());
|
||||||
long caseCount = testCaseIssuesMapper.countByExample(example);
|
List<TestCaseIssues> testCaseIssues = testCaseIssuesMapper.selectByExample(example);
|
||||||
item.setCaseCount(caseCount);
|
List<String> caseIds = testCaseIssues.stream()
|
||||||
|
.map(TestCaseIssues::getTestCaseId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
item.setCaseIds(caseIds);
|
||||||
|
item.setCaseCount(testCaseIssues.size());
|
||||||
});
|
});
|
||||||
return issues;
|
return issues;
|
||||||
}
|
}
|
||||||
|
|
|
@ -388,7 +388,12 @@ export default {
|
||||||
activated() {
|
activated() {
|
||||||
this.getTemplateField();
|
this.getTemplateField();
|
||||||
this.condition.filters = {reviewStatus: ["Prepare", "Pass", "UnPass"]};
|
this.condition.filters = {reviewStatus: ["Prepare", "Pass", "UnPass"]};
|
||||||
|
let ids = this.$route.params.ids;
|
||||||
|
if (ids) {
|
||||||
|
this.condition.ids = ids;
|
||||||
|
}
|
||||||
this.initTableData();
|
this.initTableData();
|
||||||
|
this.condition.ids = null;
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
selectNodeIds() {
|
selectNodeIds() {
|
||||||
|
|
|
@ -120,7 +120,7 @@
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
prop="caseCount">
|
prop="caseCount">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<router-link :to="'/track/case/all'">
|
<router-link :to="scope.row.caseCount > 0 ? {name: 'testCase', params: { projectId: 'all', ids: scope.row.caseIds }} : {}">
|
||||||
{{scope.row.caseCount}}
|
{{scope.row.caseCount}}
|
||||||
</router-link>
|
</router-link>
|
||||||
</template>
|
</template>
|
||||||
|
|
Loading…
Reference in New Issue