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 }); };