From 748f66921ca14ac074f4dabd5bee87ca5b721083 Mon Sep 17 00:00:00 2001 From: JANGHYUNn Date: Wed, 4 Sep 2024 15:41:53 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B9=84=ED=96=89=EC=8A=B9=EC=9D=B8=20?= =?UTF-8?q?=ED=8C=9D=EC=97=85=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=EC=B4=88?= =?UTF-8?q?=EA=B8=B0=ED=99=94=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../popup/ControlApprovalsPopupContainer.js | 39 ++++++++++------ .../popup/OperationApprovalsPopupContainer.js | 46 ++++++++++++------- 2 files changed, 55 insertions(+), 30 deletions(-) diff --git a/src/containers/flight/popup/ControlApprovalsPopupContainer.js b/src/containers/flight/popup/ControlApprovalsPopupContainer.js index c9c5be6a..3c0e7859 100644 --- a/src/containers/flight/popup/ControlApprovalsPopupContainer.js +++ b/src/containers/flight/popup/ControlApprovalsPopupContainer.js @@ -40,6 +40,17 @@ function ControlApprovalsPopupContainer() { }; }, []); + useEffect(() => { + const searchStDt = dayjs().add(-7, 'day').format('YYYY-MM-DD'); + const searchEndDt = dayjs().format('YYYY-MM-DD'); + dispatch( + getLaancAprvList({ + searchStDt, + searchEndDt + }) + ); + }, []); + const opnerMessage = e => { const { type } = e.data; const { payload } = e.data; @@ -104,20 +115,20 @@ function ControlApprovalsPopupContainer() { dispatch(getLaancAprvList(param)); dispatch(clientRefreshAprvListParam(param)); - localStorage.setItem( - 'popupState', - JSON.stringify({ - filter: search, - ctprvn: filterArea.ctprvn === '시/도' ? '' : filterArea.ctprvn, - sig: filterArea.sig === '군/구' ? '' : filterArea.sig, - address: filterArea.address, - startDate: searchDate.startDate, - endDate: searchDate.endDate, - reviewedType: checkState.reviewedType, - reviewedProcType: checkState.reviewedProcType, - limitZoneNm: checkState.limitZoneNm - }) - ); + // localStorage.setItem( + // 'popupState', + // JSON.stringify({ + // filter: search, + // ctprvn: filterArea.ctprvn === '시/도' ? '' : filterArea.ctprvn, + // sig: filterArea.sig === '군/구' ? '' : filterArea.sig, + // address: filterArea.address, + // startDate: searchDate.startDate, + // endDate: searchDate.endDate, + // reviewedType: checkState.reviewedType, + // reviewedProcType: checkState.reviewedProcType, + // limitZoneNm: checkState.limitZoneNm + // }) + // ); handlerOpnerPostMessage('search', { search, searchDate, filterArea }); }; diff --git a/src/containers/flight/popup/OperationApprovalsPopupContainer.js b/src/containers/flight/popup/OperationApprovalsPopupContainer.js index d9592c31..007d1bc7 100644 --- a/src/containers/flight/popup/OperationApprovalsPopupContainer.js +++ b/src/containers/flight/popup/OperationApprovalsPopupContainer.js @@ -9,8 +9,11 @@ import WebsocketClient from '@src/components/websocket/WebsocketClient'; function OperationApprovalsPopupContainer() { const [filter, setFilter] = useState(''); - const [startDate, setStartDate] = useState(dayjs().format('YYYY-MM-DD')); - const [endDate, setEndDate] = useState(); + + const [startDate, setStartDate] = useState( + dayjs().add(-7, 'day').format('YYYY-MM-DD') + ); + const [endDate, setEndDate] = useState(dayjs().format('YYYY-MM-DD')); const [selected, setSelected] = useState(null); const [selectedPlanSno, setSelectedPlanSno] = useState(null); @@ -42,6 +45,17 @@ function OperationApprovalsPopupContainer() { }; }, []); + useEffect(() => { + const searchStDt = dayjs().add(-7, 'day').format('YYYY-MM-DD'); + const searchEndDt = dayjs().format('YYYY-MM-DD'); + dispatch( + getLaancAprvList({ + searchStDt, + searchEndDt + }) + ); + }, []); + // 부모창에서 보내는 메세지 const opnerMessage = e => { const { type } = e.data; @@ -129,20 +143,20 @@ function OperationApprovalsPopupContainer() { dispatch(getLaancAprvList(param)); dispatch(clientRefreshAprvListParam(param)); - localStorage.setItem( - 'popupState', - JSON.stringify({ - filter: search, - ctprvn: filterArea.ctprvn === '시/도' ? '' : filterArea.ctprvn, - sig: filterArea.sig === '군/구' ? '' : filterArea.sig, - address: filterArea.address, - startDate: searchDate.startDate, - endDate: searchDate.endDate, - reviewedType: checkState.reviewedType, - reviewedProcType: checkState.reviewedProcType, - limitZoneNm: checkState.limitZoneNm - }) - ); + // localStorage.setItem( + // 'popupState', + // JSON.stringify({ + // filter: search, + // ctprvn: filterArea.ctprvn === '시/도' ? '' : filterArea.ctprvn, + // sig: filterArea.sig === '군/구' ? '' : filterArea.sig, + // address: filterArea.address, + // startDate: searchDate.startDate, + // endDate: searchDate.endDate, + // reviewedType: checkState.reviewedType, + // reviewedProcType: checkState.reviewedProcType, + // limitZoneNm: checkState.limitZoneNm + // }) + // ); handlerOpnerPostMessage('search', { search, searchDate, filterArea }); };