Browse Source

动控模型页面优化

master
qiankanghui 8 hours ago
parent
commit
3ff953bf0b
  1. 19
      src/views/modules/tool/sceneDynamicControlModel.vue

19
src/views/modules/tool/sceneDynamicControlModel.vue

@ -246,11 +246,24 @@ export default {
mounted () {
this.loadOptions()
this.search()
this.$nextTick(() => {
this.tableHeight = window.innerHeight - 300
})
this.calcTableHeight()
window.addEventListener('resize', this.calcTableHeight)
},
beforeDestroy () {
window.removeEventListener('resize', this.calcTableHeight)
},
methods: {
/** 计算表格高度:让表格撑满剩余空间、分页贴紧页面底部,随窗口自适应 */
calcTableHeight () {
this.$nextTick(() => {
const tableEl = this.$el.querySelector('.el-table')
const top = tableEl ? tableEl.getBoundingClientRect().top : 0
// 预留分页栏高度 + 上下边距,使分页正好贴紧底部
const reserve = 40 + 10 + 10
const height = window.innerHeight - top - reserve
this.tableHeight = height > 200 ? height : 200
})
},
/** 加载状态/控制方式下拉 */
loadOptions () {
searchBaseDataList({}).then(({ data }) => {

Loading…
Cancel
Save