大数据量滚动加载场景,合并表格行时,出现样式错乱问题

This commit is contained in:
yangchch6 2019-08-23 15:51:32 +08:00
parent 487e2e145d
commit 46fa797429
11 changed files with 86807 additions and 73105 deletions

View File

@ -640,7 +640,7 @@ var TableRow = function (_Component) {
// key={hoverKey}
, ref: this.bindElement
},
cells.length > 0 ? cells : _react2["default"].createElement('td', null)
cells.length > 0 ? cells : _react2["default"].createElement('td', { style: { width: 0, padding: 0 } })
);
};

View File

@ -83,10 +83,10 @@ function bigData(Table) {
_this.startIndex = _this.currentIndex; //数据开始位置
_this.endIndex = _this.currentIndex + _this.loadCount; //数据结束位置
}
if (nextProps.data !== props.data) {
//wh fix: 滚动加载场景中,数据动态改变下占位计算错误的问题(26 Jun)
// _this.cachedRowHeight = []; //缓存每行的高度
// _this.cachedRowParentIndex = [];
if (nextProps.data.toString() !== props.data.toString()) {
//fix: 滚动加载场景中,数据动态改变下占位计算错误的问题(26 Jun)
_this.cachedRowHeight = []; //缓存每行的高度
_this.cachedRowParentIndex = [];
_this.computeCachedRowParentIndex(nextProps.data);
if (nextProps.data.length > 0) {
_this.endIndex = _this.currentIndex - nextProps.loadBuffer + _this.loadCount; //数据结束位置

View File

@ -7,7 +7,6 @@
*/
import React, { Component } from "react";
import {Button,Tooltip} from "tinper-bee";
import Table from "../../src";
const columns = [

View File

@ -29,7 +29,7 @@ const columns16 = [
},
{ title: "订单编号", dataIndex: "a", key: "a", width: 250 },
{ id: "123", title: "单据日期", dataIndex: "b", key: "b", width: 100 },
{ title: "供应商", dataIndex: "c", key: "c", width: 200 },
{ title: "供应商", dataIndex: "c", key: "c", width: 200, fixed:'right' },
];
const columns17 = [

View File

@ -64,16 +64,16 @@ class Demo30 extends Component {
render() {
return (
<div>
<BigDataTable
columns={columns}
data={data}
data={this.state.data}
scroll={{y:300}}
onRowClick={(record, index, indent) => {
console.log('currentIndex--'+index);
}}
/>
</div>
);
}
}

File diff suppressed because one or more lines are too long

102460
dist/demo.js vendored

File diff suppressed because one or more lines are too long

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -105,7 +105,7 @@ import 'bee-table/build/Table.css';
|:--|:---|:--|:---|
|key|列的键|string|-|
|className|传入列的classname|String |-|
|colSpan|该列的colSpan设置列合并|Number|-|
|colSpan|表头列合并,设置为 0 时,不渲染|Number|-|
|title|列的标题|node|-|
|dataIndex| 显示数据记录的字段|String|-|
|width|宽度的特定比例根据列的宽度计算|String/Number|-|
@ -126,6 +126,7 @@ import 'bee-table/build/Table.css';
| filterDropdownIncludeKeys | 能够设置指定的下拉条件项通过设置keys 其中string条件可设置:LIKE,ULIKE,EQ,UEQ,START,END.number条件可设置:GT,GTEQ,LT,LTEQ,EQ,UEQ | array | [] 不设置此属性为显示所有
| filterInputNumberOptions | 数值框接收的props具体属性参考bee-input-number | object | null
| textAlign | 内容对齐方式,默认是左对齐('left、right、center' | string |
| mergeEndIndex | 大数据量滚动加载场景,合并表格行时,设置合并结束位置的行 index 值,设置在列 render 函数中的 props 属性上 | Number |
### 高阶函数

View File

@ -525,7 +525,7 @@ class TableRow extends Component{
// key={hoverKey}
ref={this.bindElement}
>
{cells.length>0?cells:<td></td>}
{cells.length>0?cells:<td style={{width:0,padding:0}}></td>}
</tr>
);
}

View File

@ -60,10 +60,10 @@ export default function bigData(Table) {
_this.endIndex = _this.currentIndex + _this.loadCount; //数据结束位置
}
if (nextProps.data !== props.data) {
//wh fix: 滚动加载场景中,数据动态改变下占位计算错误的问题(26 Jun)
// _this.cachedRowHeight = []; //缓存每行的高度
// _this.cachedRowParentIndex = [];
if (nextProps.data.toString() !== props.data.toString()) {
//fix: 滚动加载场景中,数据动态改变下占位计算错误的问题(26 Jun)
_this.cachedRowHeight = []; //缓存每行的高度
_this.cachedRowParentIndex = [];
_this.computeCachedRowParentIndex(nextProps.data);
if(nextProps.data.length>0){
_this.endIndex = _this.currentIndex - nextProps.loadBuffer + _this.loadCount; //数据结束位置