feat(视图):视图 表格 高度调整,界面变动自适应

This commit is contained in:
junjie 2021-04-25 18:49:57 +08:00
parent 90c406d108
commit 461b0dda24
2 changed files with 10 additions and 1 deletions

View File

@ -54,6 +54,7 @@ export default {
}
},
mounted() {
this.calcHeight()
this.init()
},
methods: {
@ -61,6 +62,14 @@ export default {
this.fields = JSON.parse(JSON.stringify(this.chart.data.fields))
const datas = JSON.parse(JSON.stringify(this.chart.data.tableRow))
this.$refs.plxTable.reloadData(datas)
const that = this
window.onresize = function() {
that.calcHeight()
}
},
calcHeight() {
const currentHeight = document.documentElement.clientHeight
this.height = currentHeight - 56 - 40 - 84 - 24 - 16 * 2 - 20
}
}
}

View File

@ -196,7 +196,7 @@
</el-row>
<chart-component v-if="chart.type && !chart.type.includes('table')" :chart-id="chart.id" :chart="chart" class="chart-class" />
<table-normal v-if="chart.type && chart.type.includes('table')" :chart="chart" />
<table-normal v-if="chart.type && chart.type.includes('table')" :chart="chart" class="chart-class" />
</el-row>
</el-col>
</el-row>