|
|
|
@ -12,15 +12,31 @@ import {
|
|
|
|
|
initFlight, |
|
|
|
|
initFlightBas |
|
|
|
|
} from '../../modules/basis/flight/models/basisFlightModel'; |
|
|
|
|
import { WeatherContainer } from '../../containers/basis/flight/plan/WeatherContainer'; |
|
|
|
|
import { Button, Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap'; |
|
|
|
|
function LeftMenu() { |
|
|
|
|
const [step, setStep] = useState(1); |
|
|
|
|
const [detailData, setDetailData] = useState(initFlightBas.initDetail); |
|
|
|
|
const [formModal, setFormModal] = useState(false); |
|
|
|
|
const [modal2, setModal2] = useState({ |
|
|
|
|
isOpen: false, |
|
|
|
|
title: '', |
|
|
|
|
desc: '' |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
//날씨 임시 데이터
|
|
|
|
|
const [wheather, setWheather] = useState([ |
|
|
|
|
{ |
|
|
|
|
coordList: [ |
|
|
|
|
{ |
|
|
|
|
lat: 37.40284040287055, |
|
|
|
|
lon: 126.68639226254697 |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
]); |
|
|
|
|
|
|
|
|
|
// step 핸들러
|
|
|
|
|
const handlerStep = step => { |
|
|
|
|
setStep(step); |
|
|
|
|
}; |
|
|
|
@ -30,9 +46,14 @@ function LeftMenu() {
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
useEffect(() => {}, [detailData]); |
|
|
|
|
const handleChange = ({ name, value, type, index, pIndex }) => { |
|
|
|
|
// 입력 값에서 숫자 이외의 문자를 제거
|
|
|
|
|
|
|
|
|
|
// 날씨 핸들러
|
|
|
|
|
const handlerWeather = () => { |
|
|
|
|
setFormModal(!formModal); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// 비행계획서 작성 핸들러
|
|
|
|
|
const handleChange = ({ name, value, type, index, pIndex }) => { |
|
|
|
|
const arrName = `${type}List`; |
|
|
|
|
|
|
|
|
|
switch (type) { |
|
|
|
@ -78,6 +99,7 @@ function LeftMenu() {
|
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// 스텝 1 다음 버튼 이벤트
|
|
|
|
|
const handlerNext = () => { |
|
|
|
|
const reg_email = |
|
|
|
|
/^([0-9a-zA-Z_\.-]+)@([0-9a-zA-Z_-]+)(\.[0-9a-zA-Z_-]+){1,2}$/; |
|
|
|
@ -200,11 +222,27 @@ function LeftMenu() {
|
|
|
|
|
data={detailData} |
|
|
|
|
handleChange={handleChange} |
|
|
|
|
handlerNext={handlerNext} |
|
|
|
|
handlerWeather={handlerWeather} |
|
|
|
|
/> |
|
|
|
|
)} |
|
|
|
|
{step === 2 && <Apply handlerStep={handlerStep} />} |
|
|
|
|
</div> |
|
|
|
|
<ErrorModal modal={modal2} setModal={setModal2} /> |
|
|
|
|
<Modal |
|
|
|
|
isOpen={formModal} |
|
|
|
|
toggle={handlerWeather} |
|
|
|
|
className='modal-dialog-centered' |
|
|
|
|
> |
|
|
|
|
<ModalHeader toggle={handlerWeather}>날씨 정보</ModalHeader> |
|
|
|
|
<ModalBody> |
|
|
|
|
<WeatherContainer mapAreaCoordList={wheather} /> |
|
|
|
|
</ModalBody> |
|
|
|
|
<ModalFooter> |
|
|
|
|
<Button color='primary' onClick={handlerWeather}> |
|
|
|
|
확인 |
|
|
|
|
</Button> |
|
|
|
|
</ModalFooter> |
|
|
|
|
</Modal> |
|
|
|
|
</div> |
|
|
|
|
</> |
|
|
|
|
); |
|
|
|
|