fix: 测试计划性能测试报告导出后缺少执行时长

This commit is contained in:
chenjianxing 2022-04-28 17:54:48 +08:00 committed by 刘瑞斌
parent e93bacf2d6
commit ecf43fc120
1 changed files with 20 additions and 1 deletions

View File

@ -2,6 +2,7 @@
<ms-container> <ms-container>
<el-main> <el-main>
<el-card v-loading="result.loading" v-if="show"> <el-card v-loading="result.loading" v-if="show">
<el-row v-if="isShare"> <el-row v-if="isShare">
<el-col :span="24"> <el-col :span="24">
<div> <div>
@ -21,6 +22,7 @@
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<el-row v-else> <el-row v-else>
<el-col :span="16"> <el-col :span="16">
<el-row v-if="!isPlanReport"> <el-row v-if="!isPlanReport">
@ -47,7 +49,8 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<span class="ms-report-time-desc"> <span class="ms-report-time-desc">
{{ $t('report.test_duration', [minutes, seconds]) }} {{ $t('report.test_duration', [ templateMinutes ? templateMinutes : minutes,
templateSeconds ? templateSeconds : seconds]) }}
</span> </span>
<span class="ms-report-time-desc" v-if="startTime !== '0'"> <span class="ms-report-time-desc" v-if="startTime !== '0'">
{{ $t('report.test_start_time') }}{{ startTime | timestampFormatDate }} {{ $t('report.test_start_time') }}{{ startTime | timestampFormatDate }}
@ -201,6 +204,22 @@ export default {
this.init(); this.init();
} }
}, },
computed: {
templateMinutes() {
if (this.planReportTemplate && this.planReportTemplate.duration) {
let duration = this.planReportTemplate.duration;
return Math.floor(duration / 60);
}
return null;
},
templateSeconds() {
if (this.planReportTemplate && this.planReportTemplate.duration) {
let duration = this.planReportTemplate.duration;
return duration % 60;
}
return null;
}
},
methods: { methods: {
initBreadcrumb(callback) { initBreadcrumb(callback) {
if (this.isPlanReport) { if (this.isPlanReport) {