fix(接口自动化):修复报告请求饼图显示问题;修复 console 兼容历史数据;

This commit is contained in:
fit2-zhao 2021-06-10 17:30:47 +08:00 committed by fit2-zhao
parent 5033aa4d2c
commit 8e3407bbcb
3 changed files with 12 additions and 6 deletions

View File

@ -1,6 +1,6 @@
<template>
<ms-report-export-template :title="title" :type="$t('report.api_test_report')">
<ms-metric-chart :content="content" :totalTime="totalTime"/>
<ms-metric-chart :content="content" :is-export="true" :totalTime="totalTime"/>
<div class="scenario-result" v-for="(scenario, index) in content.scenarios" :key="index" :scenario="scenario">
<div>
<el-card>

View File

@ -9,13 +9,15 @@
</div>
</el-row>
<!--<ms-chart id="chart" ref="chart" :options="options" :autoresize="true"></ms-chart>-->
<div v-if="isExport">
<span class="ms-req ms-req-error" v-if="content.error && content.error>0">
<span class="ms-req-span"> {{content.success+content.error}} 请求</span>
</span>
<span class="ms-req ms-req-success" v-else>
<span class="ms-req-span"> {{content.success? content.success+content.error :0}} 请求</span>
</span>
</div>
<ms-chart id="chart" ref="chart" :options="options" :autoresize="true" v-else/>
<el-row type="flex" justify="center" align="middle">
<i class="circle success"/>
<div class="metric-box">
@ -87,7 +89,11 @@
components: {MsChart},
props: {
content: Object,
totalTime: Number
totalTime: Number,
isExport:{
type: Boolean,
default: false,
}
},
data() {
return {

View File

@ -12,7 +12,7 @@
</el-tab-pane>
<el-tab-pane :label="$t('api_test.definition.request.console')" name="console" class="pane">
<pre>{{ console }}</pre>
<pre>{{ console ? console : response.console }}</pre>
</el-tab-pane>
<el-tab-pane :label="$t('api_report.assertions')" name="assertions" class="pane assertions">