关联勾选左侧默认值
This commit is contained in:
parent
ae0a1504cc
commit
f7e6dbf2be
|
@ -21,6 +21,7 @@ import TreeRadios from './TreeRadios';
|
||||||
|
|
||||||
export interface AssociatedCheckboxesProps extends CheckboxesProps {
|
export interface AssociatedCheckboxesProps extends CheckboxesProps {
|
||||||
leftOptions: Options;
|
leftOptions: Options;
|
||||||
|
leftDefaultValue?: any;
|
||||||
leftMode?: 'tree' | 'list';
|
leftMode?: 'tree' | 'list';
|
||||||
rightMode?: 'table' | 'list' | 'tree' | 'chained';
|
rightMode?: 'table' | 'list' | 'tree' | 'chained';
|
||||||
columns?: Array<any>;
|
columns?: Array<any>;
|
||||||
|
@ -44,7 +45,9 @@ export class AssociatedCheckboxes extends Checkboxes<
|
||||||
AssociatedCheckboxesProps,
|
AssociatedCheckboxesProps,
|
||||||
AssociatedCheckboxesState
|
AssociatedCheckboxesState
|
||||||
> {
|
> {
|
||||||
state: AssociatedCheckboxesState = {};
|
state: AssociatedCheckboxesState = {
|
||||||
|
leftValue: this.props.leftDefaultValue
|
||||||
|
};
|
||||||
|
|
||||||
@autobind
|
@autobind
|
||||||
leftOption2Value(option: Option) {
|
leftOption2Value(option: Option) {
|
||||||
|
|
|
@ -178,6 +178,7 @@ export class TabsTransfer extends React.Component<TabsTransferProps> {
|
||||||
onDeferLoad={onDeferLoad}
|
onDeferLoad={onDeferLoad}
|
||||||
leftMode={option.leftMode}
|
leftMode={option.leftMode}
|
||||||
leftOptions={option.leftOptions}
|
leftOptions={option.leftOptions}
|
||||||
|
leftDefaultValue={option.leftDefaultValue}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<ListCheckboxes
|
<ListCheckboxes
|
||||||
|
|
|
@ -38,6 +38,7 @@ export interface TransferProps extends ThemeProps, CheckboxesProps {
|
||||||
) => JSX.Element;
|
) => JSX.Element;
|
||||||
leftOptions?: Array<Option>;
|
leftOptions?: Array<Option>;
|
||||||
leftMode?: 'tree' | 'list';
|
leftMode?: 'tree' | 'list';
|
||||||
|
leftDefaultValue?: any;
|
||||||
rightMode?: 'table' | 'list' | 'tree' | 'chained';
|
rightMode?: 'table' | 'list' | 'tree' | 'chained';
|
||||||
|
|
||||||
// search 相关
|
// search 相关
|
||||||
|
@ -320,7 +321,8 @@ export class Transfer extends React.Component<TransferProps, TransferState> {
|
||||||
leftOptions,
|
leftOptions,
|
||||||
leftMode,
|
leftMode,
|
||||||
rightMode,
|
rightMode,
|
||||||
cellRender
|
cellRender,
|
||||||
|
leftDefaultValue
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
return selectMode === 'table' ? (
|
return selectMode === 'table' ? (
|
||||||
|
@ -364,6 +366,7 @@ export class Transfer extends React.Component<TransferProps, TransferState> {
|
||||||
leftOptions={leftOptions || []}
|
leftOptions={leftOptions || []}
|
||||||
leftMode={leftMode}
|
leftMode={leftMode}
|
||||||
rightMode={rightMode}
|
rightMode={rightMode}
|
||||||
|
leftDefaultValue={leftDefaultValue}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<ListCheckboxes
|
<ListCheckboxes
|
||||||
|
|
Loading…
Reference in New Issue