Compare commits

...

8 Commits

Author SHA1 Message Date
yangchch6 4755c07ffc 同步 master 代码 2019-09-11 16:12:16 +08:00
yangchch6 3d48277026 树形表懒加载 2019-08-31 11:11:07 +08:00
yangchch6 f861b5e012 树表懒加载高度计算 2019-08-30 17:48:15 +08:00
yangchch6 7a29fb4f56 树表滚动加载 2019-08-30 16:09:06 +08:00
yangchch6 5bd7ea17a8 feat:增加onBodyScroll回调函数 2019-08-27 10:55:06 +08:00
yangchch6 6e77f2000b 大数据量滚动加载场景,合并表格行时,出现样式错乱问题 2019-08-23 15:15:39 +08:00
yangchch6 f11b4fc4c0 merge 2019-08-22 15:05:13 +08:00
yangchch6 57f742014a fix:滚动加载场景,更新数据源,表体显示空白问题 2019-08-22 14:59:23 +08:00
9 changed files with 547 additions and 18 deletions

View File

@ -446,6 +446,214 @@ class Demo0505 extends Component {
/>
)
},
{
title: "名字",
dataIndex: "b",
key: "b",
render: (text, record, index) => (
<StringEditCell
colName={"名字"}
editable={this.state.isEditingAll}
isEdited={record.isEdited.b || false}
required
value={text}
onChange={this.onCellChange(index, "b")}
throwError={this.throwError}
/>
)
},
{
title: "名字",
dataIndex: "b",
key: "b",
render: (text, record, index) => (
<StringEditCell
colName={"名字"}
editable={this.state.isEditingAll}
isEdited={record.isEdited.b || false}
required
value={text}
onChange={this.onCellChange(index, "b")}
throwError={this.throwError}
/>
)
},
{
title: "名字",
dataIndex: "b",
key: "b",
render: (text, record, index) => (
<StringEditCell
colName={"名字"}
editable={this.state.isEditingAll}
isEdited={record.isEdited.b || false}
required
value={text}
onChange={this.onCellChange(index, "b")}
throwError={this.throwError}
/>
)
},
{
title: "名字",
dataIndex: "b",
key: "b",
render: (text, record, index) => (
<StringEditCell
colName={"名字"}
editable={this.state.isEditingAll}
isEdited={record.isEdited.b || false}
required
value={text}
onChange={this.onCellChange(index, "b")}
throwError={this.throwError}
/>
)
},
{
title: "名字",
dataIndex: "b",
key: "b",
render: (text, record, index) => (
<StringEditCell
colName={"名字"}
editable={this.state.isEditingAll}
isEdited={record.isEdited.b || false}
required
value={text}
onChange={this.onCellChange(index, "b")}
throwError={this.throwError}
/>
)
},
{
title: "名字",
dataIndex: "b",
key: "b",
render: (text, record, index) => (
<StringEditCell
colName={"名字"}
editable={this.state.isEditingAll}
isEdited={record.isEdited.b || false}
required
value={text}
onChange={this.onCellChange(index, "b")}
throwError={this.throwError}
/>
)
},
{
title: "名字",
dataIndex: "b",
key: "b",
render: (text, record, index) => (
<StringEditCell
colName={"名字"}
editable={this.state.isEditingAll}
isEdited={record.isEdited.b || false}
required
value={text}
onChange={this.onCellChange(index, "b")}
throwError={this.throwError}
/>
)
},
{
title: "名字",
dataIndex: "b",
key: "b",
render: (text, record, index) => (
<StringEditCell
colName={"名字"}
editable={this.state.isEditingAll}
isEdited={record.isEdited.b || false}
required
value={text}
onChange={this.onCellChange(index, "b")}
throwError={this.throwError}
/>
)
},
{
title: "名字",
dataIndex: "b",
key: "b",
render: (text, record, index) => (
<StringEditCell
colName={"名字"}
editable={this.state.isEditingAll}
isEdited={record.isEdited.b || false}
required
value={text}
onChange={this.onCellChange(index, "b")}
throwError={this.throwError}
/>
)
},
{
title: "名字",
dataIndex: "b",
key: "b",
render: (text, record, index) => (
<StringEditCell
colName={"名字"}
editable={this.state.isEditingAll}
isEdited={record.isEdited.b || false}
required
value={text}
onChange={this.onCellChange(index, "b")}
throwError={this.throwError}
/>
)
},
{
title: "名字",
dataIndex: "b",
key: "b",
render: (text, record, index) => (
<StringEditCell
colName={"名字"}
editable={this.state.isEditingAll}
isEdited={record.isEdited.b || false}
required
value={text}
onChange={this.onCellChange(index, "b")}
throwError={this.throwError}
/>
)
},
{
title: "名字",
dataIndex: "b",
key: "b",
render: (text, record, index) => (
<StringEditCell
colName={"名字"}
editable={this.state.isEditingAll}
isEdited={record.isEdited.b || false}
required
value={text}
onChange={this.onCellChange(index, "b")}
throwError={this.throwError}
/>
)
},
{
title: "名字",
dataIndex: "b",
key: "b",
render: (text, record, index) => (
<StringEditCell
colName={"名字"}
editable={this.state.isEditingAll}
isEdited={record.isEdited.b || false}
required
value={text}
onChange={this.onCellChange(index, "b")}
throwError={this.throwError}
/>
)
},
// 只是用来占位占宽度的
{
key: "placeholder"

View File

@ -92,15 +92,16 @@ class Demo16 extends Component {
render() {
return (
<MultiSelectTable
<Table
className="expanded-table"
columns={columns16}
data={data16}
onExpand={this.getData}
expandedRowRender={this.expandedRowRender}
expandIconAsCell={true}
collapsedIcon={<Icon type='uf-anglearrowpointingtoright'/>}
expandedIcon={<Icon type='uf-treearrow-down'/>}
// expandIconAsCell={true}
expandIconColumnIndex={2}
// collapsedIcon={<Icon type='uf-anglearrowpointingtoright'/>}
// expandedIcon={<Icon type='uf-treearrow-down'/>}
/>
);
}

View File

@ -83,6 +83,9 @@ class Demo30 extends Component {
onBodyScroll={this.handleBodyScroll}
/>
</div>
);
}
}

