This commit is contained in:
wanghaoo 2018-10-16 19:07:13 +08:00
commit 50520aaf6b
12 changed files with 66 additions and 31 deletions

View File

@ -1,3 +1,8 @@
<a name="1.4.17"></a>
## [1.4.17](https://github.com/tinper-bee/bee-table/compare/v1.4.16...v1.4.17) (2018-10-15)
<a name="1.4.16"></a> <a name="1.4.16"></a>
## [1.4.16](https://github.com/tinper-bee/bee-table/compare/v1.4.15...v1.4.16) (2018-10-12) ## [1.4.16](https://github.com/tinper-bee/bee-table/compare/v1.4.15...v1.4.16) (2018-10-12)

View File

@ -130,6 +130,8 @@ class Demo extends Component {
| format | 针对过滤下拉设置日期类的格式 | string | YYYY-MM-DD | | format | 针对过滤下拉设置日期类的格式 | string | YYYY-MM-DD |
| filterDropdownAuto | 设置下拉条件是否自动设置选项,`auto`自动根据当前数据生成,`manual`手动传入,可以使用`filterDropdownData`来传入自定义数据 | string | auto | | filterDropdownAuto | 设置下拉条件是否自动设置选项,`auto`自动根据当前数据生成,`manual`手动传入,可以使用`filterDropdownData`来传入自定义数据 | string | auto |
| filterDropdownData | 下拉条件自定义数据filterDropdownAuto=manual生效传入格式[{ key : "自定义", value : "自定义" }] | array | [] | | filterDropdownData | 下拉条件自定义数据filterDropdownAuto=manual生效传入格式[{ key : "自定义", value : "自定义" }] | array | [] |
| filterDropdownFocus | 触发点击下拉条件的回调,一般用于异步点击请求数据使用 | function | () => () |
## 如何引用 ## 如何引用

View File

@ -447,7 +447,8 @@ var Table = function (_Component) {
format: column.format, format: column.format,
filterdropdown: column.filterDropdown, filterdropdown: column.filterDropdown,
filterdropdownauto: column.filterDropdownAuto, //是否自定义数据 filterdropdownauto: column.filterDropdownAuto, //是否自定义数据
filterdropdowndata: column.filterDropdownData //自定义数据格式 filterdropdowndata: column.filterDropdownData, //自定义数据格式
filterdropdownfocus: column.filterDropdownFocus //焦点触发函数回调
}); });
} }
}); });

View File

