Browse Source

Merge branch 'master' of http://gitea.palntour.com/pav/pav-home

pull/2/head
이학준 2 years ago
parent
commit
b180f4be82
  1. 18
      src/containers/analysis/history/AnalysisHistoryContainer.js

18
src/containers/analysis/history/AnalysisHistoryContainer.js

@ -96,7 +96,8 @@ export const AnalysisHistoryContainer = props => {
const [params, setParams] = useState({ const [params, setParams] = useState({
stDate: moment().subtract(1, 'day').format('YYYY-MM-DD'), stDate: moment().subtract(1, 'day').format('YYYY-MM-DD'),
endDate: moment().subtract(-1, 'day').format('YYYY-MM-DD'), endDate: moment().subtract(-1, 'day').format('YYYY-MM-DD'),
search1: '' search1: '',
groupId: searchData.groupId
}); });
const excelHeaders = [ const excelHeaders = [
@ -213,11 +214,12 @@ export const AnalysisHistoryContainer = props => {
setParams({ setParams({
stDate: searchParams.stDate, stDate: searchParams.stDate,
endDate: searchParams.endDate, endDate: searchParams.endDate,
search1: searchParams.search1 search1: searchParams.search1,
groupId: searchData.groupId
}); });
} }
// handlerSearch(); handlerSearch();
}, []); }, [searchData]);
const onKeyPress = e => { const onKeyPress = e => {
if (e.key == 'Enter') { if (e.key == 'Enter') {
@ -228,20 +230,20 @@ export const AnalysisHistoryContainer = props => {
useEffect(() => { }, [params]); useEffect(() => { }, [params]);
const handlerSearch = () => { const handlerSearch = () => {
console.log("----",params);
dispatch(Actions.list.request({ searchParams: params })); dispatch(Actions.list.request({ searchParams: params }));
}; };
const handlerInput = (type, val) => { const handlerInput = (type, val) => {
if (type === 'search1') { if (type === 'search1') {
setParams({ ...params, search1: val }); setParams({ ...params, search1: val});
} }
if (type === 'searchDate') { if (type === 'searchDate') {
if (val.length == 2) { if (val.length == 2) {
setParams({ setParams({
...params, ...params,
stDate: moment(val[0]).format('YYYY-MM-DD'), stDate: moment(val[0]).format('YYYY-MM-DD'),
endDate: moment(val[1]).format('YYYY-MM-DD') endDate: moment(val[1]).format('YYYY-MM-DD'),
}); });
} }
} }

Loading…
Cancel
Save