MCPcopy Create free account
hub / github.com/baiwumm/react-admin / ProFormLeader

Function ProFormLeader

Xmw_web/src/components/CommonProForm/index.tsx:79–105  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

77 * @author: 白雾茫茫丶
78 */
79export const ProFormLeader: FC = () => {
80 const { formatMessage } = useIntl();
81 /**
82 * @description: 获取用户列表
83 * @author: 白雾茫茫丶
84 */
85 const { data: userList } = useRequest(async (params) => get(await getUserList(params), 'data.list', []), {
86 defaultParams: [{ current: 1, pageSize: 9999 }],
87 });
88 return (
89 <ProFormSelect
90 name="leader"
91 label={formatMessage({ id: INTERNATION.LEADER })}
92 colProps={{ span: 24 }}
93 placeholder={formatMessage({ id: INTERNATION.PLACEHOLDER_SELETED }) +
94 formatMessage({ id: INTERNATION.LEADER })}
95 options={userList?.map((u: API.USERMANAGEMENT) => ({ label: u.cn_name, value: u.user_id })) || []}
96 fieldProps={{
97 showSearch: true,
98 }}
99 rules={[{
100 required: true, message: formatMessage({ id: INTERNATION.PLACEHOLDER_SELETED }) +
101 formatMessage({ id: INTERNATION.LEADER }),
102 }]}
103 />
104 )
105}
106
107/**
108 * @description: 排序

Callers

nothing calls this directly

Calls 2

getUserListFunction · 0.90
getFunction · 0.85

Tested by

no test coverage detected