|
|
@@ -222,20 +222,38 @@ class FilterBox extends React.Component {
|
|
|
field = <InputNumber onBlur={(e) => {this.changeFilterValue(filter, e.target.value, index)}}/>
|
|
|
}else if(type === 'time') {
|
|
|
field = <DatePicker onChange={(value) => {this.changeFilterValue(filter, value, index)}}/>
|
|
|
- }else if(type === 'categorical') {
|
|
|
- field = (<Select
|
|
|
- mode={(operator==='contain' || operator === 'notContain' ) ? 'multiple' : 'single'}
|
|
|
- showSearch
|
|
|
- dropdownMatchSelectWidth={false}
|
|
|
- notFoundContent={fetching ? <Spin size="small" /> : '无'}
|
|
|
- onSearch={(value) => {this.fetchColumnData(column, value, true)}}
|
|
|
- onFocus={() => {this.fetchColumnData(column)}}
|
|
|
- onChange={(value) => {this.changeFilterValue(filter, value, index)}}
|
|
|
- >
|
|
|
- { columnData.map((s, i) => {
|
|
|
- return <SelectOption key={i} value={s}>{s}</SelectOption>
|
|
|
- }) }
|
|
|
- </Select>)
|
|
|
+ }else if(type === 'categorical') { // 类别
|
|
|
+ if(operator === 'include' || operator==='notInclude') { // 包含/不包含
|
|
|
+ field = <Input onBlur={(e) => {this.changeFilterValue(filter, e.target.value, index)}}/>
|
|
|
+ }else if(operator === 'contain' || operator === 'notContain') { // 包括/不包括
|
|
|
+ field = (<Select
|
|
|
+ mode='multiple'
|
|
|
+ showSearch
|
|
|
+ dropdownMatchSelectWidth={false}
|
|
|
+ notFoundContent={fetching ? <Spin size="small" /> : '无'}
|
|
|
+ onSearch={(value) => {this.fetchColumnData(column, value, true)}}
|
|
|
+ onFocus={() => {this.fetchColumnData(column)}}
|
|
|
+ onChange={(value) => {this.changeFilterValue(filter, value, index)}}
|
|
|
+ >
|
|
|
+ { columnData.map((s, i) => {
|
|
|
+ return <SelectOption key={i} value={s}>{s}</SelectOption>
|
|
|
+ }) }
|
|
|
+ </Select>)
|
|
|
+ }else { // 等于/不等于
|
|
|
+ field = (<Select
|
|
|
+ mode='single'
|
|
|
+ showSearch
|
|
|
+ dropdownMatchSelectWidth={false}
|
|
|
+ notFoundContent={fetching ? <Spin size="small" /> : '无'}
|
|
|
+ onSearch={(value) => {this.fetchColumnData(column, value, true)}}
|
|
|
+ onFocus={() => {this.fetchColumnData(column)}}
|
|
|
+ onChange={(value) => {this.changeFilterValue(filter, value, index)}}
|
|
|
+ >
|
|
|
+ { columnData.map((s, i) => {
|
|
|
+ return <SelectOption key={i} value={s}>{s}</SelectOption>
|
|
|
+ }) }
|
|
|
+ </Select>)
|
|
|
+ }
|
|
|
}else {
|
|
|
field = <Input onBlur={(e) => {this.changeFilterValue(filter, e.target.value, index)}}/>
|
|
|
}
|