add:过滤行渲染字段数值型
This commit is contained in:
parent
64145e1d69
commit
25b4807f5a
|
@ -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";
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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
|
@ -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; }
|
||||||
|
|
||||||
|
|
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
|
@ -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",
|
||||||
|
|
|
@ -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}
|
||||||
|
|
|
@ -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 = [];
|
||||||
|
|
Loading…
Reference in New Issue