From e077c84a16a3f51e59cba0e75870f26276fbd294 Mon Sep 17 00:00:00 2001 From: sanguu Date: Tue, 20 Sep 2022 17:53:21 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B9=84=ED=96=89=EC=9D=B4=EB=A0=A5=20?= =?UTF-8?q?=EC=B5=9C=EC=A2=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../analysis/history/AnalysisHistorySearch.js | 28 +++++++++++-------- .../history/AnalysisHistoryContainer.js | 14 +--------- 2 files changed, 17 insertions(+), 25 deletions(-) diff --git a/src/components/analysis/history/AnalysisHistorySearch.js b/src/components/analysis/history/AnalysisHistorySearch.js index 27e433e3..30d23c1d 100644 --- a/src/components/analysis/history/AnalysisHistorySearch.js +++ b/src/components/analysis/history/AnalysisHistorySearch.js @@ -13,16 +13,20 @@ import { } from 'reactstrap'; export const AnalysisHistorySearch = props => { - + const [isClick, setIsClick] = useState(1); + const [dateType, setDateType] = useState(1); useEffect(() => { props.setParams({ ...props.params, - stDate: moment().subtract(props.dateType, 'day').format('YYYY-MM-DD'), - endDate: moment().subtract(0, 'day').format('YYYY-MM-DD') + stDate: moment().subtract(dateType, 'day').format('YYYY-MM-DD') }); - }, [props.dateType,props.params.groupId]); + }, [dateType,props.params.groupId]); + const handlerClickDate = val => { + setDateType(val); + setIsClick(val); + }; @@ -85,32 +89,32 @@ export const AnalysisHistorySearch = props => { diff --git a/src/containers/analysis/history/AnalysisHistoryContainer.js b/src/containers/analysis/history/AnalysisHistoryContainer.js index c56b0a7a..c55aa4ab 100644 --- a/src/containers/analysis/history/AnalysisHistoryContainer.js +++ b/src/containers/analysis/history/AnalysisHistoryContainer.js @@ -35,10 +35,6 @@ export const AnalysisHistoryContainer = props => { const { joinList, joinListCount } = useSelector(state => state.groupState); const { user } = useSelector(state => state.authState, shallowEqual); - const [isClick, setIsClick] = useState(1); - const [dateType, setDateType] = useState(1); - - const handleGroupSelect = ({ groupId, groupNm, groupAuthCd }) => { // 권한 상관 없이 모두 조회 가능 const param = searchData; @@ -251,15 +247,10 @@ export const AnalysisHistoryContainer = props => { stDate: moment(val[0]).format('YYYY-MM-DD'), endDate: moment(val[1]).format('YYYY-MM-DD'), }); - setIsClick(0) + } } }; - const handlerClickDate = val => { - setDateType(val); - setIsClick(val); - }; - return ( @@ -283,9 +274,6 @@ export const AnalysisHistoryContainer = props => { params={params} onKeyPress={onKeyPress} setParams={setParams} - isClick={isClick} - dateType={dateType} - handlerClickDate={handlerClickDate} />