From 4ab42795cf11f5d03ad6d5293089310e9e9a3b99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?sanguu=28=EB=B0=95=EC=83=81=ED=98=84=29?= Date: Tue, 15 Nov 2022 14:07:03 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B9=84=ED=96=89=EC=9D=B4=EB=A0=A5=20?= =?UTF-8?q?=ED=98=84=ED=99=A9=20-=20=EB=82=A0=EC=A7=9C=20=EB=B2=84?= =?UTF-8?q?=EA=B7=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/analysis/history/AnalysisHistorySearch.js | 5 ++++- .../analysis/history/AnalysisHistoryContainer.js | 9 +++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/components/analysis/history/AnalysisHistorySearch.js b/src/components/analysis/history/AnalysisHistorySearch.js index dc4ba12a..ebfa8ac0 100644 --- a/src/components/analysis/history/AnalysisHistorySearch.js +++ b/src/components/analysis/history/AnalysisHistorySearch.js @@ -13,8 +13,11 @@ import { } from 'reactstrap'; export const AnalysisHistorySearch = props => { + console.log(props.isClick) + console.log(props.dateType) useEffect(() => { - if (props.isClick != -1) { + if (props.isClick > 0) { + props.setParams({ ...props.params, stDate: moment().subtract(props.dateType, 'day').format('YYYY-MM-DD'), diff --git a/src/containers/analysis/history/AnalysisHistoryContainer.js b/src/containers/analysis/history/AnalysisHistoryContainer.js index a040ce04..fbe298d1 100644 --- a/src/containers/analysis/history/AnalysisHistoryContainer.js +++ b/src/containers/analysis/history/AnalysisHistoryContainer.js @@ -82,11 +82,12 @@ export const AnalysisHistoryContainer = props => { ...params, stDate: moment().subtract(7, 'day').format('YYYY-MM-DD'), endDate: moment().subtract(0, 'day').format('YYYY-MM-DD'), + // stDate: '', + // endDate: '', search1: '', groupId: searchData.groupId }); - dispatch(Actions.LIST_INITAL()); - dispatch(Actions.list.request({ searchParams: params, page: 1 })); + }, [searchData.groupId]); // useEffect(() => { @@ -110,7 +111,7 @@ export const AnalysisHistoryContainer = props => { // groupId sessionStorage에 보관 (1 브라우저 1 tab에만 유효) sessionStorage.setItem('groupId', groupId); sessionStorage.setItem('cstmrSno', user.cstmrSno); - + setDateType(7); setIsClick(7); setSearchData(prevState => { return { @@ -131,7 +132,7 @@ export const AnalysisHistoryContainer = props => { stDate: '' }) ); - setIsClick(0); + setIsClick(7); }; const dispatch = useDispatch();