Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 人员组件移动端支持禁用 #11306

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading