解决高度导致的白边问题
This commit is contained in:
parent
b6906eaa63
commit
3d6a157e1c
|
@ -36,7 +36,7 @@
|
||||||
bordered
|
bordered
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
:pagination="false"
|
:pagination="false"
|
||||||
:scroll="{ y: dynamicHeight }"
|
:scroll="{ y: tableScrollY }"
|
||||||
:columns="tagcolumns"
|
:columns="tagcolumns"
|
||||||
:dataSource="dataRefsSources">
|
:dataSource="dataRefsSources">
|
||||||
</a-table>
|
</a-table>
|
||||||
|
@ -67,7 +67,7 @@
|
||||||
</a-row>
|
</a-row>
|
||||||
</a-form>
|
</a-form>
|
||||||
<!-- table区域-begin -->
|
<!-- table区域-begin -->
|
||||||
<div style="height:calc(100vh - 324px);">
|
<div ref="tableWrapper" style="height:calc(100vh - 324px);">
|
||||||
<a-table
|
<a-table
|
||||||
ref="table"
|
ref="table"
|
||||||
size="middle"
|
size="middle"
|
||||||
|
@ -76,7 +76,7 @@
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:rowKey="getRowKey"
|
:rowKey="getRowKey"
|
||||||
:pagination="false"
|
:pagination="false"
|
||||||
:scroll="{ y: dynamicHeight }"
|
:scroll="{ y:tableScrollY }"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:dataSource="dataSource">
|
:dataSource="dataSource">
|
||||||
</a-table>
|
</a-table>
|
||||||
|
@ -166,6 +166,7 @@
|
||||||
tagselectedRowKeys: [],
|
tagselectedRowKeys: [],
|
||||||
selectedRowData: [],
|
selectedRowData: [],
|
||||||
tagselectedRowData: [],
|
tagselectedRowData: [],
|
||||||
|
tableScrollY:0,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -175,12 +176,6 @@
|
||||||
getRowKey(record) {
|
getRowKey(record) {
|
||||||
return `${record.schemaName}_${record.tableName}`
|
return `${record.schemaName}_${record.tableName}`
|
||||||
},
|
},
|
||||||
dynamicHeight() {
|
|
||||||
const totalOffset = this.headerHeight + this.footerHeight;
|
|
||||||
return {
|
|
||||||
height: `calc(100vh - 324px)`
|
|
||||||
}
|
|
||||||
},
|
|
||||||
rowSelection() {
|
rowSelection() {
|
||||||
return {
|
return {
|
||||||
selectedRowKeys: this.selectedRowKeys,
|
selectedRowKeys: this.selectedRowKeys,
|
||||||
|
@ -214,6 +209,12 @@
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
updateScrollY() {
|
||||||
|
const container = this.$refs.tableWrapper;
|
||||||
|
const paginationHeight = 64; // 分页栏高度
|
||||||
|
const tableHeaderHeight = 55; // 表头高度
|
||||||
|
this.tableScrollY = container.clientHeight - paginationHeight - tableHeaderHeight;
|
||||||
|
},
|
||||||
handleSelectChange(selectedRowKeys,row) {
|
handleSelectChange(selectedRowKeys,row) {
|
||||||
this.selectedRowKeys = selectedRowKeys
|
this.selectedRowKeys = selectedRowKeys
|
||||||
this.selectedRowData = row
|
this.selectedRowData = row
|
||||||
|
|
Loading…
Reference in New Issue
Block a user