fix:修改BUG

dashboard模块
1.修改问题:调整table类型图表空白区域大小导致图表间间隔变大
2.修改问题:曲线图刚加载时挤在左上角一团
3.曲线图显示加载2次
This commit is contained in:
hanyuxia
2020-02-25 14:33:51 +08:00
parent 5fd17fca27
commit 76706e2f8e
3 changed files with 14 additions and 19 deletions

View File

@@ -14,7 +14,7 @@
margin-right: 40px;
}
.chart-table {
width: calc(100% - 62px);
width: calc(100% - 18px);
height: 100%;//calc(100% - 40px);
// min-height: 500px;
position: relative;

View File

@@ -313,6 +313,7 @@
this.chartType = 'line';
}
let chartId = '';
if (chartSite === 'local') {
this.echartStore = echarts.init(ele);
chartId='lineChartArea';
@@ -663,11 +664,6 @@
return obj;
});
*/
this.echartStore.clear();
//option.title = title;
this.echartStore.setOption(option);//创建图表
//this.echartStore.hideLoading();
this.$refs['localLoading'+this.chartIndex].endLoading();
if(legend){
this.legendList = [];
legend.forEach((item, i) => {
@@ -686,8 +682,14 @@
}else {
this.echartStore.resize({height:(chartInfo.height-divHeight-25-35)});
}
});
this.echartStore.clear();
//option.title = title;
this.echartStore.setOption(option);//创建图表
this.$refs['localLoading'+this.chartIndex].endLoading();
this.firstShow = true; // 展示操作按键
});
} else if (chartSite === 'screen') { // 全屏显示
/*
option.series = dataArg.map((item) => {// params.series = dataArg.map((item) => {
@@ -740,10 +742,8 @@
}
option.title = {};
this.echartModalStore.setOption(option);//显示全屏界面
//this.echartModalStore.hideLoading();
this.showLegend = true;
this.$refs['localLoadingScreen'+this.chartIndex].endLoading();
//this.echartModalStore.resize({height:chartInfo.height});
if(legend){
this.screenLegendList = [];
legend.forEach((item, i) => {
@@ -758,14 +758,6 @@
this.$nextTick(() => {
let divHeight = this.$refs.screenLegendArea.offsetHeight;
this.echartModalStore.resize({height:(400-divHeight)});
/*
let divHeight = this.$refs.screenLegendArea.offsetHeight;
if(!chartInfo.height){
this.echartModalStore.resize({height:(400-divHeight)});
}else {
this.echartModalStore.resize({height:(chartInfo.height-divHeight-25)});
}
*/
});
}
},
@@ -1298,13 +1290,14 @@
},
mounted() {
this.firstLoad = false;
/*
let Myecharts2 = echarts.init(document.getElementById('lineChartArea'));
console.log(Myecharts2);
setTimeout(function () {
Myecharts2.resize()
}, 500)
*/
},
beforeDestroy() {},
};

View File

@@ -440,6 +440,7 @@
this.$get('panel?pageNo=1&pageSize=-1').then(response => {
if (response.code === 200) {
this.panelData = response.data.list;
let isInitData = false;
if (response.data.list.length > 0) {
if (this.$store.state.showPanel.id !== 0 && this.$store.state.showPanel.name !== '') {
this.showPanel.name = this.$store.state.showPanel.name;
@@ -453,6 +454,7 @@
this.showPanel.name = response.data.list[0].name;
this.filter.panelId = this.showPanel.id;
this.getData(this.filter);
isInitData = true;
}
this.filter.panelId = this.showPanel.id;
} else {
@@ -460,7 +462,7 @@
this.filter.panelId = '';
}
this.pageObj.total = response.data.total;
if (this.panel.id === '' || this.panel.id === this.showPanel.id) {
if (!isInitData &&(this.panel.id === '' || this.panel.id === this.showPanel.id)) {
this.getData(this.filter);
}
this.$store.state.showPanel.id = 0;