diff --git a/src/components/SearchForm.jsx b/src/components/SearchForm.jsx index c116dd8..64e0794 100644 --- a/src/components/SearchForm.jsx +++ b/src/components/SearchForm.jsx @@ -14,10 +14,11 @@ const SearchForm = ({ initialValue, onSubmit, onReset, ...props }) => { const [formValues, setFormValues] = useFormStore((state) => [state.formValues, state.setFormValues]); const [formValuesToSub, setFormValuesToSub] = useFormStore((state) => [state.formValuesToSub, state.setFormValuesToSub]); const [form] = Form.useForm(); - const { sort, hides, shows, fieldProps } = { + const { sort, hides, shows, fieldProps, fieldComProps } = { sort: '', // initialValue: '', fieldProps: '', + fieldComProps: '', hides: [], shows: [], ...props.defaultValue, @@ -87,7 +88,7 @@ const SearchForm = ({ initialValue, onSubmit, onReset, ...props }) => {
{/* */} - {getFields({ sort, initialValue: readValues, hides, shows, fieldProps, form, presets, t })} + {getFields({ sort, initialValue: readValues, hides, shows, fieldProps, fieldComProps, form, presets, t })} {/* 'textAlign': 'right' */} @@ -107,7 +108,7 @@ const SearchForm = ({ initialValue, onSubmit, onReset, ...props }) => { }; function getFields(props) { - const { fieldProps, form, presets, t } = props; + const { fieldProps, fieldComProps, form, presets, t } = props; const bigCol = 4 * 2; const midCol = 6; const layoutProps = { @@ -167,11 +168,8 @@ function getFields(props) { allowClear={true} inputReadOnly={true} presets={presets} - // defaultValue={toJS(arrivalDateRange)} placeholder={['From', 'Thru']} - // onChange={(dateRange) => { - // reservationStore.updatePropertyValue('arrivalDateRange', dateRange == null ? [] : dateRange) - // }} + {...fieldComProps.dates} /> , fieldProps?.dates?.col || midCol diff --git a/src/views/report/Index.jsx b/src/views/report/Index.jsx index dcda29c..88769ce 100644 --- a/src/views/report/Index.jsx +++ b/src/views/report/Index.jsx @@ -286,6 +286,7 @@ function Index() { fieldProps: { dates: { label: 'Select Date', col: 12 }, }, + fieldComProps: { dates: { picker: 'month', presets: false } }, }} confirmText={'Get Report'} onSubmit={(err, formVal, filedsVal) => {