fix:修改BUG

dashboard模块:1 修改图表页面进行预览,遮罩层显示在修改图表界面之下 2 新增修改图表预览界面预览echart图表时tooltip无法正常随鼠标移动 3 Metric Preview修改为Explore
This commit is contained in:
hanyuxia
2020-03-30 22:10:59 +08:00
parent 4a6a83bd5c
commit c2c090059b
3 changed files with 14 additions and 43 deletions

View File

@@ -232,8 +232,7 @@
methods: { methods: {
// 全屏查看 // 全屏查看
show(chartInfo) { show(chartInfo) {
this.searchTime[0] = new Date().setHours(new Date().getHours()-1); this.searchTime = [new Date().setHours(new Date().getHours()-1),new Date()];
this.searchTime[1] =new Date();
this.chart=chartInfo; this.chart=chartInfo;
let chartType= chartInfo.type; let chartType= chartInfo.type;
let chartContainerId = 'chartEchartPreview' let chartContainerId = 'chartEchartPreview'
@@ -267,7 +266,7 @@
chartDiv.style.height = `${height-this.chartSpaceHeight-this.titleHeight}px`; chartDiv.style.height = `${height-this.chartSpaceHeight-this.titleHeight}px`;
const addChartBox = document.querySelector('.right-box-add-chart'); const addChartBox = document.querySelector('.right-box-add-chart');
//this.oldChartBoxCss = addChartBox.style.cssText; //this.oldChartBoxCss = addChartBox.style.cssText;
addChartBox.style.cssText = 'z-index:2003 !important'; addChartBox.style.cssText = 'z-index:1500 !important';
if(chartType==='table'){ if(chartType==='table'){
const tableBox = document.getElementById('tableContainer'); const tableBox = document.getElementById('tableContainer');
tableBox.style.height = `${height-this.titleHeight-this.pageHeight}px`;//-75-32+25 tableBox.style.height = `${height-this.titleHeight-this.pageHeight}px`;//-75-32+25
@@ -579,45 +578,17 @@
//提示框大小 //提示框大小
var boxWidth = size.contentSize[0]; var boxWidth = size.contentSize[0];
var boxHeight = size.contentSize[1]; var boxHeight = size.contentSize[1];
if (chartSite === 'local') { // 本地显示 if(pointX<(viewWidth/2)){//说明鼠标在左边放不下提示框
let chartDom = document.getElementById(chartInfo.title+"_"+chartInfo.id); x=pointX+10;
if(chartDom){ }else{
let parTop = document.getElementById(chartInfo.title+"_"+chartInfo.id).offsetTop; x = pointX - boxWidth;
let parleft = document.getElementById(chartInfo.title+"_"+chartInfo.id).offsetLeft;
let parent = document.getElementById('tableList');
let parClientHeight = parent.clientHeight;//可视高度
let parClientWidth = parent.clientWidth;//可视宽度
let parScrollTop = parent.scrollTop;
if((parClientWidth-pointX-parleft-20)>=boxWidth){//说明鼠标在左边放不下提示框
x=pointX+10;
}else{
x = pointX - boxWidth;
}
if((parClientHeight-pointY-(parTop-parScrollTop)-20)>=boxHeight){//说明鼠标上面放不下提示框
y = pointY+10;
}else {
y = pointY-boxHeight;
}
return [x,y];
}else {//preview page
x = pointX - boxWidth;
y = pointY+10;
return [x,y];
}
}else {
if(pointX<(viewWidth/2)){//说明鼠标在左边放不下提示框
x=pointX+10;
}else{
x = pointX - boxWidth;
}
if(pointY<(viewHeight/2)){//说明鼠标上面放不下提示框
y = pointY+10;
}else {
y = pointY-boxHeight;
}
return [x,y];
} }
if(pointY<(viewHeight/2)){//说明鼠标上面放不下提示框
y = pointY+10;
}else {
y = pointY-boxHeight;
}
return [x,y];
}, },
formatter:function(params){ formatter:function(params){
//display:inline-block;white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis; //display:inline-block;white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis;

View File

@@ -139,7 +139,7 @@ const cn = {
saveChartToPanel:"保存图表到看板" saveChartToPanel:"保存图表到看板"
}, },
metricPreview:{ metricPreview:{
title:'指标预览', title:'探索',
}, },
refresh:'刷新', refresh:'刷新',
edit:'编辑', edit:'编辑',

View File

@@ -178,7 +178,7 @@ const en = {
saveChartToPanel:"Save chart to panel"//Save chart to panel. saveChartToPanel:"Save chart to panel"//Save chart to panel.
}, },
metricPreview:{ metricPreview:{
title:'Metric preview',//'指标预览' title:'Explore',
}, },
refresh:'Refresh',//'刷新' refresh:'Refresh',//'刷新'
edit:'Edit',//'编辑' edit:'Edit',//'编辑'