From d183591ce9c6de105702b7a7bf16c283f92daef2 Mon Sep 17 00:00:00 2001 From: awenes <1121353141@qq.com> Date: Thu, 4 Apr 2024 22:51:48 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20=E4=BC=98=E5=8C=96=E8=BA=AB=E4=BB=BD?= =?UTF-8?q?=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/CreateModal/CreateModal.tsx | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/eiam-console/src/main/console-fe/src/pages/account/IdentitySourceList/components/CreateModal/CreateModal.tsx b/eiam-console/src/main/console-fe/src/pages/account/IdentitySourceList/components/CreateModal/CreateModal.tsx index 0bad5845..5407e472 100644 --- a/eiam-console/src/main/console-fe/src/pages/account/IdentitySourceList/components/CreateModal/CreateModal.tsx +++ b/eiam-console/src/main/console-fe/src/pages/account/IdentitySourceList/components/CreateModal/CreateModal.tsx @@ -15,12 +15,13 @@ * 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/>. */ -import { useRef, useState } from 'react'; +import React, { useRef, useState } from 'react'; 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 { useIntl } from '@umijs/max'; import { IdentitySourceProvider } from '@/constant'; +import { ICON_LIST } from '@/components/IconFont/constant'; type CreateModelProps = { visible: boolean; @@ -65,6 +66,14 @@ export default (props: CreateModelProps) => { placeholder: intl.formatMessage({ id: 'pages.account.identity_source_list.create_modal.provider.placeholder', }), + optionRender: ({ data }) => { + return ( + <Space> + <Avatar shape={'square'} src={data?.icon} /> + {data.label} + </Space> + ); + }, }} options={[ { @@ -72,18 +81,21 @@ export default (props: CreateModelProps) => { label: intl.formatMessage({ id: 'pages.account.identity_source_list.create_modal.provider.placeholder.options.dingtalk', }), - }, - { - value: IdentitySourceProvider.wework, - label: intl.formatMessage({ - id: 'pages.account.identity_source_list.create_modal.provider.placeholder.options.wework', - }), + icon: ICON_LIST[IdentitySourceProvider.dingtalk], }, { value: IdentitySourceProvider.feishu, label: intl.formatMessage({ 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={[