fix(测试跟踪): 修复运行环境显示错位的问题

--bug=1015018 --user=宋天阳 【测试跟踪】测试计划报告里的运行环境显示错位了
https://www.tapd.cn/55049933/s/1204559
This commit is contained in:
song-tianyang 2022-07-19 17:18:01 +08:00 committed by f2c-ci-robot[bot]
parent 61b2618c8f
commit c5d28e436d
2 changed files with 33 additions and 14 deletions

View File

@ -422,13 +422,27 @@
<select id="selectByResourceIdsAndMaxCreateTime" <select id="selectByResourceIdsAndMaxCreateTime"
resultType="io.metersphere.base.domain.ApiDefinitionExecResultWithBLOBs"> resultType="io.metersphere.base.domain.ApiDefinitionExecResultWithBLOBs">
SELECT resource_id,max(create_time) AS create_time, id, env_config, project_id FROM api_definition_exec_result SELECT
execResult.resource_id,
execResult.create_time,
execResult.id,
execResult.env_config,
execResult.project_id
FROM api_definition_exec_result execResult
INNER JOIN ( SELECT
resource_id,
max( create_time + 0 ) AS create_time
FROM
api_definition_exec_result
WHERE WHERE
resource_id IN resource_id IN
<foreach collection="ids" item="id" separator="," open="(" close=")"> <foreach collection="ids" item="id" separator="," open="(" close=")">
#{id} #{id}
</foreach> </foreach>
GROUP BY resource_id; GROUP BY
resource_id )maxdata ON maxdata.resource_id = execResult.resource_id AND maxdata.create_time = execResult.create_time;
</select> </select>
<select id="findByProjectIds" resultType="io.metersphere.base.domain.ApiDefinitionExecResult" <select id="findByProjectIds" resultType="io.metersphere.base.domain.ApiDefinitionExecResult"

View File

@ -4,21 +4,26 @@
<el-form-item :label="$t('test_track.report.testing_time') + ':'"> <el-form-item :label="$t('test_track.report.testing_time') + ':'">
{{ showTime }} {{ showTime }}
</el-form-item> </el-form-item>
<el-row type="flex" class="select-time" <el-row class="select-time"
v-if="report.envGroupName || report.projectEnvMap"> v-if="report.envGroupName || report.projectEnvMap" style="display:inline-block">
<el-form-item :label="$t('commons.environment') + ':'" style="width: 100%"> <div>
<div v-if="report.envGroupName" style="margin-left: 12px"> <div style="float: left">
{{$t('commons.environment') + ':'}}
</div>
<div style="float: right">
<div v-if="report.envGroupName" style="margin-left: 42px">
<ms-tag type="danger" :content="$t('commons.group')"></ms-tag> <ms-tag type="danger" :content="$t('commons.group')"></ms-tag>
{{ report.envGroupName }} {{ report.envGroupName }}
</div> </div>
<div v-else-if="report.projectEnvMap" style="margin-left: 12px"> <div v-else-if="report.projectEnvMap" style="margin-left: 42px">
<div v-for="(values,key) in report.projectEnvMap" :key="key" style="margin-right: 10px"> <div v-for="(values,key) in report.projectEnvMap" :key="key" style="margin-right: 10px">
{{ key + ":" }} {{ key + ":" }}
<ms-tag v-for="(item,index) in values" :key="index" type="success" :content="item" <ms-tag v-for="(item,index) in values" :key="index" type="success" :content="item"
style="margin-left: 2px"/> style="margin-left: 2px"/>
</div> </div>
</div> </div>
</el-form-item> </div>
</div>
</el-row> </el-row>
<el-row type="flex" justify="space-between" class="select-time"> <el-row type="flex" justify="space-between" class="select-time">
<el-col :span="8"> <el-col :span="8">