|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
import React, { useEffect, useState, useRef, lazy, Suspense } from 'react'; |
|
|
|
|
import { useEffect, useState, useRef, lazy, Suspense } from 'react'; |
|
|
|
|
import { useLocation } from 'react-router-dom'; |
|
|
|
|
import { useDispatch, useSelector } from '@store/storeConfig/store'; |
|
|
|
|
import Flatpickr from 'react-flatpickr'; |
|
|
|
@ -25,12 +25,12 @@ import {
|
|
|
|
|
Modal, |
|
|
|
|
Popover |
|
|
|
|
} from '@component/ui'; |
|
|
|
|
import { openModal } from '@src/_redux/features/comn/message/messageSlice'; |
|
|
|
|
import { MODAL_BODY, MODAL_HEADER } from '@src/configs/msgConst'; |
|
|
|
|
|
|
|
|
|
const LaancModal = lazy(() => import('../LaancModal')); |
|
|
|
|
const LaancQr = lazy(() => import('../../../components/laanc/LaancQr')); |
|
|
|
|
const FlightArea = lazy(() => import('../map/FlightArea')); |
|
|
|
|
const ErrorModal = lazy(() => import('../../modal/ErrorModal')); |
|
|
|
|
const InfoModal = lazy(() => import('../../modal/InfoModal')); |
|
|
|
|
export default function LaancStep1({ |
|
|
|
|
detailData, |
|
|
|
|
setDetailData, |
|
|
|
@ -72,16 +72,6 @@ export default function LaancStep1({
|
|
|
|
|
const [popoverSchFltEndDt, setPopoverSchFltEndDt] = useState(false); |
|
|
|
|
|
|
|
|
|
// 모달
|
|
|
|
|
const [isErrorModal, setIsErrorModal] = useState({ |
|
|
|
|
isOpen: false, |
|
|
|
|
title: '', |
|
|
|
|
desc: '' |
|
|
|
|
}); |
|
|
|
|
const [isInfoModal, setIsInfoModal] = useState({ |
|
|
|
|
isOpen: false, |
|
|
|
|
title: '', |
|
|
|
|
desc: '' |
|
|
|
|
}); |
|
|
|
|
const [isLaancModal, setIsLaancModal] = useState({ |
|
|
|
|
isOpen: false, |
|
|
|
|
title: '', |
|
|
|
@ -123,20 +113,17 @@ export default function LaancStep1({
|
|
|
|
|
maxElev; |
|
|
|
|
|
|
|
|
|
if (controlledAltitudeExceededWarning) { |
|
|
|
|
setIsErrorModal({ |
|
|
|
|
isOpen: true, |
|
|
|
|
title: '검토 결과 사전안내', |
|
|
|
|
desc: ( |
|
|
|
|
<> |
|
|
|
|
유효성 검사에 실패하여 미 승인 대상입니다. |
|
|
|
|
<br /> |
|
|
|
|
제출하신 비행계획서의 고도는 {laancElev[0]}m이하에서만 비행이 |
|
|
|
|
가능합니다. |
|
|
|
|
<br /> |
|
|
|
|
고도 설정을 다시 확인해주시기 바랍니다. |
|
|
|
|
</> |
|
|
|
|
) |
|
|
|
|
}); |
|
|
|
|
handlerOpenModal( |
|
|
|
|
'검토 결과 사전안내', |
|
|
|
|
<> |
|
|
|
|
유효성 검사에 실패하여 미 승인 대상입니다. |
|
|
|
|
<br /> |
|
|
|
|
제출하신 비행계획서의 고도는 {laancElev[0]}m이하에서만 비행이 |
|
|
|
|
가능합니다. |
|
|
|
|
<br /> |
|
|
|
|
고도 설정을 다시 확인해주시기 바랍니다. |
|
|
|
|
</> |
|
|
|
|
); |
|
|
|
|
handleChange({ |
|
|
|
|
type: 'area', |
|
|
|
|
name: 'fltElev', |
|
|
|
@ -146,6 +133,16 @@ export default function LaancStep1({
|
|
|
|
|
} |
|
|
|
|
}, [[laancElev]]); |
|
|
|
|
|
|
|
|
|
// 단순 메시지 표출 모달
|
|
|
|
|
const handlerOpenModal = (header, body) => { |
|
|
|
|
dispatch( |
|
|
|
|
openModal({ |
|
|
|
|
header: header, |
|
|
|
|
body: body |
|
|
|
|
}) |
|
|
|
|
); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// 비행계획서 작성 핸들러
|
|
|
|
|
const handleChange = ({ name, value, type, index, pIndex }) => { |
|
|
|
|
const arrName = `${type}List`; |
|
|
|
@ -264,124 +261,81 @@ export default function LaancStep1({
|
|
|
|
|
detailData.arcrftList[0].arcrftWghtCd == '11'); |
|
|
|
|
|
|
|
|
|
if (!detailData.fltType) { |
|
|
|
|
setIsErrorModal({ |
|
|
|
|
isOpen: true, |
|
|
|
|
title: '필수값 입력 오류', |
|
|
|
|
desc: '비행 종류(상업/비상업)를 선택해주세요.' |
|
|
|
|
}); |
|
|
|
|
handlerOpenModal( |
|
|
|
|
MODAL_HEADER.valid, |
|
|
|
|
'비행 종류(상업/비상업)를 선택해 주세요.' |
|
|
|
|
); |
|
|
|
|
return false; |
|
|
|
|
} else if ( |
|
|
|
|
!schFltStDt.isAfter(currentDate) || |
|
|
|
|
!schFltEndDt.isAfter(currentDate) |
|
|
|
|
) { |
|
|
|
|
setIsErrorModal({ |
|
|
|
|
isOpen: true, |
|
|
|
|
title: '필수값 입력 오류', |
|
|
|
|
desc: '비행 일자가 이미 지난 일자입니다.' |
|
|
|
|
}); |
|
|
|
|
handlerOpenModal(MODAL_HEADER.valid, '비행 일자가 이미 지난 일자입니다.'); |
|
|
|
|
return false; |
|
|
|
|
} else if (schFltStDt.isAfter(schFltEndDt)) { |
|
|
|
|
setIsErrorModal({ |
|
|
|
|
isOpen: true, |
|
|
|
|
title: '필수값 입력 오류', |
|
|
|
|
desc: '비행일자를 확인해주세요.' |
|
|
|
|
}); |
|
|
|
|
handlerOpenModal(MODAL_HEADER.valid, '비행일자를 확인해 주세요.'); |
|
|
|
|
return false; |
|
|
|
|
} else if (schFltStDt.format('A h:mm') === 'PM 11:00') { |
|
|
|
|
setIsErrorModal({ |
|
|
|
|
setIsLaancModal({ |
|
|
|
|
isOpen: true, |
|
|
|
|
title: '특별 비행', |
|
|
|
|
title: '특별 비행 신청', |
|
|
|
|
desc: ( |
|
|
|
|
<> |
|
|
|
|
야간 비행은 특별 비행에 해당됩니다. |
|
|
|
|
야간 비행 신청의 경우 특별 비행 신청을 진행하셔야 합니다. |
|
|
|
|
<br /> |
|
|
|
|
특별 비행의 경우 드론원스톱을 통해서 신청해주시기 바랍니다. |
|
|
|
|
드론원스톱을 통해서 신청해 주시기 바랍니다. |
|
|
|
|
</> |
|
|
|
|
) |
|
|
|
|
), |
|
|
|
|
type: '드론원스톱 바로가기', |
|
|
|
|
url: 'https://drone.onestop.go.kr/' |
|
|
|
|
}); |
|
|
|
|
return false; |
|
|
|
|
} else if (schFltStDt.format('A h:mm') === 'PM 5:00') { |
|
|
|
|
setIsErrorModal({ |
|
|
|
|
isOpen: true, |
|
|
|
|
title: '비행구역 및 비행일자 중복', |
|
|
|
|
desc: ( |
|
|
|
|
<> |
|
|
|
|
설정하신 비행구역 및 비행시간에 이미 승인완료된 신청건이 있습니다. |
|
|
|
|
<br /> 다시 설정 부탁드립니다. |
|
|
|
|
</> |
|
|
|
|
) |
|
|
|
|
}); |
|
|
|
|
handlerOpenModal( |
|
|
|
|
'비행구역 및 비행일자 중복', |
|
|
|
|
<> |
|
|
|
|
설정하신 비행구역 및 비행시간에 이미 승인완료된 신청건이 있습니다. |
|
|
|
|
<br /> 다시 설정 부탁드립니다. |
|
|
|
|
</> |
|
|
|
|
); |
|
|
|
|
return false; |
|
|
|
|
} else if (!detailData.fltPurpose) { |
|
|
|
|
setIsErrorModal({ |
|
|
|
|
isOpen: true, |
|
|
|
|
title: '필수값 입력 오류', |
|
|
|
|
desc: '비행목적을 선택해 주세요.' |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
handlerOpenModal(MODAL_HEADER.valid, '비행목적을 선택해 주세요.'); |
|
|
|
|
return false; |
|
|
|
|
} else if ( |
|
|
|
|
!detailData.areaList[0].fltElev || |
|
|
|
|
detailData.areaList[0].fltElev === 0 |
|
|
|
|
) { |
|
|
|
|
setIsErrorModal({ |
|
|
|
|
isOpen: true, |
|
|
|
|
title: '필수값 입력 오류', |
|
|
|
|
desc: '고도를 입력해 주세요.' |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
handlerOpenModal(MODAL_HEADER.valid, '고도를 입력해 주세요.'); |
|
|
|
|
return false; |
|
|
|
|
} else if (!detailData.areaList[0].bufferZone) { |
|
|
|
|
setIsErrorModal({ |
|
|
|
|
isOpen: true, |
|
|
|
|
title: '필수값 입력 오류', |
|
|
|
|
desc: '반경을 입력해 주세요.' |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
handlerOpenModal(MODAL_HEADER.valid, '반경을 입력해 주세요.'); |
|
|
|
|
return false; |
|
|
|
|
} else if ( |
|
|
|
|
detailData.areaList[0].concatBufferZone != |
|
|
|
|
detailData.areaList[0].bufferZone && |
|
|
|
|
detailData.areaList[0].areaType === 'LINE' |
|
|
|
|
) { |
|
|
|
|
setIsErrorModal({ |
|
|
|
|
isOpen: true, |
|
|
|
|
title: '필수값 입력 오류', |
|
|
|
|
desc: <>적용 버튼을 누르지 않고 값을 변경 할 수 없습니다.</> |
|
|
|
|
}); |
|
|
|
|
handlerOpenModal( |
|
|
|
|
MODAL_HEADER.valid, |
|
|
|
|
'적용 버튼을 누르지 않고 값을 변경 할 수 없습니다.' |
|
|
|
|
); |
|
|
|
|
} else if (!detailData.areaList[0].fltMethod) { |
|
|
|
|
setIsErrorModal({ |
|
|
|
|
isOpen: true, |
|
|
|
|
title: '필수값 입력 오류', |
|
|
|
|
desc: '비행방식를 입력해 주세요.' |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
handlerOpenModal(MODAL_HEADER.valid, '비행방식을 입력해 주세요.'); |
|
|
|
|
return false; |
|
|
|
|
} else if ( |
|
|
|
|
detailData.areaList[0].fltMethod === '00' && |
|
|
|
|
!detailData.areaList[0].fltMothoeRm |
|
|
|
|
) { |
|
|
|
|
// 비행 방식 직접 입력칸 활성화 후 작성 시 조건문
|
|
|
|
|
setIsErrorModal({ |
|
|
|
|
isOpen: true, |
|
|
|
|
title: '필수값 입력 오류', |
|
|
|
|
desc: '비행방식을 입력해 주세요.' |
|
|
|
|
}); |
|
|
|
|
handlerOpenModal(MODAL_HEADER.valid, '비행방식을 입력해 주세요.'); |
|
|
|
|
return false; |
|
|
|
|
} else if (validateAircraftWeightCode) { |
|
|
|
|
setIsErrorModal({ |
|
|
|
|
isOpen: true, |
|
|
|
|
title: '필수값 입력 오류', |
|
|
|
|
desc: '기체 종류를 입력해 주세요.' |
|
|
|
|
}); |
|
|
|
|
handlerOpenModal(MODAL_HEADER.valid, '기체 종류를 입력해 주세요.'); |
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
|
} else if (validateidntfNumCode) { |
|
|
|
|
setIsErrorModal({ |
|
|
|
|
isOpen: true, |
|
|
|
|
title: '필수값 입력 오류', |
|
|
|
|
desc: '기체 신고 번호를 입력해 주세요.' |
|
|
|
|
}); |
|
|
|
|
handlerOpenModal(MODAL_HEADER.valid, '기체 신고 번호를 입력해 주세요.'); |
|
|
|
|
return false; |
|
|
|
|
} else { |
|
|
|
|
handlerLaanc(); |
|
|
|
@ -407,27 +361,18 @@ export default function LaancStep1({
|
|
|
|
|
detailData.areaList |
|
|
|
|
); |
|
|
|
|
if (elev.data[0] === 0) { |
|
|
|
|
setIsErrorModal({ |
|
|
|
|
title: '비행 불가 지역', |
|
|
|
|
desc: ( |
|
|
|
|
<> |
|
|
|
|
설정하신 비행구역 중 허용고도가 0m인 구역이 있습니다. |
|
|
|
|
<br /> |
|
|
|
|
버퍼존을 다시 확인해주시기 바랍니다. |
|
|
|
|
</> |
|
|
|
|
), |
|
|
|
|
isOpen: true |
|
|
|
|
}); |
|
|
|
|
handlerOpenModal( |
|
|
|
|
'비행 불가 지역', |
|
|
|
|
<> |
|
|
|
|
설정하신 비행구역 중 허용고도가 0m인 구역이 있습니다. |
|
|
|
|
<br /> |
|
|
|
|
버퍼존을 다시 확인해주시기 바랍니다. |
|
|
|
|
</> |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
dispatch(laancAltitudeData.success(elev.data)); |
|
|
|
|
} catch (error) { |
|
|
|
|
{ |
|
|
|
|
setIsErrorModal({ |
|
|
|
|
isOpen: true, |
|
|
|
|
title: '오류', |
|
|
|
|
desc: '처리중 오류가 발생하였습니다' |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
handlerOpenModal(MODAL_HEADER.error, MODAL_BODY.error); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -455,11 +400,10 @@ export default function LaancStep1({
|
|
|
|
|
value: 0 |
|
|
|
|
}); |
|
|
|
|
fltElevRef.current.blur(); |
|
|
|
|
setIsErrorModal({ |
|
|
|
|
isOpen: true, |
|
|
|
|
title: '비행 구역 설정', |
|
|
|
|
desc: '비행 구역 설정을 먼저 설정 해 주세요' |
|
|
|
|
}); |
|
|
|
|
handlerOpenModal( |
|
|
|
|
'비행 구역 설정', |
|
|
|
|
'비행 구역 설정을 먼저 설정 해 주세요.' |
|
|
|
|
); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
@ -497,11 +441,10 @@ export default function LaancStep1({
|
|
|
|
|
// 날짜 선택 핸들러
|
|
|
|
|
const handleOpenFlatpickr = () => { |
|
|
|
|
if (detailData.areaList[0].coordList[0].lat === 0) { |
|
|
|
|
setIsErrorModal({ |
|
|
|
|
isOpen: true, |
|
|
|
|
title: '비행 구역 설정', |
|
|
|
|
desc: '비행 구역 설정을 먼저 설정 해 주세요' |
|
|
|
|
}); |
|
|
|
|
handlerOpenModal( |
|
|
|
|
'비행 구역 설정', |
|
|
|
|
'비행 구역 설정을 먼저 설정 해 주세요.' |
|
|
|
|
); |
|
|
|
|
closeFlatpickr(); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
@ -546,33 +489,27 @@ export default function LaancStep1({
|
|
|
|
|
!laancArea?.duplicated && |
|
|
|
|
parseInt(value.replace('/^0+/', 'm', ''), 10) <= maxElev |
|
|
|
|
) { |
|
|
|
|
setIsErrorModal({ |
|
|
|
|
isOpen: true, |
|
|
|
|
title: '고도 재설정 알림', |
|
|
|
|
desc: ( |
|
|
|
|
<> |
|
|
|
|
관제권 및 비행금지 공역을 제외한 지역에서는 주간에 150m이하 |
|
|
|
|
<br /> |
|
|
|
|
고도에서는 비행승인없이 비행가능합니다. |
|
|
|
|
</> |
|
|
|
|
) |
|
|
|
|
}); |
|
|
|
|
handlerOpenModal( |
|
|
|
|
'고도 재설정 알림', |
|
|
|
|
<> |
|
|
|
|
관제권 및 비행금지 공역을 제외한 지역에서는 주간에 150m이하 |
|
|
|
|
<br /> |
|
|
|
|
고도에서는 비행승인없이 비행가능합니다. |
|
|
|
|
</> |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
if (controlledAltitudeExceededWarning) { |
|
|
|
|
setIsErrorModal({ |
|
|
|
|
isOpen: true, |
|
|
|
|
title: '검토 결과 사전안내', |
|
|
|
|
desc: ( |
|
|
|
|
<> |
|
|
|
|
유효성 검사에 실패하여 미 승인 대상입니다. |
|
|
|
|
<br /> |
|
|
|
|
제출하신 비행계획서의 고도는 {laancElev[0]}m이하에서만 비행이 |
|
|
|
|
가능합니다. |
|
|
|
|
<br /> |
|
|
|
|
고도 설정을 다시 확인해주시기 바랍니다. |
|
|
|
|
</> |
|
|
|
|
) |
|
|
|
|
}); |
|
|
|
|
handlerOpenModal( |
|
|
|
|
'검토 결과 사전안내', |
|
|
|
|
<> |
|
|
|
|
유효성 검사에 실패하여 미 승인 대상입니다. |
|
|
|
|
<br /> |
|
|
|
|
제출하신 비행계획서의 고도는 {laancElev[0]}m이하에서만 비행이 |
|
|
|
|
가능합니다. |
|
|
|
|
<br /> |
|
|
|
|
고도 설정을 다시 확인해주시기 바랍니다. |
|
|
|
|
</> |
|
|
|
|
); |
|
|
|
|
handleChange({ |
|
|
|
|
type: 'area', |
|
|
|
|
name: 'fltElev', |
|
|
|
@ -613,20 +550,17 @@ export default function LaancStep1({
|
|
|
|
|
const maxElev = 150; |
|
|
|
|
|
|
|
|
|
if (laancNotRequired) { |
|
|
|
|
setIsErrorModal({ |
|
|
|
|
isOpen: true, |
|
|
|
|
title: '검토 결과 사전안내', |
|
|
|
|
desc: ( |
|
|
|
|
<> |
|
|
|
|
검토 결과 미 승인 대상입니다. |
|
|
|
|
<p> |
|
|
|
|
제줄하신 비행계획서는 별도의 승인이 필요없습니다. |
|
|
|
|
<br /> |
|
|
|
|
조종자 준수사항에 유의하여 비행하시기 바랍니다. |
|
|
|
|
</p> |
|
|
|
|
</> |
|
|
|
|
) |
|
|
|
|
}); |
|
|
|
|
handlerOpenModal( |
|
|
|
|
'검토 결과 사전안내', |
|
|
|
|
<> |
|
|
|
|
검토 결과 미 승인 대상입니다. |
|
|
|
|
<p> |
|
|
|
|
제줄하신 비행계획서는 별도의 승인이 필요없습니다. |
|
|
|
|
<br /> |
|
|
|
|
조종자 준수사항에 유의하여 비행하시기 바랍니다. |
|
|
|
|
</p> |
|
|
|
|
</> |
|
|
|
|
); |
|
|
|
|
return; |
|
|
|
|
} else if (detailData.areaList[0].fltMethod === '군집비행') { |
|
|
|
|
handleChange({ |
|
|
|
@ -673,11 +607,7 @@ export default function LaancStep1({
|
|
|
|
|
// setIsPopUp(true); 잠시 주석
|
|
|
|
|
return; |
|
|
|
|
} catch (error) { |
|
|
|
|
setIsErrorModal({ |
|
|
|
|
isOpen: true, |
|
|
|
|
title: '오류', |
|
|
|
|
desc: <>처리중 오류가 발생하였습니다</> |
|
|
|
|
}); |
|
|
|
|
handlerOpenModal(MODAL_HEADER.error, MODAL_BODY.error); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1375,8 +1305,6 @@ export default function LaancStep1({
|
|
|
|
|
/> */} |
|
|
|
|
</Modal> |
|
|
|
|
<Suspense fallback=''> |
|
|
|
|
<ErrorModal modal={isErrorModal} setModal={setIsErrorModal} /> |
|
|
|
|
<InfoModal modal={isInfoModal} setModal={setIsInfoModal} /> |
|
|
|
|
<LaancModal modal={isLaancModal} setModal={setIsLaancModal} /> |
|
|
|
|
</Suspense> |
|
|
|
|
</> |
|
|
|
|