Skip to content

Commit

Permalink
fix(filter-picker): 修复过滤选择器,当默认为不为空或为空,切换到不包含或包含,有空格选项存在.以及文案不全包含->不包含 (
Browse files Browse the repository at this point in the history
#1766)

* fix(filter-picker): 修复过滤选择器,当默认为不为空或为空,切换到不包含或包含,有空格选项存在.以及文案不全包含->不包含

* fix(filter-picker): 修改列表型->不包含op值 not hasAll-> not hasAny

Co-authored-by: Danny <danny@DannydeMacBook-Pro.local>
  • Loading branch information
Danny548326 and Danny committed Jan 4, 2022
1 parent 869cf3b commit b36b266
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/legacy/filter-picker/FilterPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const defaultOperationsOption: operationsOptionType = {
int: ['=', '!=', '>', '>=', '<', '<=', 'between', 'not between', 'hasValue', 'noValue'],
double: ['=', '!=', '>', '>=', '<', '<=', 'between', 'not between', 'hasValue', 'noValue'],
date: ['=', '!=', '>', '<', 'relativeBetween', 'relativeCurrent', 'between', 'not between', 'hasValue', 'noValue'],
list: ['hasAll', 'not hasAll', 'empty', 'not empty'],
list: ['hasAll', 'not hasAny', 'empty', 'not empty'],
};

export type TextObject = typeof defaultLocaleTextObject & { code: 'zh-CN' | 'en-US' };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function FilterAttrOverlay(props: FilterAttrOverlayProps) {
attrSelect={selectValue}
attrChange={setAttrValue}
curryDimensionValueRequest={curryDimensionValueRequest}
values={attrValue}
values={attrValue.filter(item => item !== ' ')}
exprKey={exprKey}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function ListAttrSelect(props: ListAttrSelectProps) {

switch (attrSelect) {
case 'hasAll':
case 'not hasAll':
case 'not hasAny':
return (
<div style={{ height: '330px' }}>
<Input placeholder={textObject.pleaseEnter} value={inputValue} onChange={changInputValue} style={{width: '100%'}}/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export const useSelectOptions = () => {
label: t.allLike,
},
{
value: 'not hasAll',
value: 'not hasAny',
label: t.notAllLike,
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ const parseListValuesToText = (operation: string, value: string[], t: TextObject
/**
* list: {
* 'hasAll': '全包含',
* 'not hasAll': '不全包含',
* 'not hasAny': '不包含',
* 'empty': '为空',
* 'not empty: '不为空',
* }
Expand All @@ -223,7 +223,7 @@ const parseListValuesToText = (operation: string, value: string[], t: TextObject
case 'hasAll':
// 全包含
return `${t.allLike} ${listFormat(value, t.code)}`;
case 'not hasAll': {
case 'not hasAny': {
return `${t.notAllLike} ${listFormat(value, t.code)}`;
}
case 'empty':
Expand Down
4 changes: 2 additions & 2 deletions src/legacy/filter-picker/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export type FilterValue = {
export type StringValue = '=' | '!=' | '<' | '>';
export type NumberValue = '=' | '!=' | '>' | '>=' | '<' | '<=' | 'between' | 'hasValue';
export type DateValue = '=' | '!=' | '>' | '>=' | '<' | '<=' | 'between' | 'relativeTime';
export type ListValue = 'hasAll' | 'not hasAll' | 'empty' | 'not empty';
export type ListValue = 'hasAll' | 'not hasAny' | 'empty' | 'not empty';

export type opStringType = '=' | '!=' | 'in' | 'not in' | 'like' | 'not like' | 'hasValue' | 'noValue';
export type opNumberType = '=' | '!=' | '>' | '>=' | '<' | '<=' | 'between' | 'not between' | 'hasValue' | 'noValue';
Expand All @@ -52,7 +52,7 @@ export type opDateType =
| 'hasValue'
| 'noValue';

export type opListType = 'hasAll' | 'not hasAll' | 'empty' | 'not empty';
export type opListType = 'hasAll' | 'not hasAny' | 'empty' | 'not empty';

export interface titleGroup {
string: string;
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/filter-picker/locales/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default {
notIn: (text: Key) => `不在 ${text} 范围内`,
like: '包含',
allLike: '全包含',
notAllLike: '不全包含',
notAllLike: '不包含',
notLike: '不包含',
hasValue: '有值',
noValue: '无值',
Expand Down

1 comment on commit b36b266

@vercel
Copy link

@vercel vercel bot commented on b36b266 Jan 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.