fix: bug#13648
This commit is contained in:
parent
4bb50a9ebc
commit
617cd8b76b
|
@ -157,7 +157,15 @@ watch(
|
||||||
.dash-board-item {
|
.dash-board-item {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
//margin: 24px 12px;
|
//margin: 24px 12px;
|
||||||
min-width: 250px;
|
min-width: calc(25% - 24px);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 1400px) {
|
||||||
|
.dash-board {
|
||||||
|
.dash-board-item {
|
||||||
|
min-width: calc(50% - 24px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -43,19 +43,27 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
options: {},
|
options: {},
|
||||||
|
myChart: undefined
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
window.removeEventListener('resize', this.resize)
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
createChart(val) {
|
createChart(val) {
|
||||||
const chart = this.$refs.chartRef;
|
const chart = this.$refs.chartRef;
|
||||||
if (chart && Object.keys(val).length > 0) {
|
if (chart && Object.keys(val).length > 0 && !this.myChart) {
|
||||||
const myChart = echarts.init(chart);
|
console.log('createChart')
|
||||||
myChart.setOption(val);
|
this.myChart = echarts.init(chart);
|
||||||
window.addEventListener('resize', function () {
|
this.myChart.setOption(val);
|
||||||
myChart.resize();
|
window.addEventListener('resize', this.resize);
|
||||||
});
|
} else if (this.myChart) {
|
||||||
|
this.myChart.setOption(val);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
resize() {
|
||||||
|
this.myChart?.resize();
|
||||||
|
},
|
||||||
getOptions(max, formatter, val) {
|
getOptions(max, formatter, val) {
|
||||||
let formatterCount = 0;
|
let formatterCount = 0;
|
||||||
this.options = {
|
this.options = {
|
||||||
|
|
Loading…
Reference in New Issue