merge
This commit is contained in:
commit
83fed7b012
|
@ -144,8 +144,21 @@ class Demo27 extends Component {
|
|||
}
|
||||
},
|
||||
{ title: "姓名", width: 180, dataIndex: "name", key: "name", filterType: "text", filterDropdown: "show" },
|
||||
{ title: "年龄", width: 150, sorter: (a, b) => a.age - b.age, dataIndex: "age", key: "age", filterType: "dropdown", filterDropdown: "show" },
|
||||
{ title: "居住地址", width: 150, dataIndex: "address", key: "address", filterType: "dropdown", filterDropdown: "show" },
|
||||
{
|
||||
title: "年龄",
|
||||
width: 150,
|
||||
sorter: (a, b) => a.age - b.age,
|
||||
dataIndex: "age",
|
||||
key: "age",
|
||||
filterType: "dropdown",
|
||||
filterDropdown: "hide",
|
||||
filterDropdownAuto: "manual",//切换手动传入模式
|
||||
filterDropdownData: [{
|
||||
key: '数据',
|
||||
value: '数据'
|
||||
}]
|
||||
},
|
||||
{ title: "居住地址", width: 150, dataIndex: "address", key: "address", filterType: "dropdown", filterDropdown: "hide" },
|
||||
];
|
||||
return <ComplexTable
|
||||
onFilterRowsDropChange={this.handlerFilterRowsDropChange}//下拉条件的回调(key,val)=>()
|
||||
|
|
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
|
@ -349,7 +349,9 @@ class Table extends Component {
|
|||
dataindex: column.dataIndex,
|
||||
datasource: this.props.data,
|
||||
format: column.format,
|
||||
filterdropdown: column.filterDropdown
|
||||
filterdropdown: column.filterDropdown,
|
||||
filterdropdownauto: column.filterDropdownAuto,//是否自定义数据
|
||||
filterdropdowndata: column.filterDropdownData//自定义数据格式
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -247,7 +247,7 @@ class TableHeader extends Component {
|
|||
//下拉框选择
|
||||
case 'dropdown':
|
||||
let selectDataSource = [];
|
||||
if (rows.length > 0) {
|
||||
if (rows.length > 0 && (rows[1][index]['filterdropdownauto'] || 'auto') == 'auto') {
|
||||
let hash = {};
|
||||
//处理下拉重复对象组装dropdown
|
||||
selectDataSource = Array.from(rows[1][0].datasource, x => ({ key: x[dataIndex], value: x[dataIndex] }));
|
||||
|
@ -255,6 +255,8 @@ class TableHeader extends Component {
|
|||
hash[next.key] ? '' : hash[next.key] = true && item.push(next);
|
||||
return item
|
||||
}, []);
|
||||
} else {
|
||||
selectDataSource = rows[1][index]['filterdropdowndata']
|
||||
}
|
||||
return <FilterType
|
||||
rendertype={type}
|
||||
|
|
Loading…
Reference in New Issue