update:过滤条件修改

This commit is contained in:
kvkens 2018-12-11 16:54:25 +08:00
parent be87445379
commit 6768243afc
11 changed files with 18556 additions and 2888 deletions

View File

@ -97,90 +97,145 @@ var FilterDropDown = function (_Component) {
var _this$state = _this.state, var _this$state = _this.state,
selectValue = _this$state.selectValue, selectValue = _this$state.selectValue,
selectNumberValue = _this$state.selectNumberValue; selectNumberValue = _this$state.selectNumberValue;
var filterDropdownType = _this.props.filterDropdownType; var _this$props2 = _this.props,
filterDropdownType = _this$props2.filterDropdownType,
filterDropdownIncludeKeys = _this$props2.filterDropdownIncludeKeys;
var locale = (0, _tool.getComponentLocale)(_this.props, _this.context, 'Table', function () { var locale = (0, _tool.getComponentLocale)(_this.props, _this.context, 'Table', function () {
return _i18n2["default"]; return _i18n2["default"];
}); });
switch (filterDropdownType) { var stringEnum = {
case 'string': LIKE: 'include',
return _react2["default"].createElement( ULIKE: 'exclusive',
_beeMenus2["default"], EQ: 'equal',
{ UEQ: 'unequal',
onSelect: _this.onSelectDropdown, START: 'begin',
selectedKeys: selectValue END: 'end'
}, };
_react2["default"].createElement( var numberEnum = {
Item, GT: 'greater_than',
{ key: 'LIKE' }, GTEQ: 'great_than_equal_to',
locale['include'] LT: 'less_than',
), LTEQ: 'less_than_equal_to',
_react2["default"].createElement( EQ: 'be_equal_to',
Item, UEQ: 'not_equal_to'
{ key: 'ULIKE' }, };
locale['exclusive'] if (filterDropdownIncludeKeys != undefined) {
), switch (filterDropdownType) {
_react2["default"].createElement( case 'string':
Item, return _react2["default"].createElement(
{ key: 'EQ' }, _beeMenus2["default"],
locale['equal'] {
), onSelect: _this.onSelectDropdown,
_react2["default"].createElement( selectedKeys: selectValue
Item, },
{ key: 'UEQ' }, filterDropdownIncludeKeys.map(function (item) {
locale['unequal'] return _react2["default"].createElement(
), Item,
_react2["default"].createElement( { key: item },
Item, locale[stringEnum[item]]
{ key: 'START' }, );
locale['begin'] })
), );
_react2["default"].createElement( case 'number':
Item, return _react2["default"].createElement(
{ key: 'END' }, _beeMenus2["default"],
locale['end'] {
) onSelect: _this.onSelectDropdown,
); selectedKeys: selectNumberValue
case 'number': },
return _react2["default"].createElement( filterDropdownIncludeKeys.map(function (item) {
_beeMenus2["default"], return _react2["default"].createElement(
{ Item,
onSelect: _this.onSelectDropdown, { key: item },
selectedKeys: selectNumberValue locale[numberEnum[item]]
}, );
_react2["default"].createElement( })
Item, );
{ key: 'GT' }, default:
locale['greater_than'] return _react2["default"].createElement('div', null);
), }
_react2["default"].createElement( } else {
Item, switch (filterDropdownType) {
{ key: 'GTEQ' }, case 'string':
locale['great_than_equal_to'] return _react2["default"].createElement(
), _beeMenus2["default"],
_react2["default"].createElement( {
Item, onSelect: _this.onSelectDropdown,
{ key: 'LT' }, selectedKeys: selectValue
locale['less_than'] },
), _react2["default"].createElement(
_react2["default"].createElement( Item,
Item, { key: 'LIKE' },
{ key: 'LTEQ' }, locale['include']
locale['less_than_equal_to'] ),
), _react2["default"].createElement(
_react2["default"].createElement( Item,
Item, { key: 'ULIKE' },
{ key: 'EQ' }, locale['exclusive']
locale['be_equal_to'] ),
), _react2["default"].createElement(
_react2["default"].createElement( Item,
Item, { key: 'EQ' },
{ key: 'UEQ' }, locale['equal']
locale['not_equal_to'] ),
) _react2["default"].createElement(
); Item,
default: { key: 'UEQ' },
return _react2["default"].createElement('div', null); locale['unequal']
),
_react2["default"].createElement(
Item,
{ key: 'RLIKE' },
locale['begin']
),
_react2["default"].createElement(
Item,
{ key: 'LLIKE' },
locale['end']
)
);
case 'number':
return _react2["default"].createElement(
_beeMenus2["default"],
{
onSelect: _this.onSelectDropdown,
selectedKeys: selectNumberValue
},
_react2["default"].createElement(
Item,
{ key: 'GT' },
locale['greater_than']
),
_react2["default"].createElement(
Item,
{ key: 'GTEQ' },
locale['great_than_equal_to']
),
_react2["default"].createElement(
Item,
{ key: 'LT' },
locale['less_than']
),
_react2["default"].createElement(
Item,
{ key: 'LTEQ' },
locale['less_than_equal_to']
),
_react2["default"].createElement(
Item,
{ key: 'EQ' },
locale['be_equal_to']
),
_react2["default"].createElement(
Item,
{ key: 'UEQ' },
locale['not_equal_to']
)
);
default:
return _react2["default"].createElement('div', null);
}
} }
}; };

