fix:修复alert图表x轴时间未处理的问题 & 修复endpoint-query页面显示异常
This commit is contained in:
@@ -1888,7 +1888,7 @@ li{
|
||||
height: 100%;
|
||||
}
|
||||
.ant-table-scroll .el-table {
|
||||
height: 100% !important;
|
||||
//height: 100% !important;
|
||||
}
|
||||
/*model侧滑中下拉框*/
|
||||
.autocomplete-dropdown {
|
||||
|
||||
@@ -508,7 +508,7 @@
|
||||
}
|
||||
this.legend.push(legend);
|
||||
chartData.data = queryData.values.map((dpsItem, dpsIndex) => {
|
||||
return [bus.computeTimezone(dpsItem[0]) * 1000, parseFloat(dpsItem[1]).toFixed(2)];
|
||||
return [dpsItem[0] * 1000, parseFloat(dpsItem[1]).toFixed(2)];
|
||||
});
|
||||
this.chartDatas.push(chartData);
|
||||
}
|
||||
|
||||
@@ -152,29 +152,13 @@
|
||||
}
|
||||
|
||||
if(this.chartType == 'line' || this.chartType == 'overviewLine'){
|
||||
let maxValueCopies = this.getMaxValue(this.series,{unit:this.unit});
|
||||
let maxValue=maxValueCopies.maxValue;
|
||||
let copies=maxValueCopies.copies;
|
||||
let unit=maxValueCopies.unit;
|
||||
// this.option.yAxis.minInterval=chartDataFormat.Interval(maxValue,copies,unit.type,'min');
|
||||
this.option.xAxis.axisLabel.formatter=this.defaultXAxisFormatter;
|
||||
if(this.yAxisFormatter){
|
||||
this.option.yAxis.axisLabel.formatter=this.yAxisFormatter;
|
||||
}else{
|
||||
this.option.yAxis.axisLabel.formatter=this.defaultYAxisFormatter
|
||||
}
|
||||
}
|
||||
if(this.chartType == 'overviewLine'){
|
||||
this.option.xAxis.axisLabel.formatter=function(value,index){
|
||||
value=bus.computeTimezone(value)
|
||||
let t_date = new Date(value);
|
||||
let month=t_date.getMonth()+1>9?t_date.getMonth()+1:'0'+(t_date.getMonth()+1);
|
||||
let day = t_date.getDate()>9?t_date.getDate():'0'+t_date.getDate();
|
||||
let hour = t_date.getHours()>9?t_date.getHours():'0'+t_date.getHours();
|
||||
let minute=t_date.getMinutes()>9?t_date.getMinutes():'0'+t_date.getMinutes();
|
||||
return [ month, day].join('-') + "\n"
|
||||
+ [hour, minute].join(':');
|
||||
}
|
||||
}
|
||||
if(this.series){
|
||||
this.$set(this.option,'series',this.series);
|
||||
this.noData=false;
|
||||
@@ -328,6 +312,17 @@
|
||||
return [x,y];
|
||||
}
|
||||
},
|
||||
defaultXAxisFormatter:function(value,index){
|
||||
value=bus.computeTimezone(value)
|
||||
let t_date = new Date(value);
|
||||
console.log(t_date)
|
||||
let month=t_date.getMonth()+1>9?t_date.getMonth()+1:'0'+(t_date.getMonth()+1);
|
||||
let day = t_date.getDate()>9?t_date.getDate():'0'+t_date.getDate();
|
||||
let hour = t_date.getHours()>9?t_date.getHours():'0'+t_date.getHours();
|
||||
let minute=t_date.getMinutes()>9?t_date.getMinutes():'0'+t_date.getMinutes();
|
||||
return [ month, day].join('-') + "\n"
|
||||
+ [hour, minute].join(':');
|
||||
},
|
||||
defaultTooltipFormatter:function(params){
|
||||
let str = `<div>`;
|
||||
params.forEach((item, i) => {
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
axisLabel: {
|
||||
interval: 0,
|
||||
rotate: 0,
|
||||
formatter: function (value) {
|
||||
formatter: function (value,index) {
|
||||
value=value
|
||||
var t_date = new Date(value);
|
||||
return [t_date.getFullYear(), t_date.getMonth() + 1, t_date.getDate()].join('-') + "\n"
|
||||
|
||||
Reference in New Issue
Block a user