* fix(接口测试):修复只读用户权限过高能对数据进行操作

* fix(测试计划):修复关联用例时样式不统一的问题

Co-authored-by: 黎龙鑫 <lilongxinya@163.com>
This commit is contained in:
Ambitiousliga 2021-03-18 14:48:19 +08:00 committed by GitHub
parent e7d78334f1
commit f5ec3169ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 70 additions and 47 deletions

View File

@ -8,7 +8,7 @@ import java.util.List;
public interface ExtTestPlanLoadCaseMapper {
List<String> selectIdsNotInPlan(@Param("projectId") String projectId, @Param("planId") String planId);
List<String> selectIdsNotInPlan(@Param("request") LoadCaseRequest request);
List<TestPlanLoadCaseDTO> selectTestPlanLoadCaseList(@Param("request") LoadCaseRequest request);
void updateCaseStatus(@Param("reportId") String reportId, @Param("status") String status);
List<String> getStatusByTestPlanId(@Param("planId") String planId);

View File

@ -10,9 +10,12 @@
<select id="selectIdsNotInPlan" resultType="java.lang.String">
select load_test.id
from load_test
where load_test.project_id = #{projectId}
where load_test.project_id = #{request.projectId}
<if test="request.name != null and request.name != ''">
and load_test.name like CONCAT('%', #{request.name},'%')
</if>
and load_test.id not in (
select tplc.load_case_id from test_plan_load_case tplc where tplc.test_plan_id = #{planId}
select tplc.load_case_id from test_plan_load_case tplc where tplc.test_plan_id = #{request.testPlanId}
)
</select>
<select id="selectTestPlanLoadCaseList" resultType="io.metersphere.track.dto.TestPlanLoadCaseDTO">

View File

@ -46,7 +46,7 @@ public class TestPlanLoadCaseService {
private LoadTestMapper loadTestMapper;
public List<LoadTest> relevanceList(LoadCaseRequest request) {
List<String> ids = extTestPlanLoadCaseMapper.selectIdsNotInPlan(request.getProjectId(), request.getTestPlanId());
List<String> ids = extTestPlanLoadCaseMapper.selectIdsNotInPlan(request);
if (CollectionUtils.isEmpty(ids)) {
return new ArrayList<>();
}

View File

@ -2,8 +2,17 @@
<div>
<el-card class="table-card" v-loading="result.loading">
<env-popover :env-map="projectEnvMap" :project-ids="projectIds" @setProjectEnvMap="setProjectEnvMap"
:project-list="projectList" ref="envPopover" class="env-popover"/>
<template v-slot:header>
<el-row>
<el-col :span="8" :offset="11">
<el-input :placeholder="$t('api_test.definition.request.select_case')" @blur="search"
@keyup.enter.native="search" class="search-input" size="small" v-model="condition.name"/>
</el-col>
<env-popover :env-map="projectEnvMap" :project-ids="projectIds" @setProjectEnvMap="setProjectEnvMap"
:project-list="projectList" ref="envPopover" class="env-popover"/>
</el-row>
</template>
<el-table ref="scenarioTable" border :data="tableData" class="adjust-table" @select-all="handleSelectAll" @select="handleSelect">
<el-table-column type="selection"/>

View File

@ -13,48 +13,59 @@
ref="nodeTree"/>
</template>
<el-card>
<template v-slot:header>
<el-row>
<el-col :span="8" :offset="16">
<el-input :placeholder="$t('api_test.definition.request.select_case')" @blur="getTestCases"
@keyup.enter.native="getTestCases" class="search-input" size="small" v-model="condition.name"/>
</el-col>
</el-row>
</template>
<el-table
v-loading="result.loading"
:data="testCases"
row-key="id"
@select-all="handleSelectAll"
@select="handleSelectionChange"
height="50vh"
ref="table">
<el-table-column
type="selection"/>
<el-table-column
prop="name"
:label="$t('commons.name')"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="status"
column-key="status"
:filters="statusFilters"
:label="$t('commons.status')">
<template v-slot:default="{row}">
<ms-performance-test-status :row="row"/>
</template>
</el-table-column>
<el-table-column
sortable
prop="createTime"
:label="$t('commons.create_time')">
<template v-slot:default="scope">
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column
sortable
prop="updateTime"
:label="$t('commons.update_time')">
<template v-slot:default="scope">
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
</template>
</el-table-column>
</el-table>
<el-table
v-loading="result.loading"
:data="testCases"
row-key="id"
@select-all="handleSelectAll"
@select="handleSelectionChange"
height="50vh"
ref="table">
<el-table-column
type="selection"/>
<el-table-column
prop="name"
:label="$t('commons.name')"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="status"
column-key="status"
:filters="statusFilters"
:label="$t('commons.status')">
<template v-slot:default="{row}">
<ms-performance-test-status :row="row"/>
</template>
</el-table-column>
<el-table-column
sortable
prop="createTime"
:label="$t('commons.create_time')">
<template v-slot:default="scope">
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column
sortable
prop="updateTime"
:label="$t('commons.update_time')">
<template v-slot:default="scope">
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
</template>
</el-table-column>
</el-table>
</el-card>
<ms-table-pagination :change="getTestCases" :current-page.sync="currentPage" :page-size.sync="pageSize"
:total="total"/>
</test-case-relevance-base>