This commit is contained in:
parent
062ec94019
commit
96aade8948
|
@ -124,12 +124,12 @@ function bigData(Table) {
|
|||
|
||||
this.handleScroll = function (nextScrollTop) {
|
||||
var _this = _this3;
|
||||
|
||||
var _this$props = _this.props,
|
||||
data = _this$props.data,
|
||||
height = _this$props.height,
|
||||
_this$props$scroll = _this$props.scroll,
|
||||
scroll = _this$props$scroll === undefined ? {} : _this$props$scroll;
|
||||
scroll = _this$props$scroll === undefined ? {} : _this$props$scroll,
|
||||
loadBuffer = _this$props.loadBuffer;
|
||||
|
||||
var rowHeight = height ? height : defaultHeight;
|
||||
var _this$currentIndex = _this.currentIndex,
|
||||
|
@ -195,7 +195,7 @@ function bigData(Table) {
|
|||
// 向下滚动 下临界值超出缓存的endIndex则重新渲染
|
||||
if (rowsInView + index > endIndex - rowDiff && isOrder) {
|
||||
|
||||
_this3.startIndex = index;
|
||||
_this3.startIndex = index - loadBuffer;
|
||||
endIndex = _this3.startIndex + loadCount;
|
||||
if (endIndex > data.length) {
|
||||
endIndex = data.length;
|
||||
|
@ -205,7 +205,7 @@ function bigData(Table) {
|
|||
}
|
||||
// 向上滚动,当前的index是否已经加载(currentIndex),若干上临界值小于startIndex则重新渲染
|
||||
if (!isOrder && index < startIndex + rowDiff) {
|
||||
startIndex = index - parseInt(_this3.loadCount / 2); //有时会是小数问题,所以parseInt转换下
|
||||
startIndex = index - loadBuffer;
|
||||
if (startIndex < 0) {
|
||||
startIndex = 0;
|
||||
}
|
||||
|
|
|
@ -85,8 +85,9 @@ class Demo31 extends Component {
|
|||
|
||||
return (
|
||||
<Table
|
||||
|
||||
columns={innerColumns}
|
||||
style={{height:height}}
|
||||
// style={{height:height}}
|
||||
data={this.state.data_obj[record.key]}
|
||||
|
||||
/>
|
||||
|
@ -130,7 +131,7 @@ class Demo31 extends Component {
|
|||
onExpand={this.getData}
|
||||
expandedRowRender={this.expandedRowRender}
|
||||
scroll={{y:350}}
|
||||
defaultExpandedRowKeys={[0,1]}
|
||||
// defaultExpandedRowKeys={[0,1]}
|
||||
title={currentData => <div>标题: 这是一个标题</div>}
|
||||
footer={currentData => <div>表尾: 我是小尾巴</div>}
|
||||
/>
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -10322,5 +10322,17 @@ li.rc-time-picker-panel-select-option-disabled:hover {
|
|||
.demo25 .u-table-filter-column-filter-icon {
|
||||
right: 15px; }
|
||||
|
||||
th .drop-menu .uf {
|
||||
font-size: 12px;
|
||||
visibility: hidden;
|
||||
margin-left: 15px; }
|
||||
|
||||
th:hover .uf {
|
||||
visibility: visible; }
|
||||
|
||||
.demo3 .u-table-thead th {
|
||||
padding-top: 0px;
|
||||
padding-bottom: 0px; }
|
||||
|
||||
|
||||
/*# sourceMappingURL=demo.css.map */
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -508,7 +508,7 @@ class Table extends Component {
|
|||
let expandedRowContent;
|
||||
if (expandedRowRender && isRowExpanded) {
|
||||
expandedRowContent = expandedRowRender(record, i, indent);
|
||||
expandedContentHeight = parseInt(expandedRowContent.props.style?expandedRowContent.props.style.height:0);
|
||||
expandedContentHeight = parseInt(expandedRowContent.props.style && expandedRowContent.props.style.height?expandedRowContent.props.style.height:0);
|
||||
}
|
||||
//只有当使用expandedRowRender参数的时候才去识别isHiddenExpandIcon(隐藏行展开的icon)
|
||||
if (expandedRowRender && typeof props.haveExpandIcon == 'function') {
|
||||
|
@ -985,10 +985,9 @@ class Table extends Component {
|
|||
}
|
||||
this.lastScrollTop = e.target.scrollTop;
|
||||
if(handleScroll){
|
||||
const scrollTop = e.target.scrollTop
|
||||
debounce(
|
||||
handleScroll(scrollTop)
|
||||
,200);
|
||||
handleScroll(this.lastScrollTop)
|
||||
,500);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ class TableRow extends Component{
|
|||
|
||||
|
||||
setRowHeight() {
|
||||
const { setRowHeight , expandedContentHeight,lazyCurrentIndex=0,fixed} = this.props
|
||||
const { setRowHeight , expandedContentHeight=0,lazyCurrentIndex=0,fixed} = this.props
|
||||
if (!setRowHeight || !this.element || fixed) return
|
||||
setRowHeight(this.element.clientHeight + expandedContentHeight, this.props.index+lazyCurrentIndex)
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ export default function bigData(Table) {
|
|||
*/
|
||||
handleScroll = (nextScrollTop)=> {
|
||||
const _this = this;
|
||||
const {data,height,scroll={}} = _this.props;
|
||||
const {data,height,scroll={},loadBuffer} = _this.props;
|
||||
const rowHeight = height?height:defaultHeight;
|
||||
const {currentIndex = 0 ,loadCount,scrollTop,currentScrollTop} = _this;
|
||||
let {endIndex,startIndex} = _this;
|
||||
|
@ -117,7 +117,7 @@ handleScroll = (nextScrollTop)=> {
|
|||
// 向下滚动 下临界值超出缓存的endIndex则重新渲染
|
||||
if(rowsInView+index > endIndex - rowDiff && isOrder){
|
||||
|
||||
this.startIndex = index;
|
||||
this.startIndex = index - loadBuffer;
|
||||
endIndex = this.startIndex + loadCount
|
||||
if(endIndex > data.length){
|
||||
endIndex = data.length
|
||||
|
@ -127,7 +127,7 @@ handleScroll = (nextScrollTop)=> {
|
|||
}
|
||||
// 向上滚动,当前的index是否已经加载(currentIndex),若干上临界值小于startIndex则重新渲染
|
||||
if(!isOrder && index < startIndex + rowDiff){
|
||||
startIndex = index - parseInt(this.loadCount/2);//有时会是小数问题,所以parseInt转换下
|
||||
startIndex = index - loadBuffer;
|
||||
if(startIndex<0){
|
||||
startIndex = 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue