refactor(接口监控):http状态码监控可跳转到相应报告

This commit is contained in:
chenfanghang 2020-12-07 14:29:40 +08:00
parent 063726b5cc
commit a590e93b89
1 changed files with 10 additions and 15 deletions

View File

@ -2,7 +2,7 @@
<common-monitor-chart> <common-monitor-chart>
<template> <template>
<div id="response-time-chart" :style="{ width:'100%',height:'100%' }"> <div id="response-time-chart" :style="{ width:'100%',height:'100%' }">
<chart :options="getOptions()" :style="{ width:'100%' }"></chart> <chart :options="getOptions()" :style="{ width:'100%' }" v-on:click="click"></chart>
</div> </div>
</template> </template>
</common-monitor-chart> </common-monitor-chart>
@ -27,8 +27,6 @@ export default {
}, },
methods: { methods: {
click(params) { click(params) {
//2
if (params.value.substr(0, 1) !== '2') {
let startTime = params.name; let startTime = params.name;
this.result = this.$$get('/api/monitor/getReportId', {'startTime': startTime}, { this.result = this.$$get('/api/monitor/getReportId', {'startTime': startTime}, {
'apiUrl': this.apiUrl 'apiUrl': this.apiUrl
@ -36,11 +34,8 @@ export default {
this.reportId = response.data; this.reportId = response.data;
let reportId = this.reportId let reportId = this.reportId
let url = '#/api/report/view/' + reportId; let url = '#/api/report/view/' + reportId;
let target = '_blank'; window.open(url, '_blank');
window.open(url, target);
}); });
}
}, },
getOptions() { getOptions() {
return { return {