diff --git a/CHANGELOG.md b/CHANGELOG.md index 81d2104..5020d0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ + +## [1.6.8](https://github.com/tinper-bee/bee-table/compare/v1.6.7...v1.6.8) (2018-12-05) + + + + +## [1.6.7](https://github.com/tinper-bee/bee-table/compare/v1.6.6...v1.6.7) (2018-12-04) + + + ## [1.6.6](https://github.com/tinper-bee/bee-table/compare/v1.6.5...v1.6.6) (2018-12-04) diff --git a/build/FilterDropDown.js b/build/FilterDropDown.js index 3db6ad0..cfa87a0 100644 --- a/build/FilterDropDown.js +++ b/build/FilterDropDown.js @@ -59,15 +59,25 @@ var FilterDropDown = function (_Component) { _this.onSelectDropdown = function (item) { var _this$props = _this.props, onSelectDropdown = _this$props.onSelectDropdown, - dataText = _this$props.dataText; + dataText = _this$props.dataText, + filterDropdownType = _this$props.filterDropdownType; if (onSelectDropdown) { if (dataText != "") { - _this.setState({ - selectValue: [item.key] - }, function () { - onSelectDropdown(item); - }); + if (filterDropdownType == 'string') { + _this.setState({ + selectValue: [item.key] + }, function () { + onSelectDropdown(item); + }); + } + if (filterDropdownType == 'number') { + _this.setState({ + selectNumberValue: [item.key] + }, function () { + onSelectDropdown(item); + }); + } } } }; @@ -77,7 +87,8 @@ var FilterDropDown = function (_Component) { if (onClickClear) { _this.setState({ - selectValue: [] + selectValue: [], + selectNumberValue: [] }, function () { onClickClear(); }); @@ -85,7 +96,9 @@ var FilterDropDown = function (_Component) { }; _this.getMenu = function () { - var selectValue = _this.state.selectValue; + var _this$state = _this.state, + selectValue = _this$state.selectValue, + selectNumberValue = _this$state.selectNumberValue; var filterDropdownType = _this.props.filterDropdownType; var locale = (0, _tool.getComponentLocale)(_this.props, _this.context, 'Table', function () { @@ -135,7 +148,7 @@ var FilterDropDown = function (_Component) { _beeMenus2["default"], { onSelect: _this.onSelectDropdown, - selectedKeys: selectValue + selectedKeys: selectNumberValue }, _react2["default"].createElement( Item, @@ -174,7 +187,8 @@ var FilterDropDown = function (_Component) { }; _this.state = { - selectValue: [] //选择的条件的值 + selectValue: ['LIKE'], + selectNumberValue: ['EQ'] }; return _this; } diff --git a/build/FilterType.js b/build/FilterType.js index 1a2d184..49e7ec3 100644 --- a/build/FilterType.js +++ b/build/FilterType.js @@ -392,7 +392,11 @@ var FilterType = function (_Component) { FilterType.prototype.render = function render() { var rendertype = this.props.rendertype; - return this.renderControl(rendertype); + return _react2["default"].createElement( + 'div', + { 'data-filter-type': 'filterContext' }, + this.renderControl(rendertype) + ); }; return FilterType; diff --git a/build/TableHeader.js b/build/TableHeader.js index 8e1c81f..c691323 100644 --- a/build/TableHeader.js +++ b/build/TableHeader.js @@ -136,9 +136,11 @@ var TableHeader = function (_Component) { }; _this.dragAbleMouseDown = function (e) { - _utils.Event.stopPropagation(e); + // Event.stopPropagation(e); var event = _utils.Event.getEvent(e); if (!_this.props.draggable) return; + var th = _this.getThDome(event.target); + if (!th) return; event.target.setAttribute('draggable', true); //添加交换列效果 _this.drag.option = 'dragAble'; _this.currentDome = event.target; @@ -163,7 +165,7 @@ var TableHeader = function (_Component) { if (_this.drag.option === 'border') { return; } - console.log(_this.drag.option + ' -------onDragStart----------', event.target); + // console.log(this.drag.option+' -------onDragStart----------',event.target); var th = _this.getThDome(event.target); if (!th) return; var currentIndex = parseInt(th.getAttribute("data-line-index")); @@ -187,7 +189,7 @@ var TableHeader = function (_Component) { _this.currentDome.setAttribute('draggable', false); //添加交换列效果 var data = _this.getCurrentEventData(e); if (!data) return; - console.log(_this.drag.option + ' -------onDrop----------', event.target); + // console.log(this.drag.option+' -------onDrop----------',event.target); if (!_this.currentObj || _this.currentObj.key == data.key) return; if (!_this.props.onDrop) return; _this.props.onDrop(event, { dragSource: _this.currentObj, dragTarg: data }); @@ -520,6 +522,7 @@ var TableHeader = function (_Component) { TableHeader.prototype.getThDome = function getThDome(element) { var _tagName = element.tagName.toLowerCase(); + if (element.getAttribute('data-filter-type') === 'filterContext') return null; if (_tagName === 'i') return null; if (_tagName != 'th') { return this.getThDome(element.parentElement); diff --git a/package.json b/package.json index 4278c82..f3f8ca2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bee-table", - "version": "1.6.7", + "version": "1.6.8", "description": "Table ui component for react", "keywords": [ "react",