View File

@ -183,6 +183,7 @@ var FilterType = function (_Component) {
_this.renderControl = function (rendertype) { _this.renderControl = function (rendertype) {
var _this$props7 = _this.props, var _this$props7 = _this.props,
filterDropdownIncludeKeys = _this$props7.filterDropdownIncludeKeys,
dataIndex = _this$props7.dataIndex, dataIndex = _this$props7.dataIndex,
filterDropdown = _this$props7.filterDropdown, filterDropdown = _this$props7.filterDropdown,
filterDropdownType = _this$props7.filterDropdownType, filterDropdownType = _this$props7.filterDropdownType,
@ -213,7 +214,8 @@ var FilterType = function (_Component) {
onClickClear: _this.clearFilter, onClickClear: _this.clearFilter,
isShowClear: _this.state.value, isShowClear: _this.state.value,
isShowCondition: filterDropdown, isShowCondition: filterDropdown,
filterDropdownType: filterDropdownType filterDropdownType: filterDropdownType,
filterDropdownIncludeKeys: filterDropdownIncludeKeys
}) })
); );
case 'number': case 'number':
@ -234,7 +236,8 @@ var FilterType = function (_Component) {
onClickClear: _this.clearFilter, onClickClear: _this.clearFilter,
isShowClear: _this.state.value != 0, isShowClear: _this.state.value != 0,
isShowCondition: filterDropdown, isShowCondition: filterDropdown,
filterDropdownType: filterDropdownType filterDropdownType: filterDropdownType,
filterDropdownIncludeKeys: filterDropdownIncludeKeys
}) })
); );
case 'dropdown': case 'dropdown':
@ -253,7 +256,8 @@ var FilterType = function (_Component) {
onClickClear: _this.clearFilter, onClickClear: _this.clearFilter,
isShowCondition: filterDropdown, isShowCondition: filterDropdown,
isShowClear: _this.state.value, isShowClear: _this.state.value,
filterDropdownType: filterDropdownType filterDropdownType: filterDropdownType,
filterDropdownIncludeKeys: filterDropdownIncludeKeys
}) })
); );
case 'date': case 'date':
@ -275,7 +279,8 @@ var FilterType = function (_Component) {
onClickClear: _this.clearFilter, onClickClear: _this.clearFilter,
isShowCondition: filterDropdown, isShowCondition: filterDropdown,
isShowClear: _this.state.value, isShowClear: _this.state.value,
filterDropdownType: filterDropdownType filterDropdownType: filterDropdownType,
filterDropdownIncludeKeys: filterDropdownIncludeKeys
}) })
); );
case 'daterange': case 'daterange':
@ -300,7 +305,8 @@ var FilterType = function (_Component) {
onSelectDropdown: _this.onSelectDropdown, onSelectDropdown: _this.onSelectDropdown,
onClickClear: _this.clearFilter, onClickClear: _this.clearFilter,
isShowCondition: filterDropdown, isShowCondition: filterDropdown,
isShowClear: _this.state.value isShowClear: _this.state.value,
filterDropdownIncludeKeys: filterDropdownIncludeKeys
}) })
); );
case 'bool': case 'bool':
@ -312,7 +318,8 @@ var FilterType = function (_Component) {
onChange: onChange onChange: onChange
}), }),
_react2["default"].createElement(_FilterDropDown2["default"], { locale: locale, _react2["default"].createElement(_FilterDropDown2["default"], { locale: locale,
onSelectDropdown: onSelectDropdown onSelectDropdown: onSelectDropdown,
filterDropdownIncludeKeys: filterDropdownIncludeKeys
}) })
); );
default: default:

View File

