修复表格滚动

This commit is contained in:
whyour
2022-11-04 19:14:03 +08:00
parent 543c241bc6
commit 90af5801ee
7 changed files with 171 additions and 225 deletions
+2 -8
View File
@@ -29,11 +29,11 @@ import config from '@/utils/config';
import { PageContainer } from '@ant-design/pro-layout';
import { request } from '@/utils/http';
import SubscriptionModal from './modal';
import { getTableScroll } from '@/utils/index';
import { history, useOutletContext } from '@umijs/max';
import './index.less';
import SubscriptionLogModal from './logModal';
import { SharedContext } from '@/layouts';
import useTableScrollHeight from '@/hooks/useTableScrollHeight';
const { Text, Paragraph } = Typography;
const { Search } = Input;
@@ -243,11 +243,11 @@ const Subscription = () => {
const [searchText, setSearchText] = useState('');
const [currentPage, setCurrentPage] = useState(1);
const [pageSize, setPageSize] = useState(20);
const [tableScrollHeight, setTableScrollHeight] = useState<number>();
const [searchValue, setSearchValue] = useState('');
const [isLogModalVisible, setIsLogModalVisible] = useState(false);
const [logSubscription, setLogSubscription] = useState<any>();
const tableRef = useRef<any>();
const tableScrollHeight = useTableScrollHeight(tableRef)
const runSubscription = (record: any, index: number) => {
Modal.confirm({
@@ -542,12 +542,6 @@ const Subscription = () => {
setPageSize(parseInt(localStorage.getItem('pageSize') || '20'));
}, []);
useEffect(() => {
if (tableRef.current) {
setTableScrollHeight(getTableScroll());
}
}, []);
return (
<PageContainer
className="ql-container-wrapper subscriptiontab-wrapper"