注册时使用公共组件上传营业执照附件
This commit is contained in:
@ -20,6 +20,7 @@ import {
|
|||||||
AttachmentSection,
|
AttachmentSection,
|
||||||
} from './CommonFormSections';
|
} from './CommonFormSections';
|
||||||
import { validateFileSize } from '@/utils/utils';
|
import { validateFileSize } from '@/utils/utils';
|
||||||
|
import FileUpload from '@/components/FileUpload/FileUpload';
|
||||||
|
|
||||||
const { Option } = Select;
|
const { Option } = Select;
|
||||||
const { TextArea } = Input;
|
const { TextArea } = Input;
|
||||||
@ -73,16 +74,23 @@ const DomesticForm: React.FC<DomesticFormProps> = ({
|
|||||||
label="营业执照附件"
|
label="营业执照附件"
|
||||||
extra="pdf,jpg,jpeg,png类型的文件,大小不超过10MB"
|
extra="pdf,jpg,jpeg,png类型的文件,大小不超过10MB"
|
||||||
rules={[{ required: true, message: '请上传营业执照附件' }]}
|
rules={[{ required: true, message: '请上传营业执照附件' }]}
|
||||||
|
// getValueProps={(value) => {
|
||||||
|
// return {
|
||||||
|
// value: value?.length > 0 ? value[0]?.url : undefined,
|
||||||
|
// };
|
||||||
|
// }}
|
||||||
|
getValueFromEvent={(value) => {
|
||||||
|
return value?.length > 0 ? value[0]?.url : undefined;
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<Upload
|
<FileUpload
|
||||||
name="businessLicense"
|
|
||||||
action="/api/upload"
|
|
||||||
listType="text"
|
listType="text"
|
||||||
maxCount={1}
|
maxCount={1}
|
||||||
beforeUpload={(file) => validateFileSize(file, 10, ['pdf', 'jpg', 'jpeg', 'png'])}
|
maxSize={10}
|
||||||
|
allowedTypes={['pdf', 'jpg', 'jpeg', 'png']}
|
||||||
>
|
>
|
||||||
<Button icon={<UploadOutlined />}>上传文件</Button>
|
<Button icon={<UploadOutlined />}>上传文件</Button>
|
||||||
</Upload>
|
</FileUpload>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={8}>
|
<Col span={8}>
|
||||||
|
Reference in New Issue
Block a user