|
@@ -12,8 +12,8 @@
|
|
|
<span style="font-size:18px;" v-else>{{name}}</span>
|
|
|
</div>
|
|
|
|
|
|
- <div id="scaleMain" style="width:100%;min-width:500px;height:180px;margin-bottom:24px"></div>
|
|
|
- <LineCharts class="line-div"/>
|
|
|
+ <!-- <div id="scaleMain" style="width:100%;min-width:500px;height:180px;margin-bottom:24px"></div> -->
|
|
|
+ <LineCharts class="line-div" @chartClick="chartClick"/>
|
|
|
<el-table
|
|
|
v-loading="tableLoading"
|
|
|
:data="rowData"
|
|
@@ -64,7 +64,6 @@ import { getUrlMappingRange } from '@/api/mapping'
|
|
|
import storage from '@/utils/storage'
|
|
|
|
|
|
// import resize from './mixins/resize'
|
|
|
-import moment from 'moment'
|
|
|
import LineCharts from './components/LineCharts.vue'
|
|
|
export default {
|
|
|
data(){
|
|
@@ -156,9 +155,6 @@ export default {
|
|
|
},
|
|
|
mounted(){
|
|
|
this.handelgetUrlMappingRange();
|
|
|
- this.$nextTick(() =>{
|
|
|
- this.drawEchartsScale(this.row);
|
|
|
- })
|
|
|
// document.addEventListener('click', this.handleChartClick);
|
|
|
},
|
|
|
methods:{
|
|
@@ -172,114 +168,6 @@ export default {
|
|
|
// this.myChartScale.dispatchAction({ type: 'hideTip' });
|
|
|
// }
|
|
|
// },
|
|
|
- drawEchartsScale(row) {
|
|
|
- let _this = this;
|
|
|
- if(row != null){
|
|
|
- // let myChartScale = this.$echarts5.init(document.getElementById('scaleMain'));
|
|
|
- _this.myChartScale = this.$echarts5.init(document.getElementById('scaleMain'));
|
|
|
- //绘制趋势echarts
|
|
|
- let option = {
|
|
|
- tooltip: {
|
|
|
- trigger: 'axis',
|
|
|
- // confine: false,
|
|
|
- // appendToBody: true,
|
|
|
- // showContent: () => {},
|
|
|
- // hideContent: () => {},
|
|
|
- // show: true,
|
|
|
- // formatter: function (params) {
|
|
|
- // storage.set('paramsValue',params)
|
|
|
- // return params
|
|
|
- // },
|
|
|
- formatter: function (params) {
|
|
|
- storage.set('paramsValue',params)
|
|
|
- let axisValueLabel = params[0].axisValueLabel
|
|
|
- let str0 = '';
|
|
|
- params.forEach((item, idx) => {
|
|
|
- // str1+=`${}`
|
|
|
- str0 += `${item.marker}${item.seriesName}<span style='margin-left:30px;text-align:right;font-weight:400'>${item.data}</span>`
|
|
|
- switch (idx) {
|
|
|
- case 0:
|
|
|
- str0;
|
|
|
- break;
|
|
|
- case 1:
|
|
|
- str0;
|
|
|
- break;
|
|
|
- default:
|
|
|
- str0
|
|
|
- }
|
|
|
- str0 += idx === params.length - 1 ? '' : '<br/>'
|
|
|
- })
|
|
|
- return axisValueLabel+ '<br>' + str0
|
|
|
- }
|
|
|
- },
|
|
|
- grid: {
|
|
|
- left: '2%',
|
|
|
- right: '8%',
|
|
|
- bottom: 0,
|
|
|
- containLabel: true
|
|
|
- },
|
|
|
- xAxis: {
|
|
|
- type: 'category',
|
|
|
- boundaryGap: false,
|
|
|
- data: row.duration_stats.time,
|
|
|
- // show:true
|
|
|
- },
|
|
|
- yAxis: {
|
|
|
- type: 'value',
|
|
|
- scale: true,
|
|
|
- gridIndex:0,
|
|
|
- axisLabel: {
|
|
|
- formatter: '{value}'
|
|
|
- },
|
|
|
- axisLine:{
|
|
|
- show:true
|
|
|
- },
|
|
|
- axisTick:{
|
|
|
- show:true
|
|
|
- },
|
|
|
- splitLine: {
|
|
|
- show: true
|
|
|
- },
|
|
|
- },
|
|
|
- series: [
|
|
|
- {
|
|
|
- name: 'P.50',
|
|
|
- type: 'line',
|
|
|
- stack: 'Total',
|
|
|
- symbol: 'none',
|
|
|
- // symbol: 'emptyCircle',//拐点
|
|
|
- data:row.duration_stats.p50
|
|
|
- },
|
|
|
- {
|
|
|
- name: 'P.95',
|
|
|
- type: 'line',
|
|
|
- stack: 'Total',
|
|
|
- symbol: 'none',//拐点
|
|
|
- // symbol: 'emptyCircle',//拐点
|
|
|
- data:row.duration_stats.p90
|
|
|
- },
|
|
|
- {
|
|
|
- name: 'P.99',
|
|
|
- type: 'line',
|
|
|
- stack: 'Total',
|
|
|
- symbol: 'none',//拐点
|
|
|
- // symbol: 'emptyCircle',//拐点
|
|
|
- data:row.duration_stats.p99
|
|
|
- }
|
|
|
- ]
|
|
|
- };
|
|
|
- _this.myChartScale.setOption(option);
|
|
|
-
|
|
|
- _this.myChartScale.getZr().on('click', params => {
|
|
|
- let data = storage.get('paramsValue')
|
|
|
- let timestamp = moment(data[0].name).unix();
|
|
|
-
|
|
|
- _this.childQueryParams.start_time = timestamp
|
|
|
- _this.childQueryParams.end_time =timestamp
|
|
|
- _this.handelgetUrlMappingRange();
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
Refresh(timeOut){
|
|
|
this.serviceMapTimer = setInterval(()=>{
|
|
|
},timeOut)
|
|
@@ -314,6 +202,11 @@ export default {
|
|
|
// path:'/service/Interface/index'
|
|
|
// })
|
|
|
},
|
|
|
+ chartClick(timestamp){
|
|
|
+ this.childQueryParams.start_time = timestamp;
|
|
|
+ this.childQueryParams.end_time = timestamp;
|
|
|
+ this.handelgetUrlMappingRange();
|
|
|
+ }
|
|
|
},
|
|
|
beforeDestroy(){
|
|
|
clearInterval(this.serviceMapTimer);
|