解决高度导致的白边问题

This commit is contained in:
RenCheng 2025-03-09 13:54:08 +08:00
parent b6906eaa63
commit 3d6a157e1c

View File

@ -36,7 +36,7 @@
bordered
rowKey="id"
:pagination="false"
:scroll="{ y: dynamicHeight }"
:scroll="{ y: tableScrollY }"
:columns="tagcolumns"
:dataSource="dataRefsSources">
</a-table>
@ -67,7 +67,7 @@
</a-row>
</a-form>
<!-- table区域-begin -->
<div style="height:calc(100vh - 324px);">
<div ref="tableWrapper" style="height:calc(100vh - 324px);">
<a-table
ref="table"
size="middle"
@ -76,7 +76,7 @@
:loading="loading"
:rowKey="getRowKey"
:pagination="false"
:scroll="{ y: dynamicHeight }"
:scroll="{ y:tableScrollY }"
:columns="columns"
:dataSource="dataSource">
</a-table>
@ -166,6 +166,7 @@
tagselectedRowKeys: [],
selectedRowData: [],
tagselectedRowData: [],
tableScrollY:0,
}
},
mounted() {
@ -175,12 +176,6 @@
getRowKey(record) {
return `${record.schemaName}_${record.tableName}`
},
dynamicHeight() {
const totalOffset = this.headerHeight + this.footerHeight;
return {
height: `calc(100vh - 324px)`
}
},
rowSelection() {
return {
selectedRowKeys: this.selectedRowKeys,
@ -214,6 +209,12 @@
},
methods: {
updateScrollY() {
const container = this.$refs.tableWrapper;
const paginationHeight = 64; //
const tableHeaderHeight = 55; //
this.tableScrollY = container.clientHeight - paginationHeight - tableHeaderHeight;
},
handleSelectChange(selectedRowKeys,row) {
this.selectedRowKeys = selectedRowKeys
this.selectedRowData = row