chore: provider form test

This commit is contained in:
jialin
2026-02-03 18:21:08 +08:00
parent d86d061f97
commit e188d788b9
27 changed files with 448 additions and 317 deletions
+15 -1
View File
@@ -1,5 +1,6 @@
import SealInput from '@/components/seal-form/seal-input';
import SealSelect from '@/components/seal-form/seal-select';
import useAppUtils from '@/hooks/use-app-utils';
import { useIntl } from '@umijs/max';
import { Form } from 'antd';
import ProviderLogo from '../components/provider-logo';
@@ -9,6 +10,7 @@ import { FormData } from '../config/types';
const Basic = () => {
const intl = useIntl();
const form = Form.useFormInstance<FormData>();
const { getRuleMessage } = useAppUtils();
const optionRender = (option: any) => {
return (
@@ -29,9 +31,21 @@ const Basic = () => {
})}
/>
</Form.Item>
<Form.Item<FormData> name={['config', 'type']}>
<Form.Item<FormData>
name={['config', 'type']}
rules={[
{
required: true,
message: getRuleMessage(
'select',
intl.formatMessage({ id: 'providers.table.providerName' })
)
}
]}
>
<SealSelect
showSearch
required
options={maasProviderOptions}
optionRender={optionRender}
labelRender={optionRender}