refactor(测试计划): 性能测试用例按照项目查询
This commit is contained in:
parent
73f09844bb
commit
a2856898d6
|
@ -8,5 +8,5 @@ import java.util.List;
|
|||
public interface ExtTestPlanLoadCaseMapper {
|
||||
|
||||
List<String> selectIdsNotInPlan(@Param("projectId") String projectId, @Param("planId") String planId);
|
||||
List<TestPlanLoadCaseDTO> selectTestPlanLoadCaseList(@Param("planId") String planId);
|
||||
List<TestPlanLoadCaseDTO> selectTestPlanLoadCaseList(@Param("planId") String planId, @Param("projectId") String projectId);
|
||||
}
|
||||
|
|
|
@ -11,11 +11,25 @@
|
|||
)
|
||||
</select>
|
||||
<select id="selectTestPlanLoadCaseList" resultType="io.metersphere.track.dto.TestPlanLoadCaseDTO">
|
||||
select tplc.id, u.name as userName, tplc.create_time, tplc.update_time, tplc.test_plan_id, tplc.load_case_id,
|
||||
lt.status, lt.name as caseName, tplc.load_report_id
|
||||
select tplc.id,
|
||||
u.name as userName,
|
||||
tplc.create_time,
|
||||
tplc.update_time,
|
||||
tplc.test_plan_id,
|
||||
tplc.load_case_id,
|
||||
lt.status,
|
||||
lt.name as caseName,
|
||||
tplc.load_report_id,
|
||||
p.name as projectName
|
||||
from test_plan_load_case tplc
|
||||
inner join load_test lt on tplc.load_case_id = lt.id
|
||||
inner join user u on lt.user_id = u.id
|
||||
where tplc.test_plan_id = #{planId}
|
||||
inner join project p on lt.project_id = p.id
|
||||
<where>
|
||||
tplc.test_plan_id = #{planId}
|
||||
<if test="projectId != null and projectId != ''">
|
||||
and lt.project_id = #{projectId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
|
@ -9,4 +9,5 @@ import lombok.Setter;
|
|||
public class TestPlanLoadCaseDTO extends TestPlanLoadCase {
|
||||
private String userName;
|
||||
private String caseName;
|
||||
private String projectName;
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ public class TestPlanLoadCaseService {
|
|||
}
|
||||
|
||||
public List<TestPlanLoadCaseDTO> list(LoadCaseRequest request) {
|
||||
return extTestPlanLoadCaseMapper.selectTestPlanLoadCaseList(request.getTestPlanId());
|
||||
return extTestPlanLoadCaseMapper.selectTestPlanLoadCaseList(request.getTestPlanId(), request.getProjectId());
|
||||
}
|
||||
|
||||
public void relevanceCase(LoadCaseRequest request) {
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
class="table-list"
|
||||
@refresh="refresh"
|
||||
:plan-id="planId"
|
||||
:select-node-ids="selectNodeIds"
|
||||
:select-project-id="selectProjectId"
|
||||
:select-parent-nodes="selectParentNodes"
|
||||
@relevanceCase="openTestCaseRelevanceDialog"
|
||||
ref="testPlanLoadCaseList"/>
|
||||
|
@ -46,6 +46,7 @@ export default {
|
|||
result: {},
|
||||
selectNodeIds: [],
|
||||
selectParentNodes: [],
|
||||
selectProjectId: "",
|
||||
treeNodes: [],
|
||||
}
|
||||
},
|
||||
|
@ -74,8 +75,7 @@ export default {
|
|||
this.$refs.testCaseLoadRelevance.open();
|
||||
},
|
||||
nodeChange(node, nodeIds, pNodes) {
|
||||
this.selectNodeIds = nodeIds;
|
||||
this.selectParentNodes = pNodes;
|
||||
this.selectProjectId = node.key;
|
||||
// 切换node后,重置分页数
|
||||
this.$refs.testPlanLoadCaseList.currentPage = 1;
|
||||
this.$refs.testPlanLoadCaseList.pageSize = 10;
|
||||
|
@ -84,6 +84,8 @@ export default {
|
|||
if (this.planId) {
|
||||
this.result = this.$get("/case/node/list/plan/" + this.planId, response => {
|
||||
this.treeNodes = response.data;
|
||||
// 性能测试与模块无关,过滤项目下模块
|
||||
this.treeNodes.map(node => node.children = null);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
|
@ -30,12 +30,11 @@
|
|||
:label="$t('commons.name')"
|
||||
show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column-->
|
||||
<!-- prop="projectName"-->
|
||||
<!-- :label="$t('load_test.project_name')"-->
|
||||
<!-- width="150"-->
|
||||
<!-- show-overflow-tooltip>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column
|
||||
prop="projectName"
|
||||
:label="$t('load_test.project_name')"
|
||||
show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="userName"
|
||||
:label="$t('load_test.user_name')"
|
||||
|
@ -148,7 +147,7 @@ export default {
|
|||
}
|
||||
},
|
||||
props: {
|
||||
selectNodeIds: Array,
|
||||
selectProjectId: String,
|
||||
isReadOnly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
|
@ -159,7 +158,7 @@ export default {
|
|||
this.initTable();
|
||||
},
|
||||
watch: {
|
||||
selectNodeIds() {
|
||||
selectProjectId() {
|
||||
this.initTable();
|
||||
},
|
||||
planId() {
|
||||
|
@ -168,7 +167,12 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
initTable() {
|
||||
this.$post("/test/plan/load/case/list/" + this.currentPage + "/" + this.pageSize, {testPlanId: this.planId}, response => {
|
||||
let param = {};
|
||||
param.testPlanId = this.planId;
|
||||
if (this.selectProjectId && this.selectProjectId !== 'root') {
|
||||
param.projectId = this.selectProjectId;
|
||||
}
|
||||
this.$post("/test/plan/load/case/list/" + this.currentPage + "/" + this.pageSize, param, response => {
|
||||
let data = response.data;
|
||||
this.total = data.itemCount;
|
||||
this.tableData = data.listObject;
|
||||
|
|
Loading…
Reference in New Issue