|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
import { createContext, useContext } from 'react';
|
|
|
|
|
import { createContext, useContext, useEffect } from 'react';
|
|
|
|
|
import { toJS } from 'mobx';
|
|
|
|
|
import { observer } from 'mobx-react';
|
|
|
|
|
import { DATE_FORMAT, stores_Context } from './../../config';
|
|
|
|
@ -14,7 +14,7 @@ import DateTypeSelect from './DataTypeSelect';
|
|
|
|
|
import DatePickerCharts from './DatePickerCharts';
|
|
|
|
|
import YearPickerCharts from './YearPickerCharts';
|
|
|
|
|
import SearchInput from './Input';
|
|
|
|
|
import { objectMapper, at } from './../../utils/commons';
|
|
|
|
|
import { objectMapper, at, empty } from './../../utils/commons';
|
|
|
|
|
|
|
|
|
|
import './search.css';
|
|
|
|
|
|
|
|
|
@ -44,7 +44,7 @@ export default observer((props) => {
|
|
|
|
|
};
|
|
|
|
|
const { onSubmit, confirmText } = props;
|
|
|
|
|
|
|
|
|
|
const onFinish = (values) => {
|
|
|
|
|
const formValuesMapper = (values) => {
|
|
|
|
|
console.log('Received values of form, origin form value: ', values);
|
|
|
|
|
const destinationObject = {
|
|
|
|
|
'DateType': {
|
|
|
|
@ -155,6 +155,11 @@ export default observer((props) => {
|
|
|
|
|
// omit empty
|
|
|
|
|
Object.keys(dest).forEach((key) => (dest[key] == null || dest[key] === '' || dest[key].length === 0) && delete dest[key]);
|
|
|
|
|
console.log('form value send to onSubmit:', dest);
|
|
|
|
|
return dest;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const onFinish = (values) => {
|
|
|
|
|
const dest = formValuesMapper(values);
|
|
|
|
|
const str = new URLSearchParams(dest).toString();
|
|
|
|
|
searchFormStore.setFormValues(values);
|
|
|
|
|
searchFormStore.setFormValuesToSub(dest);
|
|
|
|
|