|
@@ -1,6 +1,6 @@
|
|
|
-import React from 'react'
|
|
|
|
|
|
|
+import React, { useState } from 'react'
|
|
|
import ProTable from '@ant-design/pro-table'
|
|
import ProTable from '@ant-design/pro-table'
|
|
|
-// import { Table } from 'antd'
|
|
|
|
|
|
|
+import { useTableScroll } from '@/hooks/useAutoTable'
|
|
|
|
|
|
|
|
const Lockcount = () => {
|
|
const Lockcount = () => {
|
|
|
// const { modalVisible, onCancel } = props;
|
|
// const { modalVisible, onCancel } = props;
|
|
@@ -44,6 +44,9 @@ const Lockcount = () => {
|
|
|
]
|
|
]
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
|
|
+
|
|
|
|
|
+ const [selectKeys, setSelectKeys] = useState([])
|
|
|
|
|
+ const { getScrollRef, redoHeight } = useTableScroll(columns, selectKeys)
|
|
|
return (
|
|
return (
|
|
|
<div>
|
|
<div>
|
|
|
<ProTable
|
|
<ProTable
|
|
@@ -52,6 +55,10 @@ const Lockcount = () => {
|
|
|
headerTitle="使用统计"
|
|
headerTitle="使用统计"
|
|
|
bordered
|
|
bordered
|
|
|
columns={columns}
|
|
columns={columns}
|
|
|
|
|
+ scroll={getScrollRef}
|
|
|
|
|
+ onLoadingChange={loadingStatus => {
|
|
|
|
|
+ loadingStatus && redoHeight()
|
|
|
|
|
+ }}
|
|
|
// toolbar={{
|
|
// toolbar={{
|
|
|
// search: {
|
|
// search: {
|
|
|
// allowClear: true
|
|
// allowClear: true
|