@ -276,7 +276,8 @@ var TableHeader = function (_Component) {
data: selectDataSource, data: selectDataSource,
onChange: _this.handlerFilterTextChange.bind(_this, dataIndex), onChange: _this.handlerFilterTextChange.bind(_this, dataIndex),
onSelectDropdown: _this.handlerFilterDropChange.bind(_this, dataIndex), onSelectDropdown: _this.handlerFilterDropChange.bind(_this, dataIndex),
filterDropdown: rows[1][index]['filterdropdown'] filterDropdown: rows[1][index]['filterdropdown'],
onFocus: rows[1][index]['filterdropdownfocus']
}); });
//日期 //日期
case 'date': case 'date':
@ -388,6 +389,7 @@ var TableHeader = function (_Component) {
} }
if (filterable && index == rows.length - 1) { if (filterable && index == rows.length - 1) {
da.children = _this2.filterRenderType(da['filtertype'], da.dataindex, i); da.children = _this2.filterRenderType(da['filtertype'], da.dataindex, i);
delete da.filterdropdownfocus;
} }
if (draggable) { if (draggable) {
return _react2["default"].createElement('th', _extends({}, da, { return _react2["default"].createElement('th', _extends({}, da, {

View File

@ -1,7 +1,7 @@
/** /**
* *
* @title 组合过滤和其他功能使用 * @title 组合过滤和其他功能使用
* @description 在过滤数据行的基础上增加列拖拽动态菜单显示 * @description 在过滤数据行的基础上增加列拖拽动态菜单显示下拉条件动态传入自定义
* *
*/ */
@ -100,6 +100,12 @@ const data27 = [
const MultiSelectTable = multiSelect(Table, Checkbox); const MultiSelectTable = multiSelect(Table, Checkbox);
const ComplexTable = sort(MultiSelectTable, Icon); const ComplexTable = sort(MultiSelectTable, Icon);
class Demo27 extends Component { class Demo27 extends Component {
constructor(props) {
super(props);
this.state = {
dropdownvalue: []
}
}
handlerFilterRowsChange = (key, val) => { handlerFilterRowsChange = (key, val) => {
console.log('准备构建AJAX请求接收参数key=', key, ' value=', val); console.log('准备构建AJAX请求接收参数key=', key, ' value=', val);
} }
@ -153,10 +159,12 @@ class Demo27 extends Component {
filterType: "dropdown", filterType: "dropdown",
filterDropdown: "hide", filterDropdown: "hide",
filterDropdownAuto: "manual",//切换手动传入模式 filterDropdownAuto: "manual",//切换手动传入模式
filterDropdownData: [{ filterDropdownData: this.state.dropdownvalue,
key: '数据', filterDropdownFocus: () => {
value: '数据' this.setState({
}] dropdownvalue: [{ key: "自定义数据1", value: "1" }, { key: "自定义数据2", value: "2" }]
});
}
}, },
{ title: "居住地址", width: 150, dataIndex: "address", key: "address", filterType: "dropdown", filterDropdown: "hide" }, { title: "居住地址", width: 150, dataIndex: "address", key: "address", filterType: "dropdown", filterDropdown: "hide" },
]; ];

File diff suppressed because one or more lines are too long

52
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

@ -77,7 +77,7 @@ import 'bee-table/build/Table.css';
| format | 设置日期类的格式 | string | YYYY-MM-DD | | format | 设置日期类的格式 | string | YYYY-MM-DD |
| filterDropdownAuto | 设置下拉条件是否自动设置选项,`auto`自动根据当前数据生成,`manual`手动传入,可以使用`filterDropdownData`来传入自定义数据 | string | auto | | filterDropdownAuto | 设置下拉条件是否自动设置选项,`auto`自动根据当前数据生成,`manual`手动传入,可以使用`filterDropdownData`来传入自定义数据 | string | auto |
| filterDropdownData | 下拉条件自定义数据filterDropdownAuto=manual生效传入格式[{ key : "自定义", value : "自定义" }] | array | [] | | filterDropdownData | 下拉条件自定义数据filterDropdownAuto=manual生效传入格式[{ key : "自定义", value : "自定义" }] | array | [] |
| filterDropdownFocus | 触发点击下拉条件的回调,一般用于异步点击请求数据使用 | function | () => () |
{% include "mixin.md"%} {% include "mixin.md"%}

View File

@ -1,6 +1,6 @@
{ {
"name": "bee-table", "name": "bee-table",
"version": "1.4.16", "version": "1.4.17",
"description": "Table ui component for react", "description": "Table ui component for react",
"keywords": [ "keywords": [
"react", "react",

View File

@ -354,7 +354,8 @@ class Table extends Component {
format: column.format, format: column.format,
filterdropdown: column.filterDropdown, filterdropdown: column.filterDropdown,
filterdropdownauto: column.filterDropdownAuto,//是否自定义数据 filterdropdownauto: column.filterDropdownAuto,//是否自定义数据
filterdropdowndata: column.filterDropdownData//自定义数据格式 filterdropdowndata: column.filterDropdownData,//自定义数据格式
filterdropdownfocus: column.filterDropdownFocus//焦点触发函数回调
}); });
} }
}); });

View File

@ -265,6 +265,7 @@ class TableHeader extends Component {
onChange={this.handlerFilterTextChange.bind(this, dataIndex)} onChange={this.handlerFilterTextChange.bind(this, dataIndex)}
onSelectDropdown={this.handlerFilterDropChange.bind(this, dataIndex)} onSelectDropdown={this.handlerFilterDropChange.bind(this, dataIndex)}
filterDropdown={rows[1][index]['filterdropdown']} filterDropdown={rows[1][index]['filterdropdown']}
onFocus={rows[1][index]['filterdropdownfocus']}
/> />
//日期 //日期
case 'date': case 'date':
@ -312,6 +313,7 @@ class TableHeader extends Component {
} }
if (filterable && index == rows.length - 1) { if (filterable && index == rows.length - 1) {
da.children = this.filterRenderType(da['filtertype'], da.dataindex, i); da.children = this.filterRenderType(da['filtertype'], da.dataindex, i);
delete da.filterdropdownfocus;
} }
if (draggable) { if (draggable) {
return (<th {...da} return (<th {...da}