mirror of https://gitee.com/topiam/eiam
⚡ 优化身份源
parent
2a55f8967e
commit
d183591ce9
|
@ -15,12 +15,13 @@
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import { useRef, useState } from 'react';
|
import React, { useRef, useState } from 'react';
|
||||||
import { ModalForm, ProFormSelect, ProFormText, ProFormTextArea } from '@ant-design/pro-components';
|
import { ModalForm, ProFormSelect, ProFormText, ProFormTextArea } from '@ant-design/pro-components';
|
||||||
import type { FormInstance } from 'antd';
|
import { Avatar, FormInstance, Space } from 'antd';
|
||||||
import { Spin } from 'antd';
|
import { Spin } from 'antd';
|
||||||
import { useIntl } from '@umijs/max';
|
import { useIntl } from '@umijs/max';
|
||||||
import { IdentitySourceProvider } from '@/constant';
|
import { IdentitySourceProvider } from '@/constant';
|
||||||
|
import { ICON_LIST } from '@/components/IconFont/constant';
|
||||||
|
|
||||||
type CreateModelProps = {
|
type CreateModelProps = {
|
||||||
visible: boolean;
|
visible: boolean;
|
||||||
|
@ -65,6 +66,14 @@ export default (props: CreateModelProps) => {
|
||||||
placeholder: intl.formatMessage({
|
placeholder: intl.formatMessage({
|
||||||
id: 'pages.account.identity_source_list.create_modal.provider.placeholder',
|
id: 'pages.account.identity_source_list.create_modal.provider.placeholder',
|
||||||
}),
|
}),
|
||||||
|
optionRender: ({ data }) => {
|
||||||
|
return (
|
||||||
|
<Space>
|
||||||
|
<Avatar shape={'square'} src={data?.icon} />
|
||||||
|
{data.label}
|
||||||
|
</Space>
|
||||||
|
);
|
||||||
|
},
|
||||||
}}
|
}}
|
||||||
options={[
|
options={[
|
||||||
{
|
{
|
||||||
|
@ -72,18 +81,21 @@ export default (props: CreateModelProps) => {
|
||||||
label: intl.formatMessage({
|
label: intl.formatMessage({
|
||||||
id: 'pages.account.identity_source_list.create_modal.provider.placeholder.options.dingtalk',
|
id: 'pages.account.identity_source_list.create_modal.provider.placeholder.options.dingtalk',
|
||||||
}),
|
}),
|
||||||
},
|
icon: ICON_LIST[IdentitySourceProvider.dingtalk],
|
||||||
{
|
|
||||||
value: IdentitySourceProvider.wework,
|
|
||||||
label: intl.formatMessage({
|
|
||||||
id: 'pages.account.identity_source_list.create_modal.provider.placeholder.options.wework',
|
|
||||||
}),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: IdentitySourceProvider.feishu,
|
value: IdentitySourceProvider.feishu,
|
||||||
label: intl.formatMessage({
|
label: intl.formatMessage({
|
||||||
id: 'pages.account.identity_source_list.create_modal.provider.placeholder.options.feishu',
|
id: 'pages.account.identity_source_list.create_modal.provider.placeholder.options.feishu',
|
||||||
}),
|
}),
|
||||||
|
icon: ICON_LIST[IdentitySourceProvider.feishu],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: IdentitySourceProvider.wework,
|
||||||
|
label: intl.formatMessage({
|
||||||
|
id: 'pages.account.identity_source_list.create_modal.provider.placeholder.options.wework',
|
||||||
|
}),
|
||||||
|
icon: ICON_LIST[IdentitySourceProvider.wework],
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
rules={[
|
rules={[
|
||||||
|
|
Loading…
Reference in New Issue