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