add:过滤行渲染字段数值型

This commit is contained in:
kvkens 2018-11-26 19:26:52 +08:00
parent 64145e1d69
commit 25b4807f5a
10 changed files with 1602 additions and 999 deletions

View File

@ -13,6 +13,7 @@
@import "../node_modules/bee-tooltip/src/Tooltip.scss"; @import "../node_modules/bee-tooltip/src/Tooltip.scss";
@import "../node_modules/bee-message/build/Message.css"; @import "../node_modules/bee-message/build/Message.css";
@import "../node_modules/bee-dropdown/build/Dropdown.css"; @import "../node_modules/bee-dropdown/build/Dropdown.css";
@import "../node_modules/bee-input-number/build/InputNumber.css";
@import "../src/Table.scss"; @import "../src/Table.scss";

View File

@ -160,10 +160,10 @@ class Demo27 extends Component {
}, },
{ {
title: "区间", title: "区间",
width: 150, width: 200,
dataIndex: "mark", dataIndex: "mark",
key: "mark", key: "mark",
filterType: "text",//输入框类型 filterType: "number",//输入框类型
filterDropdownType: "number"//数值类条件 filterDropdownType: "number"//数值类条件
}, },
{ {

File diff suppressed because one or more lines are too long

1
dist/demo.css vendored
View File

@ -5,6 +5,7 @@
/* Navlayout */ /* Navlayout */
@import url(../node_modules/bee-message/build/Message.css); @import url(../node_modules/bee-message/build/Message.css);
@import url(../node_modules/bee-dropdown/build/Dropdown.css); @import url(../node_modules/bee-dropdown/build/Dropdown.css);
@import url(../node_modules/bee-input-number/build/InputNumber.css);
.red { .red {
color: rgb(244,67,54) !important; } color: rgb(244,67,54) !important; }

2
dist/demo.css.map vendored

File diff suppressed because one or more lines are too long

2530
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

@ -52,6 +52,7 @@
"bee-dropdown": "^1.0.1", "bee-dropdown": "^1.0.1",
"bee-form-control": "latest", "bee-form-control": "latest",
"bee-icon": "^1.0.5", "bee-icon": "^1.0.5",
"bee-input-number": "^1.1.14",
"bee-loading": "^1.0.3", "bee-loading": "^1.0.3",
"bee-locale": "0.0.11", "bee-locale": "0.0.11",
"bee-menus": "^1.0.7", "bee-menus": "^1.0.7",

View File

@ -2,6 +2,7 @@ import React, { Component } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import FormControl from 'bee-form-control'; import FormControl from 'bee-form-control';
import Select from 'bee-select'; import Select from 'bee-select';
import InputNumber from 'bee-input-number';
import DatePicker from 'bee-datepicker'; import DatePicker from 'bee-datepicker';
import FilterDropDown from './FilterDropDown'; import FilterDropDown from './FilterDropDown';
@ -16,7 +17,8 @@ class FilterType extends Component {
text: "", text: "",
selectValue: "", selectValue: "",
dateValue: "", dateValue: "",
open: false open: false,
number: 0
} }
} }
//清除文本 //清除文本
@ -27,7 +29,22 @@ class FilterType extends Component {
let { onChange } = this.props; let { onChange } = this.props;
onChange && onChange(""); onChange && onChange("");
} }
//设置数值
changeNumber = (number) => {
let { onChange } = this.props;
onChange && onChange(number);
this.setState({
number
});
}
//清除数值
clearNumber = () => {
let { onChange } = this.props;
onChange && onChange("");
this.setState({
number: ""
});
}
//设置文本 //设置文本
changeText = (eve) => { changeText = (eve) => {
this.setState({ this.setState({
@ -112,6 +129,23 @@ class FilterType extends Component {
> >
</FilterDropDown> </FilterDropDown>
</div> </div>
case 'number':
return <div className={`${clsPrefix} filter-wrap`}>
<InputNumber
className={className}
value={this.state.number}
onChange={this.changeNumber}
/>
<FilterDropDown
locale={locale}
onSelectDropdown={onSelectDropdown}
onClickClear={this.clearNumber}
isShowClear={this.state.number}
isShowCondition={filterDropdown}
filterDropdownType={filterDropdownType}
>
</FilterDropDown>
</div>
case 'dropdown': case 'dropdown':
return <div className={`${clsPrefix} filter-wrap`}><Select return <div className={`${clsPrefix} filter-wrap`}><Select
{...this.props} {...this.props}

View File

@ -343,6 +343,26 @@ class TableHeader extends Component {
filterDropdownType={rows[1][index]["filterdropdowntype"]}//下拉的条件类型为string,number filterDropdownType={rows[1][index]["filterdropdowntype"]}//下拉的条件类型为string,number
/> />
); );
//数值输入
case "number":
return (
<FilterType
locale={locale}
rendertype={type}
clsPrefix={clsPrefix}
className={`${clsPrefix} filter-text`}
onChange={debounce(
filterDelay || 300,
this.handlerFilterTextChange.bind(this, dataIndex)
)}
onSelectDropdown={this.handlerFilterDropChange.bind(
this,
dataIndex
)}
filterDropdown={rows[1][index]["filterdropdown"]}
filterDropdownType={rows[1][index]["filterdropdowntype"]}//下拉的条件类型为string,number
/>
);
//下拉框选择 //下拉框选择
case "dropdown": case "dropdown":
let selectDataSource = []; let selectDataSource = [];