解决高度导致的白边问题
This commit is contained in:
parent
b6906eaa63
commit
3d6a157e1c
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user