<div className={'main-content'} key={'main-content'}
style={{height: scrollerHeight, overflowY: 'scroll'}}
ref={c => {
this.scrollRef = c;
}}
onScrollCapture={() => this.onScrollHandle()}
>
<Table
onRow={record => {
return {
onClick: (e) => {},
onDoubleClick: (e) => {},
onContextMenu: (e) => {},
};
}}
rowSelection={rowSelection}
pagination={false}
columns={columns}
dataSource={fileList}/>
</div>
/*当前data数据显示完且滚动到底部时更新数据*/
onScrollHandle = () => {
const scrollTop = this.scrollRef.scrollTop;
const clientHeight = this.scrollRef.clientHeight;
const scrollHeight = this.scrollRef.scrollHeight;
const isBottom = scrollTop + clientHeight === scrollHeight;
let {totalElements,fileList, page} = this.state;
if (isBottom && fileList.length < totalElements) {
this.getFileList({page: page + 1, size: 100, parentId: '0'});
}
};