Skip to content

Commit

Permalink
fix: 人员组件移动端支持禁用
Browse files Browse the repository at this point in the history
  • Loading branch information
allenve committed Dec 2, 2024
1 parent 560cdcc commit 421f86d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/amis-ui/src/components/UserSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export interface UserSelectProps
controlled?: boolean;
displayFields: Array<string>;
isTab?: boolean;
disabled?: boolean;
fetcher?: (
api: Api,
data?: any,
Expand Down Expand Up @@ -995,6 +996,7 @@ export class UserSelect extends React.Component<
showResultBox,
labelField = 'label',
valueField = 'value',
disabled,
mobileUI
} = this.props;

Expand All @@ -1007,6 +1009,7 @@ export class UserSelect extends React.Component<
className={cx('UserSelect-input', isOpened ? 'is-active' : '')}
allowInput={false}
result={this.getResult()}
disabled={disabled}
itemRender={(option: any) => {
if (labelField !== 'avatar') {
return (
Expand Down
3 changes: 3 additions & 0 deletions packages/amis-ui/src/components/UserTabSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export interface UserTabSelectProps extends ThemeProps, LocaleProps {
selection?: Array<Option>;
displayFields: string[];
data?: PlainObject;
disabled?: boolean;
onChange: (value: Array<Option> | Option) => void;
onSearch?: (
term: string,
Expand Down Expand Up @@ -212,6 +213,7 @@ export class UserTabSelect extends React.Component<
onSearch,
deferLoad,
data,
disabled,
displayFields,
mobileUI
} = this.props;
Expand All @@ -227,6 +229,7 @@ export class UserTabSelect extends React.Component<
onResultClick={this.onOpen}
placeholder={placeholder}
mobileUI={mobileUI}
disabled={disabled}
/>
<PopUp
isShow={isOpened}
Expand Down
5 changes: 4 additions & 1 deletion packages/amis/src/renderers/Form/UserSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ export default class UserSelectControl extends React.Component<
data,
displayFields,
labelField,
loadingConfig
loadingConfig,
disabled
} = this.props;
tabOptions?.forEach((item: any) => {
item.deferLoad = this.deferLoad;
Expand All @@ -260,6 +261,7 @@ export default class UserSelectControl extends React.Component<
onSearch={this.onSearch}
deferLoad={this.deferLoad}
data={data}
disabled={disabled}
/>
) : (
<UserSelect
Expand All @@ -280,6 +282,7 @@ export default class UserSelectControl extends React.Component<
labelField={labelField}
isDep={isDep}
isRef={isRef}
disabled={disabled}
/>
)}
</div>
Expand Down

0 comments on commit 421f86d

Please sign in to comment.