|
|
@ -14,10 +14,11 @@ const SearchForm = ({ initialValue, onSubmit, onReset, ...props }) => {
|
|
|
|
const [formValues, setFormValues] = useFormStore((state) => [state.formValues, state.setFormValues]);
|
|
|
|
const [formValues, setFormValues] = useFormStore((state) => [state.formValues, state.setFormValues]);
|
|
|
|
const [formValuesToSub, setFormValuesToSub] = useFormStore((state) => [state.formValuesToSub, state.setFormValuesToSub]);
|
|
|
|
const [formValuesToSub, setFormValuesToSub] = useFormStore((state) => [state.formValuesToSub, state.setFormValuesToSub]);
|
|
|
|
const [form] = Form.useForm();
|
|
|
|
const [form] = Form.useForm();
|
|
|
|
const { sort, hides, shows, fieldProps } = {
|
|
|
|
const { sort, hides, shows, fieldProps, fieldComProps } = {
|
|
|
|
sort: '',
|
|
|
|
sort: '',
|
|
|
|
// initialValue: '',
|
|
|
|
// initialValue: '',
|
|
|
|
fieldProps: '',
|
|
|
|
fieldProps: '',
|
|
|
|
|
|
|
|
fieldComProps: '',
|
|
|
|
hides: [],
|
|
|
|
hides: [],
|
|
|
|
shows: [],
|
|
|
|
shows: [],
|
|
|
|
...props.defaultValue,
|
|
|
|
...props.defaultValue,
|
|
|
@ -87,7 +88,7 @@ const SearchForm = ({ initialValue, onSubmit, onReset, ...props }) => {
|
|
|
|
<Form form={form} name='advanced_search' className='orders-search-form' onFinish={onFinish} onValuesChange={onValuesChange}>
|
|
|
|
<Form form={form} name='advanced_search' className='orders-search-form' onFinish={onFinish} onValuesChange={onValuesChange}>
|
|
|
|
{/* <EditableContext.Provider value={form}> */}
|
|
|
|
{/* <EditableContext.Provider value={form}> */}
|
|
|
|
<Row gutter={16}>
|
|
|
|
<Row gutter={16}>
|
|
|
|
{getFields({ sort, initialValue: readValues, hides, shows, fieldProps, form, presets, t })}
|
|
|
|
{getFields({ sort, initialValue: readValues, hides, shows, fieldProps, fieldComProps, form, presets, t })}
|
|
|
|
{/* 'textAlign': 'right' */}
|
|
|
|
{/* 'textAlign': 'right' */}
|
|
|
|
<Col flex='1 0 90px' className='flex justify-normal items-start' >
|
|
|
|
<Col flex='1 0 90px' className='flex justify-normal items-start' >
|
|
|
|
<Space align='center'>
|
|
|
|
<Space align='center'>
|
|
|
@ -107,7 +108,7 @@ const SearchForm = ({ initialValue, onSubmit, onReset, ...props }) => {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
function getFields(props) {
|
|
|
|
function getFields(props) {
|
|
|
|
const { fieldProps, form, presets, t } = props;
|
|
|
|
const { fieldProps, fieldComProps, form, presets, t } = props;
|
|
|
|
const bigCol = 4 * 2;
|
|
|
|
const bigCol = 4 * 2;
|
|
|
|
const midCol = 6;
|
|
|
|
const midCol = 6;
|
|
|
|
const layoutProps = {
|
|
|
|
const layoutProps = {
|
|
|
@ -167,11 +168,8 @@ function getFields(props) {
|
|
|
|
allowClear={true}
|
|
|
|
allowClear={true}
|
|
|
|
inputReadOnly={true}
|
|
|
|
inputReadOnly={true}
|
|
|
|
presets={presets}
|
|
|
|
presets={presets}
|
|
|
|
// defaultValue={toJS(arrivalDateRange)}
|
|
|
|
|
|
|
|
placeholder={['From', 'Thru']}
|
|
|
|
placeholder={['From', 'Thru']}
|
|
|
|
// onChange={(dateRange) => {
|
|
|
|
{...fieldComProps.dates}
|
|
|
|
// reservationStore.updatePropertyValue('arrivalDateRange', dateRange == null ? [] : dateRange)
|
|
|
|
|
|
|
|
// }}
|
|
|
|
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</Form.Item>,
|
|
|
|
</Form.Item>,
|
|
|
|
fieldProps?.dates?.col || midCol
|
|
|
|
fieldProps?.dates?.col || midCol
|
|
|
|