mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-17 17:54:32 +08:00
修复表格滚动高度
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import React, { useState, useEffect, useRef } from 'react';
|
||||
import {
|
||||
Button,
|
||||
message,
|
||||
@@ -247,6 +247,7 @@ const Subscription = () => {
|
||||
const [searchValue, setSearchValue] = useState('');
|
||||
const [isLogModalVisible, setIsLogModalVisible] = useState(false);
|
||||
const [logSubscription, setLogSubscription] = useState<any>();
|
||||
const tableRef = useRef<any>();
|
||||
|
||||
const runSubscription = (record: any, index: number) => {
|
||||
Modal.confirm({
|
||||
@@ -539,11 +540,14 @@ const Subscription = () => {
|
||||
|
||||
useEffect(() => {
|
||||
setPageSize(parseInt(localStorage.getItem('pageSize') || '20'));
|
||||
setTimeout(() => {
|
||||
setTableScrollHeight(getTableScroll());
|
||||
});
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (tableRef.current) {
|
||||
setTableScrollHeight(getTableScroll());
|
||||
}
|
||||
}, [tableRef.current]);
|
||||
|
||||
return (
|
||||
<PageContainer
|
||||
className="ql-container-wrapper subscriptiontab-wrapper"
|
||||
@@ -568,6 +572,7 @@ const Subscription = () => {
|
||||
}}
|
||||
>
|
||||
<Table
|
||||
ref={tableRef}
|
||||
columns={columns}
|
||||
pagination={{
|
||||
current: currentPage,
|
||||
|
||||
Reference in New Issue
Block a user