View File

@ -13,16 +13,71 @@ import BigData from "../../src/lib/bigData";
import multiSelect from '../../src/lib/multiSelect';
import filterColumn from '../../src/lib/filterColumn';
let ComplexTable = filterColumn(multiSelect(BigData(Table), Checkbox), Popover, Icon);
let ComplexTable = filterColumn(BigData(Table), Popover, Icon);
const columns = [
{
className: 'u-table-multiSelect-column',
title: (
<Checkbox
className="table-checkbox"
/>
),
key: "checkbox",
dataIndex: "checkbox",
fixed:"left",
width: 49,
render: (text, record, index) => {
const obj = {
children: <Checkbox
key={index}
className="table-checkbox"
/>,
props: {},
};
if (index === 0) {
obj.props.rowSpan = 100;
} else {
obj.props.rowSpan = 0;
}
obj.props.mergeEndIndex = 100;
// if (index < 50 ) {
// obj.props.mergeEndIndex = 50;
// } else if (index > 50 && index < 100) {
// obj.props.mergeEndIndex = 100;
// } else if (index > 100) {
// obj.props.mergeEndIndex = 150;
// }
return obj;
}
},
{
title:'序号',
dataIndex:'index',
width:'80',
key:'index',
fixed:'left',
render:(text,record,index)=>{
return index
// return index
const obj = {
children: index,
props: {},
};
if (index === 0) {
obj.props.rowSpan = 100;
} else {
obj.props.rowSpan = 0;
}
obj.props.mergeEndIndex = 100;
// if (index < 50 ) {
// obj.props.mergeEndIndex = 50;
// } else if (index > 50 && index < 100) {
// obj.props.mergeEndIndex = 100;
// } else if (index > 100) {
// obj.props.mergeEndIndex = 150;
// }
// mergeEndIndex: 滚动加载场景,合并表行时,设置合并结束位置的行 index 值
return obj;
}
},
{
@ -46,7 +101,7 @@ const columns = [
{ title: "年龄", dataIndex: "c", key: "c", width: 200 }
];
const data = [ ...new Array(10000) ].map((e, i) => {
const data = [ ...new Array(100) ].map((e, i) => {
const rs = { a: i + 'a', b: i + 'b', c: i + 'c', d: i + 'd', key: i };
if(i%3==0){
rs.b = '女';

View File

@ -47,6 +47,9 @@ const data = [ ...new Array(1000) ].map((e, i) => {
if(i%3==0){
rs.b = '女';
rs.children = [];
// for(let subi=0;subi<3;subi++){
// rs.children.push({a: i +subi + 'asub', b: i +subi + 'bsub', c: i + subi +'csub', d: i + subi +'dsub', key: i+ `${subi} sub`});
// }
for(let subi=0;subi<3;subi++){
rs.children.push({a: i +subi + 'asub', b: i +subi + 'bsub', c: i + subi +'csub', d: i + subi +'dsub', key: i+ `${subi} sub`});
rs.children[subi].children = []

File diff suppressed because one or more lines are too long

273
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

@ -558,6 +558,10 @@ export default function bigData(Table) {
lazyLoad.sufHeight = this.getSumHeight(endIndex, data.length);
}
// console.log('*******expandedRowKeys*****'+expandedRowKeys);
// console.log(
// "**startIndex**" , startIndex,
// "**endIndex**" , endIndex
// );
return (
<Table
{...this.props}