fix(测试跟踪): 用例关联性能测试弹窗无版本信息

--bug=1018793 --user=宋昌昌 【测试跟踪】功能用例-编辑用例时关联性能用例弹框没有版本信息 https://www.tapd.cn/55049933/s/1275969
This commit is contained in:
song-cc-rock 2022-10-25 12:47:37 +08:00 committed by 刘瑞斌
parent a9422f7550
commit bab30dd9f9
4 changed files with 58 additions and 27 deletions

View File

@ -1,14 +1,19 @@
package io.metersphere.track.service;
import io.metersphere.base.domain.ProjectVersion;
import io.metersphere.base.mapper.ext.ExtLoadTestMapper;
import io.metersphere.commons.utils.CommonBeanFactory;
import io.metersphere.dto.LoadTestDTO;
import io.metersphere.plan.request.LoadCaseRequest;
import io.metersphere.service.ServiceUtils;
import io.metersphere.xpack.version.service.ProjectVersionService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service
@Transactional(rollbackFor = Exception.class)
@ -19,7 +24,17 @@ public class PerformanceTestCaseService {
public List<LoadTestDTO> getRelevanceLoadList(LoadCaseRequest request) {
List<LoadTestDTO> loadTestDTOList = extLoadTestMapper.relevanceLoadList(request);
ServiceUtils.buildVersionInfo(loadTestDTOList);
buildVersionInfo(loadTestDTOList);
return loadTestDTOList;
}
public void buildVersionInfo(List<LoadTestDTO> loadTests) {
List<String> versionIds = loadTests.stream().map(LoadTestDTO::getVersionId).collect(Collectors.toList());
ProjectVersionService projectVersionService = CommonBeanFactory.getBean(ProjectVersionService.class);
Map<String, String> projectVersionMap = projectVersionService.getProjectVersionByIds(versionIds).stream()
.collect(Collectors.toMap(ProjectVersion::getId, ProjectVersion::getName));
loadTests.forEach(loadTest -> {
loadTest.setVersionName(projectVersionMap.get(loadTest.getVersionId()));
});
}
}

View File

@ -1,13 +1,16 @@
<template>
<div>
<el-input :placeholder="$t('commons.search_by_name_or_id')" @blur="initTable"
@keyup.enter.native="initTable" class="search-input" size="small" v-model="condition.name"/>
<div class="right-search">
<version-select v-xpack :project-id="projectId" @changeVersion="changeVersion" margin-right="20"
class="version-select"/>
<ms-table-adv-search-bar :condition.sync="condition" class="adv-search-bar"
v-if="condition.components !== undefined && condition.components.length > 0"
@search="initTable"/>
<version-select v-xpack :project-id="projectId" @changeVersion="changeVersion" margin-right="20"
class="search-input"/>
<el-input :placeholder="$t('commons.search_by_name_or_id')" @blur="initTable"
@keyup.enter.native="initTable" class="search-input" size="small" v-model="condition.name"/>
<ms-table-adv-search-bar :condition.sync="condition" class="adv-search-bar"
v-if="condition.components !== undefined && condition.components.length > 0"
@search="initTable"/>
</div>
<ms-table v-loading="result.loading" :data="tableData" :select-node-ids="selectNodeIds" :condition="condition"
:page-size="pageSize"
@ -210,8 +213,12 @@ export default {
</script>
<style scoped>
.search-input {
.right-search {
float: right;
display: inline-block;
}
.search-input {
width: 300px;
/*margin-bottom: 20px;*/
margin-right: 20px;

View File

@ -1,14 +1,14 @@
<template>
<div>
<el-input :placeholder="$t('commons.search_by_name_or_id')" @blur="initTable"
@keyup.enter.native="initTable" class="search-input" size="small" v-model="condition.name"/>
<ms-table-adv-search-bar :condition.sync="condition" class="adv-search-bar"
v-if="condition.components !== undefined && condition.components.length > 0"
@search="initTable"/>
<version-select v-xpack :project-id="projectId" @changeVersion="changeVersion" margin-right="20"
class="search-input"/>
<div class="right-search">
<version-select v-xpack :project-id="projectId" @changeVersion="changeVersion" margin-right="20"
class="search-input"/>
<el-input :placeholder="$t('commons.search_by_name_or_id')" @blur="initTable"
@keyup.enter.native="initTable" class="search-input" size="small" v-model="condition.name"/>
<ms-table-adv-search-bar :condition.sync="condition" class="adv-search-bar"
v-if="condition.components !== undefined && condition.components.length > 0"
@search="initTable"/>
</div>
<ms-table v-loading="result.loading" :data="tableData" :condition="condition" :page-size="pageSize"
:total="total"
@ -183,8 +183,12 @@ export default {
</script>
<style scoped>
.search-input {
.right-search {
float: right;
display: inline-block;
}
.search-input {
width: 300px;
margin-right: 20px;
}

View File

@ -1,14 +1,15 @@
<template>
<div>
<div class="right-search">
<version-select v-xpack :project-id="projectId" @changeVersion="changeVersion" margin-right="20" />
<el-input :placeholder="$t('commons.search_by_name_or_id')" @blur="initTable"
@keyup.enter.native="initTable" class="search-input" size="small" v-model="condition.name"/>
<ms-table-adv-search-bar :condition.sync="condition" class="adv-search-bar"
v-if="condition.components !== undefined && condition.components.length > 0"
@search="initTable"/>
<el-input :placeholder="$t('commons.search_by_name_or_id')" @blur="initTable"
@keyup.enter.native="initTable" class="search-input" size="small" v-model="condition.name"/>
<version-select v-xpack :project-id="projectId" @changeVersion="changeVersion" margin-left="-100"
class="search-input"/>
<ms-table-adv-search-bar :condition.sync="condition" class="adv-search-bar"
v-if="condition.components !== undefined && condition.components.length > 0"
@search="initTable"/>
</div>
<ms-table v-loading="result.loading" :data="tableData" :select-node-ids="selectNodeIds" :condition="condition"
:page-size="pageSize"
@ -206,8 +207,12 @@ export default {
</script>
<style scoped>
.search-input {
.right-search {
float: right;
display: inline-block;
}
.search-input {
width: 300px;
margin-right: 20px;
}