diff --git a/src/components/laanc/step/LaancStep1.js b/src/components/laanc/step/LaancStep1.js index 55a1b5a..d731f51 100644 --- a/src/components/laanc/step/LaancStep1.js +++ b/src/components/laanc/step/LaancStep1.js @@ -185,7 +185,7 @@ export default function LaancStep1({ }); } if ( - !laancArea.duplicated && + !laancArea?.duplicated && parseInt(value.replace('/^0+/', 'm', ''), 10) < 150 ) { setIsErrorModal({ @@ -201,7 +201,7 @@ export default function LaancStep1({ }); } if ( - laancArea.duplicated && + laancArea?.duplicated && parseInt(value.replace('/^0+/', 'm', ''), 10) >= laancElev && parseInt(value.replace('/^0+/', 'm', ''), 10) < 150 ) { diff --git a/src/components/laanc/step/LaancStep2.js b/src/components/laanc/step/LaancStep2.js index 468c33b..9becea7 100644 --- a/src/components/laanc/step/LaancStep2.js +++ b/src/components/laanc/step/LaancStep2.js @@ -1,7 +1,7 @@ import React, { useEffect, useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import '@styles/react/libs/flatpickr/flatpickr.scss'; -import { AlertCircle, CheckCircle, AlertTriangle } from 'react-feather'; +import { AlertCircle, CheckCircle } from 'react-feather'; import FlightArea from '../map/FlightArea'; import { Row, @@ -41,10 +41,9 @@ export default function LaancStep2({ }; const [isterms, setIsterms] = useState(false); const [flightData, setFlightData] = useState({}); - const [laancIsCheck, setLancIsCheck] = useState(false); const { user } = useSelector(state => state.authState); - const { laancApply } = useSelector(state => state.laancState); const { termsList } = useSelector(state => state.accountState); + const { laancPdf } = useSelector(state => state.laancState); const dispatch = useDispatch(); useEffect(() => { @@ -57,17 +56,17 @@ export default function LaancStep2({ ); }, []); - useEffect(() => { - if (!laancApply?.valid) setLancIsCheck(true); - else if (laancApply?.valid) setLancIsCheck(false); - }, [laancApply]); - useEffect(() => { if (flightData && Object.keys(flightData).length > 0) { dispatch(LaancAction.LAANC_FLIGHT_CREATE.request(flightData)); - handlerStep(3); } }, [flightData]); + + useEffect(() => { + if (laancPdf && flightData && Object.keys(flightData).length > 0) { + handlerStep(3); + } + }, [laancPdf]); // 소수점 6자리에서 반올림 하는 함수 const truncateToSixDecimalPlaces = number => { const decimalPlaces = 6; @@ -88,52 +87,7 @@ export default function LaancStep2({ ] }); }; - //laanc 문구 정의 함수 - const laancReason = ( - flight, - arcrftDuplicated, - planAreaDuplicatd, - pilotQlfc, - arcrftInsurance - ) => { - if (flight) { - return ( - <> - - 검토 결과 미 승인 대상입니다. - - 제출하신 비행계획상의 비행구역과 비행시간이
- 별도의 승인을 필요로 하지 않습니다.
-
- 아래 조종자 준수사항에 유의하여 비행하시기 바랍니다. -
- - ); - { - /* - 유효성 검사에 실패하였습니다. -
- 다시 검사해주시기 바랍니다. -
*/ - } - } else { - if (arcrftDuplicated || planAreaDuplicatd) { - return ( - <> - - 검토 결과 미 승인 대상입니다. - - 제출하신 비행계획상의 비행구역과 비행시간에
- 이미 다른 드론의 운항이 계획되어 있습니다.
-
- 비행상의 안전을 위해 스텝1 단계에서
- 비행구역 또는 비행시간 변경 후 다시 신청하여 주시기 바랍니다. -
- - ); - } - } - }; + return ( <> @@ -162,7 +116,6 @@ export default function LaancStep2({ - {/* validation은 on 클래스로 제어 */}

@@ -183,7 +136,6 @@ export default function LaancStep2({

- {/* 사전 결과 승인 대상일때 color=success */}
diff --git a/src/containers/laanc/LaancContainer.js b/src/containers/laanc/LaancContainer.js index a476b16..b08cb00 100644 --- a/src/containers/laanc/LaancContainer.js +++ b/src/containers/laanc/LaancContainer.js @@ -43,6 +43,9 @@ export default function LaancContainer() { useEffect(() => { // URL 쿼리 파라미터 중 'map' 값을 가져옵니다. + dispatch(drawTypeChangeAction('')); + dispatch(LaancAction.LAANC_APPROVAL_INIT()); + dispatch(AreaAction.AREA_DETAIL_INIT()); setDisabledAnimation(mapParam != 'true' ? false : true); }, [location]); @@ -92,8 +95,6 @@ export default function LaancContainer() { const handleApply = () => { dispatch(drawTypeChangeAction('')); dispatch(LaancAction.LAANC_APPROVAL_INIT()); - dispatch(LaancAction.LAANC_ALTITUDE_INIT()); - dispatch(LaancAction.LAANC_AREA_INIT()); dispatch(AreaAction.AREA_DETAIL_INIT()); setDisabledAnimation(true); setCurrentParm(true); diff --git a/src/containers/laanc/LaancPlanContainer.js b/src/containers/laanc/LaancPlanContainer.js index 6832e4d..0350a0d 100644 --- a/src/containers/laanc/LaancPlanContainer.js +++ b/src/containers/laanc/LaancPlanContainer.js @@ -4,6 +4,7 @@ import LaancStep2 from '../../components/laanc/step/LaancStep2'; // laanc step 2 import LaancStep3 from '../../components/laanc/step/LaacnStep3'; // laanc step 3 import moment from 'moment'; import { ErrorModal } from '../../components/modal/ErrorModal'; +import { LaancModal } from '../../components/laanc/LaancModal'; import { initFlightBas } from '../../modules/laanc/models/laancModels'; import { Modal } from 'reactstrap'; import { @@ -24,9 +25,7 @@ export default function LaancPlanContainer({ const { areaCoordList } = useSelector(state => state.flightState); const { user } = useSelector(state => state.authState); - const { laancApply, laancArea, laancElev } = useSelector( - state => state.laancState - ); + const { laancArea, laancElev } = useSelector(state => state.laancState); const [isBuffer, setIsBuffer] = useState(false); @@ -40,6 +39,13 @@ export default function LaancPlanContainer({ title: '', desc: '' }); + const [isLaancModal, setIsLaancModal] = useState({ + isOpen: false, + title: '', + desc: '', + type: '', + url: '' + }); useEffect(() => { if (user) { @@ -101,6 +107,24 @@ export default function LaancPlanContainer({ ) }); return; + } else if (detailData.areaList[0].fltMethod === '군집비행') { + handleChange({ + type: 'area', + name: 'fltMethod', + value: '' + }); + setIsLaancModal({ + isOpen: true, + title: '군집 비행 목적', + desc: ( + <> + 군집 비행의 경우 담당자와 협의가 필요합니다.
+ 아래 링크를 통해 담당자와 협의 부탁드립니다. + + ), + type: '처리부서안내 바로가기', + url: 'https://drone.onestop.go.kr/introduce/systemintro3 ' + }); } else if ( parseInt(detailData.areaList[0].fltElev) <= laancElev && parseInt(detailData.areaList[0].fltElev) < 150 @@ -133,10 +157,6 @@ export default function LaancPlanContainer({ } }, [areaCoordList]); - // useEffect(() => { - // console.log(inAirArea, '----inairarea'); - // }, [inAirArea]); - // step 핸들러 const handlerStep = step => { setStep(step); @@ -458,6 +478,7 @@ export default function LaancPlanContainer({ )} +
); diff --git a/src/modules/laanc/actions/laancActions.ts b/src/modules/laanc/actions/laancActions.ts index 18b2612..ff48bb2 100644 --- a/src/modules/laanc/actions/laancActions.ts +++ b/src/modules/laanc/actions/laancActions.ts @@ -55,10 +55,13 @@ const LAANC_VALID_AREA_FAILURE = 'laanc/valid/area/FAILURE'; const INIT_LAANC = 'laanc/init'; // 허뎓 고도 초기화 -const INIT_ALTITUDE = 'laanc/init/altitude'; +// const INIT_ALTITUDE = 'laanc/init/altitude'; // 관제권 초기화 -const INIT_AREA = 'laanc/init/area'; +// const INIT_AREA = 'laanc/init/area'; + +// laanc pdf 초기화 +// const INIT_PDF = 'laanc/init/pdf'; // laanc 비행계획서 승인 export const LAANC_FLIGHT_Approval = createAsyncAction( @@ -71,10 +74,13 @@ export const LAANC_FLIGHT_Approval = createAsyncAction( export const LAANC_APPROVAL_INIT = createAction(INIT_LAANC)(); // 허용고도 초기화 -export const LAANC_ALTITUDE_INIT = createAction(INIT_ALTITUDE)(); +// export const LAANC_ALTITUDE_INIT = createAction(INIT_ALTITUDE)(); // 관제권 초기화 -export const LAANC_AREA_INIT = createAction(INIT_AREA)(); +// export const LAANC_AREA_INIT = createAction(INIT_AREA)(); + +// laanc pdf 초기화 +// export const LAANC_PDF_INIT = createAction(INIT_PDF)(); // laanc 비행계획서 생성 export const LAANC_FLIGHT_CREATE = createAsyncAction( @@ -126,8 +132,6 @@ const actions = { LAANC_APRV_LIST, LAANC_DETAIL, LAANC_ALTITUDE, - LAANC_VALID_AREA, - LAANC_ALTITUDE_INIT, - LAANC_AREA_INIT + LAANC_VALID_AREA }; export type LaancAction = ActionType; diff --git a/src/modules/laanc/reducers/laancReducers.ts b/src/modules/laanc/reducers/laancReducers.ts index f6af5f8..8faf057 100644 --- a/src/modules/laanc/reducers/laancReducers.ts +++ b/src/modules/laanc/reducers/laancReducers.ts @@ -31,6 +31,9 @@ export const laancReducer = createReducer( .handleAction(Actions.LAANC_APPROVAL_INIT, (state, action) => produce(state, draft => { draft.laancApply = undefined; + draft.laancElev = undefined; + draft.laancArea = undefined; + draft.laancPdf = undefined; }) ) .handleAction(Actions.LAANC_SUN_DATA.success, (state, action) => @@ -62,16 +65,21 @@ export const laancReducer = createReducer( const data = action.payload; draft.laancArea = data[0]; }) - ) - .handleAction(Actions.LAANC_ALTITUDE_INIT, (state, action) => - produce(state, draft => { - draft.laancElev = undefined; - }) - ) - .handleAction(Actions.LAANC_AREA_INIT, (state, action) => - produce(state, draft => { - draft.laancArea = undefined; - }) ); +// .handleAction(Actions.LAANC_ALTITUDE_INIT, (state, action) => +// produce(state, draft => { +// draft.laancElev = undefined; +// }) +// ) +// .handleAction(Actions.LAANC_AREA_INIT, (state, action) => +// produce(state, draft => { +// draft.laancArea = undefined; +// }) +// ) +// .handleAction(Actions.LAANC_PDF_INIT, (state, action) => +// produce(state, draft => { +// draft.laancPdf = undefined; +// }) +// ); export default laancReducer;