UploadWrap.tsx
792 Bytes
import { Field } from '@formily/react';
import { FormItem } from '@formily/antd-v5';
import cx from 'classnames';
import './index.less';
import { FieldProps } from '../../typings';
import UploadFiles from '@/hr/upload_file';
const UploadWrap: React.FC<FieldProps> = (props) => {
const { name, title, validator = [], decoratorProps, componentProps } = props;
return (
<div className={cx('global_upload_wrap')}>
<Field
{...props}
name={name}
title={title}
decorator={[FormItem, { ...decoratorProps }]}
component={[
UploadFiles,
{
...componentProps,
componenttypename: 'UploadFiles',
},
]}
validator={validator}
/>
</div>
);
};
export default UploadWrap;