fix(接口测试): 报告页面时间显示调整,响应不刷新,页面全部展开

This commit is contained in:
wenyann 2020-08-13 09:51:03 +08:00
parent b0e0aa1327
commit 7530fff681
5 changed files with 25 additions and 22 deletions

View File

@ -42,6 +42,7 @@
import MsScenarioResult from "./components/ScenarioResult";
import MsMetricChart from "./components/MetricChart";
import MsScenarioResults from "./components/ScenarioResults";
import {Scenario} from "../test/model/ScenarioModel";
export default {
name: "MsApiReportView",
@ -119,9 +120,12 @@
}
},
requestResult(requestResult) {
this.isRequestResult = true;
this.request = requestResult.request;
this.scenarioName = requestResult.scenarioName;
this.isRequestResult = false;
this.$nextTick(function () {
this.isRequestResult = true;
this.request = requestResult.request;
this.scenarioName = requestResult.scenarioName;
});
}
},

View File

@ -3,9 +3,12 @@
<el-row type="flex" align="middle">
<div style="width: 50%">
<el-row type="flex" justify="center" align="middle">
<div class="metric-time">
<div class="value" style="margin-left: -150px">{{time}}</div>
</div>
<el-row>
<div class="metric-time">
<div class="value" style="margin-right: 10px">{{time}}</div>
</div>
</el-row>
<chart id="chart" ref="chart" :options="options" :autoresize="true"></chart>
<el-row type="flex" justify="center" align="middle">
<i class="circle success"/>

View File

@ -39,17 +39,18 @@
methods: {
active() {
this.$emit("requestResult", {request: this.request, scenarioName: this.scenarioName});
}
},
computed: {
assertion() {
return this.request.passAssertions + " / " + this.request.totalAssertions;
},
hasSub() {
return this.request.subRequestResults.length > 0;
}
}
/* computed: {
assertion() {
return this.request.passAssertions + " / " + this.request.totalAssertions;
},
hasSub() {
return this.request.subRequestResults.length > 0;
}
}*/
}
</script>

View File

@ -7,10 +7,7 @@
<el-collapse-transition>
<el-tabs v-model="activeName" v-show="isActive">
<el-tab-pane label="Body" name="body" class="pane">
<!--
<ms-code-edit :mode="mode" :read-only="true" :data="response.body" :modes="modes" ref="codeEdit"/>
-->
<pre>{{response.body}}</pre>
<ms-code-edit :mode="mode" :read-only="true" :data="response.body" :modes="modes" ref="codeEdit"/>
</el-tab-pane>
<el-tab-pane label="Headers" name="headers" class="pane">
<pre>{{response.headers}}</pre>

View File

@ -1,7 +1,5 @@
<template>
<div>
<editor v-model="formatData" :lang="mode" @init="editorInit" theme="chrome"/>
</div>
</template>
<script>
@ -65,7 +63,7 @@
this.init(editor);
}
},
/*format() {
format() {
if (this.mode === 'json') {
try {
this.formatData = JSON.stringify(JSON.parse(this.data), null, '\t');
@ -79,7 +77,7 @@
this.formatData = this.data;
}
}
}*/
}
}
}
</script>