diff --git a/src/components/laanc/LaancSearch.js b/src/components/laanc/LaancSearch.js index df3862d..a219495 100644 --- a/src/components/laanc/LaancSearch.js +++ b/src/components/laanc/LaancSearch.js @@ -5,12 +5,17 @@ import Flatpickr from 'react-flatpickr'; import moment from 'moment'; function LaancSearch() { - const [date, setDate] = useState( - moment().subtract('day').format('YYYY-MM-DD') - ); + const [date, setDate] = useState({ + stDate: moment().subtract(0, 'day').format('YYYY-MM-DD'), + endDate: moment().subtract(-14, 'day').format('YYYY-MM-DD') + }); - const handlerChangeDate = val => { - setDate(moment(val[0]).format('YYYY-MM-DD')); + const handlerChangeDate = selectedDates => { + if (selectedDates.length === 2) { + const stDate = moment(selectedDates[0]).format('YYYY-MM-DD'); + const endDate = moment(selectedDates[1]).format('YYYY-MM-DD'); + setDate({ stDate, endDate }); + } }; return ( @@ -34,7 +39,7 @@ function LaancSearch() {
-
신청일
+
신청기간
@@ -43,11 +48,14 @@ function LaancSearch() { + handlerChangeDate(selectedDates) + } className='form-control flat-picker bg-transparent border-0 shadow-none' /> diff --git a/src/containers/laanc/LaancPlanContainer.js b/src/containers/laanc/LaancPlanContainer.js index fed0939..1d87816 100644 --- a/src/containers/laanc/LaancPlanContainer.js +++ b/src/containers/laanc/LaancPlanContainer.js @@ -30,7 +30,7 @@ export default function LaancPlanContainer({ const [finalDetailData, setFinalDetailData] = useState({}); const [centeredModal, setCenteredModal] = useState(false); const [formModal, setFormModal] = useState(false); - const [modal2, setModal2] = useState({ + const [isErrorModal, setIsErrorModal] = useState({ isOpen: false, title: '', desc: '' @@ -447,7 +447,7 @@ export default function LaancPlanContainer({ /> )} - +
); diff --git a/src/modules/laanc/actions/laancActions.ts b/src/modules/laanc/actions/laancActions.ts index 54df87f..8f514fa 100644 --- a/src/modules/laanc/actions/laancActions.ts +++ b/src/modules/laanc/actions/laancActions.ts @@ -7,14 +7,11 @@ import { FlightPlanData, LaancPdf, LaancSunData, - LaancSunRq + LaancSunRq, + LaancAprvRq, + LaancAprvData } from '../models/laancModels'; -// laanc 공문 pdf 다운로드 -const LAANC_PDF_REQUEST = 'laanc/pdf/REQUEST'; -const LAANC_PDF_SUCCESS = 'laanc/pdf/SUCCESS'; -const LAANC_PDF_FAILURE = 'laanc/pdf/FAILURE'; - // laanc 비행계획서 승인 const LAANC_FLIGHT_APPROVAL_REQUEST = 'laanc/approval/REQUEST'; const LAANC_FLIGHT_APPROVAL_SUCCESS = 'laanc/approval/SUCCESS'; @@ -30,9 +27,13 @@ const LAANC_SUN_DATA_REQUEST = 'laanc/sun/REQUEST'; const LAANC_SUN_DATA_SUCCESS = 'laanc/sun/SUCCESS'; const LAANC_SUN_DATA_FAILURE = 'laanc/sun/FAILURE'; +//laanc 승인 목록 검색 +const LAANC_APRV_LIST_REQUEST = 'laanc/aprv/list/REQUEST'; +const LAANC_APRV_LIST_SUCCESS = 'laanc/aprv/list/SUCCESS'; +const LAANC_APRV_LIST_FAILURE = 'laanc/aprv/list/FAILURE'; + // laanc 초기화 const INIT_LAANC = 'laanc/init'; -// laanc 공문 pdf 다운로드 // laanc 비행계획서 승인 export const LAANC_FLIGHT_Approval = createAsyncAction( @@ -57,10 +58,18 @@ export const LAANC_SUN_DATA = createAsyncAction( LAANC_SUN_DATA_FAILURE )(); +// laanc 승인 목록 검색 +export const LAANC_APRV_LIST = createAsyncAction( + LAANC_APRV_LIST_REQUEST, + LAANC_APRV_LIST_SUCCESS, + LAANC_APRV_LIST_FAILURE +)(); + const actions = { LAANC_FLIGHT_Approval, LAANC_FLIGHT_CREATE, LAANC_APPROVAL_INIT, - LAANC_SUN_DATA + LAANC_SUN_DATA, + LAANC_APRV_LIST }; export type LaancAction = ActionType; diff --git a/src/modules/laanc/apis/laancApi.ts b/src/modules/laanc/apis/laancApi.ts index a0d2df2..1e55a65 100644 --- a/src/modules/laanc/apis/laancApi.ts +++ b/src/modules/laanc/apis/laancApi.ts @@ -4,7 +4,8 @@ import { FlightPlanAreaData, FlightPlanData, LaancSunData, - LaancSunRq + LaancSunRq, + LaancAprvRq } from '../models/laancModels'; // laanc 승인 @@ -23,5 +24,12 @@ export const laancApi = { params: data }); return res.data; + }, + // 승인 목록 검색 + getAprvList: async (data: LaancAprvRq) => { + const res = await axios.get(`api/bas/laanc/aprv/list`, { + params: data + }); + return res.data; } }; diff --git a/src/modules/laanc/models/laancModels.ts b/src/modules/laanc/models/laancModels.ts index 3bb92b1..9290074 100644 --- a/src/modules/laanc/models/laancModels.ts +++ b/src/modules/laanc/models/laancModels.ts @@ -5,6 +5,7 @@ export interface laancState { laancApply: LaancApproval | undefined; laancPdf: LaancPdf | undefined; laancSun: LaancSunData[] | undefined; + laancSearch: LaancAprvData[] | undefined; } // laanc계획서 초기값 @@ -362,6 +363,7 @@ export const laancControlData = { laancPdf: undefined, laancApply: undefined, laancSun: undefined, + laancSearch: undefined, detail: { planSno: 0, groupId: '', @@ -611,3 +613,45 @@ export interface LaancSunData { civile: string; // 일물 계산한 값 } []; + +// laanc 승인 요청 rq +export interface LaancAprvRq { + page: number; + schFltStDt: string; + schFltEndDt: string; +} + +// laanc 승인 요청 rs +export interface LaancAprvData { + planSno: number; + groupId: string; + cstmrSno: number; + memberName: string; + email: string; + hpno: string; + clncd: string; + schFltStDt: string; + schFltEndDt: string; + fltPurpose: string; + aprvlYn: string; + createUserId: string; + createDt: string; + updateUserId: string; + updateDt: string; + serviceType: string; + areaList: [ + { + planAreaSno: number; + planSno: number; + areaType: string; + fltAreaAddr: string; + bufferZone: number; + fltElev: string; + createUserId: string; + createDt: string; + updateUserId: string; + updateDt: string; + docState: string; + } + ]; +} diff --git a/src/modules/laanc/reducers/laancReducers.ts b/src/modules/laanc/reducers/laancReducers.ts index 4115e96..454ecca 100644 --- a/src/modules/laanc/reducers/laancReducers.ts +++ b/src/modules/laanc/reducers/laancReducers.ts @@ -38,6 +38,12 @@ export const laancReducer = createReducer( const data = action.payload; draft.laancSun = data; }) + ) + .handleAction(Actions.LAANC_APRV_LIST.success, (state, action) => + produce(state, draft => { + const data = action.payload; + draft.laancSearch = data; + }) ); export default laancReducer; diff --git a/src/modules/laanc/sagas/laancSagas.ts b/src/modules/laanc/sagas/laancSagas.ts index 146be10..51de72b 100644 --- a/src/modules/laanc/sagas/laancSagas.ts +++ b/src/modules/laanc/sagas/laancSagas.ts @@ -91,9 +91,30 @@ function* getSunDataSaga( ); } } +// laanc 승인 목록 검색 +function* getAprvListSaga( + action: ActionType +) { + try { + const detail = action.payload; + const res = yield call(Apis.laancApi.getAprvList, detail); + + yield put(Actions.LAANC_APRV_LIST.success(res)); + } catch (error) { + yield put( + MessageActions.IS_ERROR({ + errorCode: ERROR_MESSAGE.code, + errorMessage: ERROR_MESSAGE.message, + isHistoryBack: false, + isRefresh: false + }) + ); + } +} export function* laancSaga() { yield takeEvery(Actions.LAANC_FLIGHT_Approval.request, postApprovalsata); yield takeEvery(Actions.LAANC_FLIGHT_CREATE.request, postCreatesata); yield takeEvery(Actions.LAANC_SUN_DATA.request, getSunDataSaga); + yield takeEvery(Actions.LAANC_APRV_LIST.request, getAprvListSaga); } diff --git a/src/modules/main/dash/models/mainDashModel.ts b/src/modules/main/dash/models/mainDashModel.ts index 5d3ef4c..9d128ea 100644 --- a/src/modules/main/dash/models/mainDashModel.ts +++ b/src/modules/main/dash/models/mainDashModel.ts @@ -35,3 +35,6 @@ export const initMainDash = { groupList: undefined, dronList: undefined }; + +// laanc 승인 목록 검색 +export interface LaancSearch {} diff --git a/src/navigation/laanc/index.js b/src/navigation/laanc/index.js index cdede88..5881a91 100644 --- a/src/navigation/laanc/index.js +++ b/src/navigation/laanc/index.js @@ -9,12 +9,6 @@ export default [ type: 'dropdown', title: 'LAANC 승인 관리', children: [ - { - id: 'flight_plan_001_01_01', - type: 'item', - title: 'LAANC 신청 목록(디자인)', - navLink: '/basis/flight/plan/index' - }, { id: 'laanc_001_01_01', type: 'item',