@ -608,11 +608,13 @@
top: 0px; top: 0px;
left: 3px; } left: 3px; }
.u-filter-dropdown-menu-wrap .u-dropdown-menu li.u-dropdown-menu-item { .u-filter-dropdown-menu-wrap {
line-height: 32px; z-index: 1800; }
height: 32px; .u-filter-dropdown-menu-wrap .u-dropdown-menu li.u-dropdown-menu-item {
padding: 0px 16px 0 16px; line-height: 32px;
cursor: pointer; } height: 32px;
padding: 0px 16px 0 16px;
cursor: pointer; }
.u-checkbox { .u-checkbox {
height: 16px; height: 16px;

View File

@ -501,7 +501,8 @@ var Table = function (_Component) {
filterdropdownauto: column.filterDropdownAuto, //是否自定义数据 filterdropdownauto: column.filterDropdownAuto, //是否自定义数据
filterdropdowndata: column.filterDropdownData, //自定义数据格式 filterdropdowndata: column.filterDropdownData, //自定义数据格式
filterdropdownfocus: column.filterDropdownFocus, //焦点触发函数回调 filterdropdownfocus: column.filterDropdownFocus, //焦点触发函数回调
filterdropdowntype: column.filterDropdownType //下拉的类型分为 String,Number 默认是String filterdropdowntype: column.filterDropdownType, //下拉的类型分为 String,Number 默认是String
filterdropdownincludekeys: column.filterDropdownIncludeKeys //下拉条件按照指定的keys去显示
}); });
} }
}); });

View File

@ -229,6 +229,7 @@ var TableHeader = function (_Component) {
, onFilterClear: _this.handlerFilterClear //清除回调 , onFilterClear: _this.handlerFilterClear //清除回调
, filterDropdown: rows[1][index]["filterdropdown"] //是否显示下拉条件 , filterDropdown: rows[1][index]["filterdropdown"] //是否显示下拉条件
, filterDropdownType: rows[1][index]["filterdropdowntype"] //下拉的条件类型为string,number , filterDropdownType: rows[1][index]["filterdropdowntype"] //下拉的条件类型为string,number
, filterDropdownIncludeKeys: rows[1][index]["filterdropdownincludekeys"] //下拉条件按照指定的keys去显示
}); });
//数值输入 //数值输入
case "number": case "number":
@ -242,6 +243,7 @@ var TableHeader = function (_Component) {
, onFilterClear: _this.handlerFilterClear //清除回调 , onFilterClear: _this.handlerFilterClear //清除回调
, filterDropdown: rows[1][index]["filterdropdown"], , filterDropdown: rows[1][index]["filterdropdown"],
filterDropdownType: rows[1][index]["filterdropdowntype"] //下拉的条件类型为string,number filterDropdownType: rows[1][index]["filterdropdowntype"] //下拉的条件类型为string,number
, filterDropdownIncludeKeys: rows[1][index]["filterdropdownincludekeys"] //下拉条件按照指定的keys去显示
}); });
//下拉框选择 //下拉框选择
case "dropdown": case "dropdown":
@ -275,6 +277,7 @@ var TableHeader = function (_Component) {
, filterDropdown: rows[1][index]["filterdropdown"], , filterDropdown: rows[1][index]["filterdropdown"],
onFocus: rows[1][index]["filterdropdownfocus"], onFocus: rows[1][index]["filterdropdownfocus"],
filterDropdownType: rows[1][index]["filterdropdowntype"] //下拉的条件类型为string,number filterDropdownType: rows[1][index]["filterdropdowntype"] //下拉的条件类型为string,number
, filterDropdownIncludeKeys: rows[1][index]["filterdropdownincludekeys"] //下拉条件按照指定的keys去显示
}); });
//日期 //日期
case "date": case "date":
@ -289,6 +292,7 @@ var TableHeader = function (_Component) {
, onFilterClear: _this.handlerFilterClear //清除回调 , onFilterClear: _this.handlerFilterClear //清除回调
, filterDropdown: rows[1][index]["filterdropdown"], , filterDropdown: rows[1][index]["filterdropdown"],
filterDropdownType: rows[1][index]["filterdropdowntype"] //下拉的条件类型为string,number filterDropdownType: rows[1][index]["filterdropdowntype"] //下拉的条件类型为string,number
, filterDropdownIncludeKeys: rows[1][index]["filterdropdownincludekeys"] //下拉条件按照指定的keys去显示
}); });
//日期范围 //日期范围
case "daterange": case "daterange":
@ -303,6 +307,7 @@ var TableHeader = function (_Component) {
, onFilterClear: _this.handlerFilterClear //清除回调 , onFilterClear: _this.handlerFilterClear //清除回调
, filterDropdown: rows[1][index]["filterdropdown"], , filterDropdown: rows[1][index]["filterdropdown"],
filterDropdownType: rows[1][index]["filterdropdowntype"] //下拉的条件类型为string,number filterDropdownType: rows[1][index]["filterdropdowntype"] //下拉的条件类型为string,number
, filterDropdownIncludeKeys: rows[1][index]["filterdropdownincludekeys"] //下拉条件按照指定的keys去显示
}); });
default: default:
//不匹配类型默认文本输入 //不匹配类型默认文本输入

