|
|
@ -1,7 +1,7 @@
|
|
|
|
import { createContext, useContext, useEffect, useState } from 'react';
|
|
|
|
import { createContext, useContext, useEffect, useState } from 'react';
|
|
|
|
import { Form, Input, Row, Col, Select, DatePicker, Space, Button } from 'antd';
|
|
|
|
import { Form, Input, Row, Col, Select, DatePicker, Space, Button } from 'antd';
|
|
|
|
import { objectMapper, at, isEmpty } from '@/utils/commons';
|
|
|
|
import { objectMapper, at, isEmpty } from '@/utils/commons';
|
|
|
|
import { DATE_FORMAT } from '@/config';
|
|
|
|
import { DATE_FORMAT, SMALL_DATETIME_FORMAT } from '@/config';
|
|
|
|
import useFormStore from '@/stores/Form';
|
|
|
|
import useFormStore from '@/stores/Form';
|
|
|
|
import usePresets from '@/hooks/usePresets';
|
|
|
|
import usePresets from '@/hooks/usePresets';
|
|
|
|
import { useTranslation } from 'react-i18next';
|
|
|
|
import { useTranslation } from 'react-i18next';
|
|
|
@ -31,6 +31,8 @@ const SearchForm = ({ initialValue, onSubmit, onReset, ...props }) => {
|
|
|
|
'dates': [
|
|
|
|
'dates': [
|
|
|
|
{ key: 'startdate', transform: (arrVal) => (arrVal ? arrVal[0].format(DATE_FORMAT) : '') },
|
|
|
|
{ key: 'startdate', transform: (arrVal) => (arrVal ? arrVal[0].format(DATE_FORMAT) : '') },
|
|
|
|
{ key: 'enddate', transform: (arrVal) => (arrVal ? arrVal[1].format(DATE_FORMAT) : '') },
|
|
|
|
{ key: 'enddate', transform: (arrVal) => (arrVal ? arrVal[1].format(DATE_FORMAT) : '') },
|
|
|
|
|
|
|
|
{ key: 'starttime', transform: (arrVal) => (arrVal ? arrVal[0].format(DATE_FORMAT) : '') },
|
|
|
|
|
|
|
|
{ key: 'endtime', transform: (arrVal) => (arrVal ? arrVal[1].format(SMALL_DATETIME_FORMAT) : '') },
|
|
|
|
],
|
|
|
|
],
|
|
|
|
'invoiceStatus': { key: 'invoiceStatus', transform: (value) => value?.value || value?.key || '', default: '' },
|
|
|
|
'invoiceStatus': { key: 'invoiceStatus', transform: (value) => value?.value || value?.key || '', default: '' },
|
|
|
|
};
|
|
|
|
};
|
|
|
|