index.tsx
861 Bytes
import { Field } from '@formily/react';
import { FormItem } from '@formily/antd-v5';
import cx from 'classnames';
import './index.less';
import { FieldProps } from '../../typings';
import MapSelect from '@/hr/map_select';
const SelectMap: React.FC<FieldProps> = (props) => {
const { name, addressName, title, validator = [], decoratorProps, componentProps } = props;
return (
<div className={cx('global_map_input')}>
<Field
{...props}
name={name}
title={title}
decorator={[FormItem, { ...decoratorProps }]}
component={[
MapSelect,
{
allowClear: true,
...componentProps,
addressName: addressName,
componenttypename: 'MapSelect',
},
]}
validator={validator}
/>
</div>
);
};
export default SelectMap;