File diff suppressed because one or more lines are too long

42
dist/demo.css vendored
View File

@ -6680,10 +6680,6 @@ input.u-button[type="submit"] {
clear: both; clear: both;
display: table; display: table;
content: ''; } content: ''; }
.u-pagination-list > li.iconBtn > a {
padding: 0 11px;
font-size: 22px;
line-height: 1.57142857; }
.u-pagination-list > li > a, .u-pagination-list > li > span { .u-pagination-list > li > a, .u-pagination-list > li > span {
display: inline-block; display: inline-block;
text-decoration: none; text-decoration: none;
@ -6771,15 +6767,9 @@ input.u-button[type="submit"] {
margin: 5px; margin: 5px;
float: left; float: left;
min-width: 120px; } min-width: 120px; }
.u-pagination .data_per_select > span {
display: inline-block;
line-height: 36px;
float: left; }
.u-pagination .data_per_select .u-select { .u-pagination .data_per_select .u-select {
width: 50px; width: 50px;
margin: 0 6px; margin: 0 6px; }
height: 36px;
float: left; }
.u-pagination .data_per_select .u-select .u-select-selection { .u-pagination .data_per_select .u-select .u-select-selection {
height: 36px; } height: 36px; }
.u-pagination .data_per_select .u-select .u-select-selection .u-select-selection-rendered { .u-pagination .data_per_select .u-select .u-select-selection .u-select-selection-rendered {
@ -6799,26 +6789,20 @@ input.u-button[type="submit"] {
.u-pagination .page_jump { .u-pagination .page_jump {
float: left; float: left;
margin: 5px; } margin: 5px; }
.u-pagination .page_jump > span {
display: inline-block;
line-height: 36px;
float: left; }
.u-pagination .page_jump_value { .u-pagination .page_jump_value {
outline: none; outline: none;
-webkit-appearance: none; -webkit-appearance: none;
background: #fff; background: #fff;
border-radius: 4px; border-radius: 4px;
line-height: 32px;
width: 50px; width: 50px;
margin: 0 6px;
text-align: center; text-align: center;
border: 1px solid #d7d7d7; } border: 1px solid #d7d7d7; }
.u-pagination .page_jump_btn, .u-pagination .page_jump_btn {
.u-pagination .page_jump_value { margin-top: -3px;
margin: 0 6px; margin-left: 10px;
padding: 0; border-color: #d7d7d7; }
height: 36px;
line-height: 34px;
box-sizing: border-box;
float: left; }
.u-pagination-total { .u-pagination-total {
float: left; float: left;
height: 36px; height: 36px;
@ -10367,4 +10351,16 @@ li.rc-time-picker-panel-select-option-disabled:hover {
.demo25 .u-table-filter-column-filter-icon { .demo25 .u-table-filter-column-filter-icon {
right: 15px; } right: 15px; }
th .drop-menu .uf {
font-size: 12px;
visibility: hidden;
margin-left: 15px; }
th:hover .uf {
visibility: visible; }
.demo3 .u-table-thead th {
padding-top: 0px;
padding-bottom: 0px; }
/*# sourceMappingURL=demo.css.map */ /*# sourceMappingURL=demo.css.map */

2
dist/demo.css.map vendored

File diff suppressed because one or more lines are too long

21138
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

@ -125,8 +125,8 @@ class FilterDropDown extends Component {
<Item key="ULIKE">{locale['exclusive']}</Item> <Item key="ULIKE">{locale['exclusive']}</Item>
<Item key="EQ">{locale['equal']}</Item> <Item key="EQ">{locale['equal']}</Item>
<Item key="UEQ">{locale['unequal']}</Item> <Item key="UEQ">{locale['unequal']}</Item>
<Item key="START">{locale['begin']}</Item> <Item key="RLIKE">{locale['begin']}</Item>
<Item key="END">{locale['end']}</Item> <Item key="LLIKE">{locale['end']}</Item>
</Menu> </Menu>
case 'number': case 'number':
return <Menu return <Menu