From 842b8cc08a0369c7eb572d17001f6104080c205e Mon Sep 17 00:00:00 2001 From: sqzhou Date: Sat, 17 Sep 2022 21:45:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20transfer=20=E7=BB=93=E6=9E=9C=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E9=BB=98=E8=AE=A4=E6=8F=90=E7=A4=BA=E8=AF=AD=E5=8F=A5?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/amis-ui/src/components/ResultList.tsx | 10 ++++++---- packages/amis-ui/src/components/ResultTableList.tsx | 7 ++++--- packages/amis-ui/src/components/ResultTreeList.tsx | 12 +++++++----- packages/amis-ui/src/components/Transfer.tsx | 9 +++++---- packages/amis-ui/src/components/TransferSearch.tsx | 4 ---- 5 files changed, 22 insertions(+), 20 deletions(-) diff --git a/packages/amis-ui/src/components/ResultList.tsx b/packages/amis-ui/src/components/ResultList.tsx index 2ce5f10b5..04f4a6175 100644 --- a/packages/amis-ui/src/components/ResultList.tsx +++ b/packages/amis-ui/src/components/ResultList.tsx @@ -21,6 +21,7 @@ export interface ResultListProps extends ThemeProps, LocaleProps { sortable?: boolean; disabled?: boolean; title?: string; + searchPlaceholder?: string; placeholder: string; itemRender: (option: Option, states: ItemRenderStates) => JSX.Element; itemClassName?: string; @@ -225,7 +226,8 @@ export class ResultList extends React.Component< itemClassName, sortable, labelField, - translate: __ + translate: __, + placeholder } = this.props; return ( @@ -272,7 +274,7 @@ export class ResultList extends React.Component< ))} ) : ( -
{__('Transfer.selectFromLeft')}
+
{__(placeholder)}
)} ); @@ -286,7 +288,7 @@ export class ResultList extends React.Component< searchable, value, translate: __, - placeholder = __('Transfer.searchKeyword') + searchPlaceholder } = this.props; const {searchResult} = this.state; @@ -296,7 +298,7 @@ export class ResultList extends React.Component< {title ?
{title}
: null} {searchable ? ( diff --git a/packages/amis-ui/src/components/ResultTableList.tsx b/packages/amis-ui/src/components/ResultTableList.tsx index 1f6eece11..e8cc2098a 100644 --- a/packages/amis-ui/src/components/ResultTableList.tsx +++ b/packages/amis-ui/src/components/ResultTableList.tsx @@ -17,6 +17,7 @@ import TableSelection from './TableSelection'; export interface ResultTableSelectionProps extends BaseSelectionProps { title?: string; + searchPlaceholder?: string; placeholder?: string; searchable?: boolean; onSearch?: Function; @@ -195,7 +196,7 @@ export class BaseResultTableSelection extends BaseSelection< }} /> ) : ( -
{__('Transfer.selectFromLeft')}
+
{__(placeholder)}
)} ); @@ -208,7 +209,7 @@ export class BaseResultTableSelection extends BaseSelection< title, searchable, translate: __, - placeholder = __('Transfer.searchKeyword') + searchPlaceholder } = this.props; return ( @@ -216,7 +217,7 @@ export class BaseResultTableSelection extends BaseSelection< {title ?
{title}
: null} {searchable ? ( diff --git a/packages/amis-ui/src/components/ResultTreeList.tsx b/packages/amis-ui/src/components/ResultTreeList.tsx index e58237369..65d6a5ac5 100644 --- a/packages/amis-ui/src/components/ResultTreeList.tsx +++ b/packages/amis-ui/src/components/ResultTreeList.tsx @@ -2,7 +2,7 @@ * 结果树(暂时不支持结果排序) */ import React from 'react'; -import {cloneDeep, isEqual, omit} from 'lodash'; +import _, {cloneDeep, isEqual, omit} from 'lodash'; import {Option, Options} from './Select'; import {ThemeProps, themeable} from 'amis-core'; @@ -24,6 +24,7 @@ export interface ResultTreeListProps onSearch?: Function; onChange: (value: Array