fix(测试跟踪): 修复测试跟踪首页数据查询问题

This commit is contained in:
shiziyuan9527 2020-12-30 18:50:06 +08:00
parent 6ba32fbda9
commit 987ab3b395
3 changed files with 13 additions and 16 deletions

View File

@ -164,11 +164,10 @@
<select id="listRelate" resultType="io.metersphere.track.dto.TestPlanDTOWithMetric"> <select id="listRelate" resultType="io.metersphere.track.dto.TestPlanDTOWithMetric">
select distinct test_plan.* from test_plan select distinct test_plan.* from test_plan
inner join test_plan_project on test_plan.id = test_plan_project.test_plan_id
<where> <where>
test_plan.workspace_id = #{request.workspaceId} test_plan.workspace_id = #{request.workspaceId}
<if test="request.projectId != null"> <if test="request.projectId != null">
and test_plan_project.project_id = #{request.projectId} and test_plan.project_id = #{request.projectId}
</if> </if>
and (test_plan.principal = #{request.principal} and (test_plan.principal = #{request.principal}
<if test="request.planIds != null and request.planIds.size() > 0"> <if test="request.planIds != null and request.planIds.size() > 0">

View File

@ -272,13 +272,11 @@
select distinct plan_id from test_plan_test_case select distinct plan_id from test_plan_test_case
inner join test_plan inner join test_plan
on test_plan_test_case.plan_id = test_plan.id on test_plan_test_case.plan_id = test_plan.id
inner join test_plan_project
on test_plan.id = test_plan_project.test_plan_id
<where> <where>
test_plan_test_case.executor = #{userId} test_plan_test_case.executor = #{userId}
and test_plan.workspace_id = #{workspaceId} and test_plan.workspace_id = #{workspaceId}
<if test="projectId != null"> <if test="projectId != null">
and test_plan_project.project_id = #{projectId} and test_plan.project_id = #{projectId}
</if> </if>
</where> </where>
</select> </select>

View File

@ -58,11 +58,11 @@
<plan-stage-table-item :stage="scope.row.stage"/> <plan-stage-table-item :stage="scope.row.stage"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <!-- <el-table-column-->
prop="projectName" <!-- prop="projectName"-->
:label="$t('test_track.plan.plan_project')" <!-- :label="$t('test_track.plan.plan_project')"-->
show-overflow-tooltip> <!-- show-overflow-tooltip>-->
</el-table-column> <!-- </el-table-column>-->
</el-table> </el-table>
@ -94,12 +94,12 @@
} }
this.result = this.$post('/test/plan/list/all/relate', {}, response => { this.result = this.$post('/test/plan/list/all/relate', {}, response => {
this.tableData = response.data; this.tableData = response.data;
for (let i = 0; i < this.tableData.length; i++) { // for (let i = 0; i < this.tableData.length; i++) {
let path = "/test/plan/project/name/" + this.tableData[i].id; // let path = "/test/plan/project/name/" + this.tableData[i].id;
this.$get(path, res => { // this.$get(path, res => {
this.$set(this.tableData[i], "projectName", res.data); // this.$set(this.tableData[i], "projectName", res.data);
}) // })
} // }
}); });
}, },
intoPlan(row, event, column) { intoPlan(row, event, column) {