fix(测试计划): 时间修改
This commit is contained in:
parent
59c9cdfef2
commit
0222b053b0
|
@ -115,8 +115,9 @@
|
||||||
getFails() {
|
getFails() {
|
||||||
if (this.isNotRunning) {
|
if (this.isNotRunning) {
|
||||||
this.fails = [];
|
this.fails = [];
|
||||||
|
|
||||||
this.content.scenarios.forEach((scenario) => {
|
this.content.scenarios.forEach((scenario) => {
|
||||||
this.totalTime = scenario.responseTime + scenario.responseTime
|
this.totalTime = this.totalTime + scenario.responseTime
|
||||||
let failScenario = Object.assign({}, scenario);
|
let failScenario = Object.assign({}, scenario);
|
||||||
if (scenario.error > 0) {
|
if (scenario.error > 0) {
|
||||||
this.fails.push(failScenario);
|
this.fails.push(failScenario);
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<div style="width: 50%">
|
<div style="width: 50%">
|
||||||
<el-row type="flex" justify="center" align="middle">
|
<el-row type="flex" justify="center" align="middle">
|
||||||
<div class="metric-time">
|
<div class="metric-time">
|
||||||
<div class="value" style="margin-left: -150px">{{this.minutes}}min{{this.seconds}}s</div>
|
<div class="value" style="margin-left: -150px">{{time}}</div>
|
||||||
</div>
|
</div>
|
||||||
<chart id="chart" ref="chart" :options="options" :autoresize="true"></chart>
|
<chart id="chart" ref="chart" :options="options" :autoresize="true"></chart>
|
||||||
<el-row type="flex" justify="center" align="middle">
|
<el-row type="flex" justify="center" align="middle">
|
||||||
|
@ -52,14 +52,36 @@
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
content: Object,
|
content: Object,
|
||||||
totalTime: Number
|
totalTime: String
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
minutes: Math.floor((this.totalTime % (1000 * 60 * 60)) / (1000 * 60)),
|
hour:0,
|
||||||
seconds: Math.round((this.totalTime % (1000 * 60)) / 1000),
|
minutes: 0,
|
||||||
|
seconds: 0,
|
||||||
|
time: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
created() {
|
||||||
|
this.initTime()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
initTime() {
|
||||||
|
this.time=this.totalTime
|
||||||
|
this.seconds = Math.floor(this.time / 1000);
|
||||||
|
if (this.seconds > 60) {
|
||||||
|
this.minutes = Math.floor(this.time/60)
|
||||||
|
this.seconds=Math.floor(this.time%60)
|
||||||
|
this.time=this.minutes+"min"+this.seconds+"s"
|
||||||
|
}
|
||||||
|
if(this.minutes>60){
|
||||||
|
this.hour=Math.floor(this.minutes/60)
|
||||||
|
this.minutes = Math.floor(this.minutes%60)
|
||||||
|
this.time=this.hour+"hour"+this.minutes+"min"+this.seconds+"s"
|
||||||
|
}
|
||||||
|
this.time=this.seconds+"s"
|
||||||
|
},
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
options() {
|
options() {
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in New Issue