Browse Source

laanc route 설정

pull/2/head
sanguu516(박상현) 1 year ago
parent
commit
745e46a252
  1. 723
      src/containers/basis/flight/laanc/LaancContainer.js
  2. 259
      src/containers/basis/flight/laanc/LaancPlanContainer.js
  3. 8
      src/navigation/flightPlan/index.js
  4. 4
      src/router/routes/RouteBasis.js
  5. 1
      src/views/laanc/FlightPlan.js
  6. 10
      src/views/laanc/LaancView.js

723
src/containers/basis/flight/laanc/LaancContainer.js

@ -1,233 +1,204 @@
import FlightPlan from '../../../../views/laanc/FlightPlan'; import React, { useEffect, useState } from 'react';
import Apply from '../../../../views/laanc/Apply';
import { useEffect, useState } from 'react';
import moment from 'moment'; import moment from 'moment';
import { WeatherContainer } from '../../../../containers/basis/flight/plan/WeatherContainer'; import { useHistory } from 'react-router-dom';
import { ErrorModal } from '../../../../components/modal/ErrorModal'; import FlightPlanGrid from '../../../../components/basis/flight/plan/FlightPlanGrid';
import { CustomMainLayout } from '../../../../components/layout/CustomMainLayout';
import FlightPlanSearch from '../../../../components/basis/flight/plan/FlightPlanSearch';
import { useDispatch, useSelector, shallowEqual } from 'react-redux';
import * as FlightAction from '../../../../modules/basis/flight/actions/basisFlightAction';
import { Row, Col, Button } from 'reactstrap';
import { import {
initFlight, JOIN_LIST,
initFlightBas GROUP_LIST
} from '../../../../modules/basis/flight/models/basisFlightModel'; } from '../../../../modules/basis/group/actions/basisGroupAction';
import { import FlightPlanGroupGrid from '../../../../components/basis/flight/plan/FlightPlanGroupGrid';
Row, import LaancPlanContainer from '../laanc/LaancPlanContainer';
Col, const initSearchData = {
Button, schFltStDt: moment()
Modal, .set({ date: 1, h: 0, m: 0, s: 0 })
ModalHeader, .format('YYYY-MM-DD HH:mm:ss'),
ModalBody, schFltEndDt: moment()
ModalFooter, .set({ h: 23, m: 59, s: 59 })
Alert, .format('YYYY-MM-DD HH:mm:ss'),
FormGroup, aprvlYn: 'A',
Label, groupId: '',
Input cstmrSno: 0
} from 'reactstrap'; };
// const columns = [{}];
const LaancContainer = () => { const LaancContainer = () => {
const [step, setStep] = useState(1); const dispatch = useDispatch();
const [detailData, setDetailData] = useState(initFlightBas.initDetail); const history = useHistory();
const [formModal, setFormModal] = useState(false); const [open, setOpen] = useState(false);
const [disabledAnimation, setDisabledAnimation] = useState(true); const [searchData, setSerchData] = useState(initSearchData);
const [modal2, setModal2] = useState({ const {
isOpen: false, list: planListData,
title: '', detail: planDetailData,
desc: '' listSelect,
}); // selectGroup,
const [centeredModal, setCenteredModal] = useState(false); areaCoordList,
//날씨 임시 데이터 total
const [wheather, setWheather] = useState([ } = useSelector(state => state.flightState);
{ const { joinList, joinListCount, groupList, groupListCount } = useSelector(
coordList: [ state => state.groupState
{ );
lat: 37.40284040287055, const { user } = useSelector(state => state.authState, shallowEqual);
lon: 126.68639226254697 const [params, setParams] = useState({});
//비행계획서 신청 버튼 활성/비활성 제어
const [isMyGroup, setIsMyGroup] = useState();
// useEffect(() => {
// handlerGroupCancel();
// }, []);
useEffect(() => {
if (user?.cstmrSno) {
if (user.authId === 'SUPER' || user.authId === 'ADMIN') {
dispatch(GROUP_LIST.request({ cstmrSno: user?.cstmrSno }));
} else {
dispatch(
JOIN_LIST.request({
cstmrSno: user?.cstmrSno
})
);
} }
]
} }
]); }, [user]);
// step 핸들러 useEffect(() => {
const handlerStep = step => { if (searchData?.groupId) {
setStep(step); handleSearch(searchData);
};
const handlerLogout = () => { //admin -> myGroupAuthCd
dispatch(Actions.logout.request()); const group = groupList?.find(
}; prev => prev.groupId === listSelect.groupId
);
useEffect(() => {}, [detailData]); const join = joinList?.find(prev => prev.groupId === listSelect.groupId);
// 날씨 핸들러 const obj = {
const handlerWeather = () => { groupAuthCd: join?.groupAuthCd,
setFormModal(!formModal); myGroupAuthCd: group?.myGroupAuthCd
}; };
// 비행계획서 작성 핸들러 //비행계획서 신청 버튼 활성/비활성 제어
const handleChange = ({ name, value, type, index, pIndex }) => { let my = false;
const arrName = `${type}List`; if (user.authId === 'SUPER') {
my = true;
} else if (user.authId === 'ADMIN') {
my = obj?.myGroupAuthCd && true;
} else if (user.authId === 'USER') {
my = obj?.groupAuthCd && true;
}
setIsMyGroup(my);
}
}, [searchData]);
switch (type) { const moveFlightPlanDetailPage = () => {
case 'area': if (planDetailData) {
case 'pilot': dispatch(FlightAction.FLIGHT_PLAN_DETAIL_INIT());
case 'arcrft':
if (name === 'fltElev' || name === 'bufferZone' || name === 'hpno') {
const newValue = value.replace(/[^0-9]/g, '');
setDetailData(prevState => {
const arr = [...prevState[arrName]];
const updateData = {
...prevState[arrName][0],
[name]: newValue
};
arr[0] = updateData;
return {
...prevState,
[arrName]: arr
};
});
} else {
setDetailData(prevState => {
const arr = [...prevState[arrName]];
const updateData = {
...prevState[arrName][0],
[name]: value
};
arr[0] = updateData;
return {
...prevState,
[arrName]: arr
};
});
} }
break; if (areaCoordList) {
case 'plan': dispatch(FlightAction.AREA_DETAIL_INIT());
default:
setDetailData(prevState => ({
...prevState,
[name]: value
}));
break;
} }
history.push('/basis/flight/plan/create');
}; };
console.log('>>>>', detailData); const handleSearch = data => {
// 스텝 1 다음 버튼 이벤트 dispatch(FlightAction.FLIGHT_PLAN_LIST.request({ ...data, page: 1 }));
const handlerNext = () => { };
const reg_email =
/^([0-9a-zA-Z_\.-]+)@([0-9a-zA-Z_-]+)(\.[0-9a-zA-Z_-]+){1,2}$/;
const check_num = /[0-9]/;
const check_kor =
/^[가-힣a-zA-Z0-9][^!@#$%^&*()+\=\[\]{};':"\\|,.<>\/?\s]*$/;
// 시작일자
const schFltStDt = moment(detailData.schFltStDt, 'YYYY-MM-DD HH:mm:ss');
// 종료일자
const schFltEndDt = moment(detailData.schFltEndDt, 'YYYY-MM-DD HH:mm:ss');
const currentDate = moment(); // 현재 날짜와 시간을 가져옵니다.
if (!detailData.pilotList[0].memberName) { const handleChangeSearchData = values => {
setModal2({ setSerchData(prevState => ({
isOpen: true, ...prevState,
title: '필수값 입력 오류', ...values
desc: '이름을 입력해 주세요.' }));
}); };
return false;
} else if (!check_num.test(detailData.pilotList[0].hpno)) {
setModal2({
isOpen: true,
title: '필수값 입력 오류',
desc: '연락처를 확인해 주세요.'
});
return false;
} else if (!reg_email.test(detailData.pilotList[0].email)) {
setModal2({
isOpen: true,
title: '필수값 입력 오류',
desc: '이메일을 확인해 주세요.'
});
return false; const handleGroupSelect = ({
} else if ( groupId,
!schFltStDt.isAfter(currentDate) || groupNm,
!schFltEndDt.isAfter(currentDate) groupAuthCd,
) { myGroupAuthCd
setModal2({ }) => {
isOpen: true, // 권한 상관 없이 모두 조회 가능
title: '필수값 입력 오류', const param = searchData;
desc: '비행 일자가 이미 지난 일자입니다.'
});
return false;
} else if (schFltStDt.isAfter(schFltEndDt)) {
setModal2({
isOpen: true,
title: '필수값 입력 오류',
desc: '비행일자를 확인해주세요.'
});
return false;
} else if (!detailData.fltPurpose) {
setModal2({
isOpen: true,
title: '필수값 입력 오류',
desc: '비행목적을 선택해 주세요.'
});
return false; param.cstmrSno = user.cstmrSno;
} else if (!detailData.areaList[0].fltElev) { param.groupId = groupId;
setModal2({
isOpen: true,
title: '필수값 입력 오류',
desc: '고도를 입력해 주세요.'
});
return false; dispatch(
} else if (!detailData.areaList[0].bufferZone) { // FlightAction.FLIGHT_PLAN_GROUP_SELECT({
setModal2({ FlightAction.FLIGHT_PLAN_LIST_GROUP_SELECT({
isOpen: true, cstmrSno: user.cstmrSno,
title: '필수값 입력 오류', groupId: groupId,
desc: '반경을 입력해 주세요.' groupNm: groupNm
}); })
);
return false; // groupId sessionStorage에 보관 (1 브라우저 1 tab에만 유효)
} else if (!detailData.areaList[0].fltMethod) { sessionStorage.setItem('groupId', groupId);
setModal2({ sessionStorage.setItem('cstmrSno', user.cstmrSno);
isOpen: true,
title: '필수값 입력 오류',
desc: '비행방식를 입력해 주세요.'
});
return false; setSerchData(prevState => {
} else if (!detailData.arcrftList[0].groupNm) { return {
setModal2({ ...prevState,
isOpen: true, cstmrSno: user.cstmrSno,
title: '필수값 입력 오류', groupId: groupId
desc: '기체 신고 번호를 입력해 주세요.' };
}); });
return false; dispatch(FlightAction.FLIGHT_PLAN_LIST.request({ ...param, page: 1 }));
} else if (!detailData.arcrftList[0].arcrftTypeCd) {
setModal2({
isOpen: true,
title: '필수값 입력 오류',
desc: '기체 종류를 입력해 주세요.'
});
return false; //비행계획서 신청 버튼 활성/비활성 제어
} else if (!detailData.arcrftList[0].ownerNm) { let my = false;
setModal2({ if (user.authId === 'SUPER') {
isOpen: true, my = true;
title: '필수값 입력 오류', } else if (user.authId === 'ADMIN') {
desc: '소유자명(법인명)를 입력해 주세요.' if (myGroupAuthCd) {
}); my = true;
}
} else if (user.authId === 'USER') {
if (groupAuthCd) {
my = true;
}
}
setIsMyGroup(my);
};
return false; const handlerGroupCancel = () => {
} else { dispatch(
//api 호출 부분 // FlightAction.FLIGHT_PLAN_GROUP_SELECT({
FlightAction.FLIGHT_PLAN_LIST_GROUP_SELECT({
cstmrSno: 0,
groupId: '',
groupNm: ''
})
);
};
setStep(2); const onChangePage = page => {
} dispatch(FlightAction.FLIGHT_PLAN_LIST.request({ ...searchData, page }));
}; };
return ( return (
<> <CustomMainLayout title={'LAANC 신청 목록'}>
<div className='disabled-animation-modal'> <div className='disabled-animation-modal'>
<Button
color='primary'
className='laanc-pop-btn'
onClick={() => setOpen(!open)}
>
LAANC 신청하기
</Button>
{open ? <LaancPlanContainer open={open} /> : null}
</div>
{/* step-2 */}
{/* <div className='disabled-animation-modal'>
<Button color='primary' className='laanc-pop-btn' onClick={() => setDisabledAnimation(!disabledAnimation)}>
LAANC 신청하기
</Button>
<Modal <Modal
isOpen={disabledAnimation} isOpen={disabledAnimation}
toggle={() => setDisabledAnimation(!disabledAnimation)} toggle={() => setDisabledAnimation(!disabledAnimation)}
@ -235,25 +206,351 @@ const LaancContainer = () => {
fade={false} fade={false}
backdrop={false} backdrop={false}
> >
{step === 1 && ( <ModalHeader>LAANC 승인 요청<Button color='danger' onClick={() => setDisabledAnimation(!disabledAnimation)}>취소</Button></ModalHeader>
<ModalBody>
<div className='mb-1'>
<div className='ti'>비행승인 사전결과 확인</div>
<div className='laanc-map-sm'>
지도영역
</div>
<div className='mt-1'>
<Alert color='danger'>
<div className='alert-body'>
<AlertCircle size={15} />{' '}
<span className='ms-1'>
사전 결과 승인 대상입니다.
</span>
</div>
</Alert>
</div>
<div className='vertically-centered-modal'>
<Modal isOpen={centeredModal} toggle={() => setCenteredModal(!centeredModal)} className='modal-dialog-centered modal-xl'>
<ModalHeader toggle={() => setCenteredModal(!centeredModal)}>비행 구역 설정</ModalHeader>
<ModalBody>
지도영역 지도 height 정해주기
</ModalBody>
<ModalFooter>
<div className='laanc-map-btn'>
<div className='laanc-point'>
<Button color='primary'>버튼1</Button>
<Button color='primary'>버튼2</Button>
<Button color='primary'>버튼3</Button>
<Button color='primary'>버튼4</Button>
</div>
<div>
<Button color='primary' onClick={() => setCenteredModal(!centeredModal)}>
닫기
</Button>
</div>
</div>
</ModalFooter>
</Modal>
</div>
</div>
<div>
<Row>
<Col className='list-input' md='6' sm='12'>
<FormGroup>
<div className='ti'>조종사 정보</div>
<Label for='test'><span className='necessary'>*</span></Label>
<Input type='text' id='test' size='sm' placeholder='' value='홍길동' disabled/>
</FormGroup>
</Col>
<Col className='list-input' md='6' sm='12'>
<FormGroup>
<div className='ti'>승인 유형</div>
<Label for='test'><span className='necessary'>*</span></Label>
<Input type='select' name='select' size='sm' id='test' disabled>
<option>무인 비행기</option>
<option>무인 헬리콥터</option>
<option>무인 멀티콥터</option>
<option>무인 비행선</option>
</Input>
</FormGroup>
</Col>
<Col className='list-input' md='12'>
<div className='ti'>비행 계획 정보</div>
<Row>
<Col className='list-input' md='6'>
<FormGroup>
<Label for='test'><span className='necessary'>*</span> </Label>
<Input type='text' id='test' size='sm' placeholder='' disabled/>
</FormGroup>
</Col>
<Col className='list-input' md='6'>
<FormGroup>
<Label for='test'><span className='necessary'>*</span> </Label>
<Input type='text' id='test' size='sm' placeholder='' disabled/>
</FormGroup>
</Col>
</Row>
</Col>
<Col className='list-input' md='12'>
<div className='ti'>기체 정보</div>
<Row>
<Col className='list-input' md='12'>
<FormGroup>
<Label for='test'><span className='necessary'>*</span> </Label>
<Input type='text' id='test' size='sm' placeholder='' disabled/>
</FormGroup>
</Col>
</Row>
</Col>
<Col className='list-input' md='12'>
<div className='ti'> 승인 사유</div>
<div className='cancel-box'>
내용
</div>
</Col>
</Row>
</div>
</ModalBody>
<ModalFooter>
<Button outline color='danger' onClick={() => setDisabledAnimation(!disabledAnimation)}>
이전
</Button>
<ul className='step'>
<li><span></span></li>
<li><span className='on'></span></li>
<li><span></span></li>
</ul>
<Button outline onClick={() => setDisabledAnimation(!disabledAnimation)}>
다음
</Button>
</ModalFooter>
</Modal>
</div> */}
{/* step-2 2번째 */}
{/* <div className='disabled-animation-modal'>
<Button color='primary' className='laanc-pop-btn' onClick={() => setDisabledAnimation(!disabledAnimation)}>
LAANC 신청하기
</Button> */}
{/* <Modal
isOpen={disabledAnimation}
toggle={() => setDisabledAnimation(!disabledAnimation)}
className='modal-dialog-centered laanc-modal'
fade={false}
backdrop={false}
>
<ModalHeader>LAANC 승인 요청<Button color='danger' onClick={() => setDisabledAnimation(!disabledAnimation)}>취소</Button></ModalHeader>
<ModalBody>
<div>
<div className='ti'>유효성 검사 정보</div>
<Row>
<Col className='list-input' md='6'>
<Alert color='warning'>
<div className='alert-body'>
<AlertCircle size={15} />{' '}
<span className='ms-1'>
조종자 자격 정보
</span>
</div>
</Alert>
</Col>
<Col className='list-input' md='6'>
<Alert color='success'>
<div className='alert-body'>
<CheckCircle size={15} />{' '}
<span className='ms-1'>
기체보험가입 정보
</span>
</div>
</Alert>
</Col>
</Row>
</div>
<div className='mb-1'>
<div className='ti'>비행승인 사전결과 확인</div>
<div className='laanc-map-sm'>
지도영역
</div>
<div className='mt-1'>
<Alert color='success'>
<div className='alert-body'>
<CheckCircle size={15} />{' '}
<span className='ms-1'>
사전 결과 승인 대상입니다.
</span>
</div>
</Alert>
</div>
<div className='vertically-centered-modal'>
<Modal isOpen={centeredModal} toggle={() => setCenteredModal(!centeredModal)} className='modal-dialog-centered modal-xl'>
<ModalHeader toggle={() => setCenteredModal(!centeredModal)}>비행 구역 설정</ModalHeader>
<ModalBody>
지도영역 지도 height 정해주기
</ModalBody>
<ModalFooter>
<div className='laanc-map-btn'>
<div className='laanc-point'>
<Button color='primary'>버튼1</Button>
<Button color='primary'>버튼2</Button>
<Button color='primary'>버튼3</Button>
<Button color='primary'>버튼4</Button>
</div>
<div>
<Button color='primary' onClick={() => setCenteredModal(!centeredModal)}>
닫기
</Button>
</div>
</div>
</ModalFooter>
</Modal>
</div>
</div>
<div>
<Row>
<Col className='list-input' md='6'>
<FormGroup>
<div className='ti'>조종사 정보</div>
<Label for='test'><span className='necessary'>*</span></Label>
<Input type='text' id='test' size='sm' placeholder='' value='홍길동' disabled/>
</FormGroup>
</Col>
<Col className='list-input' md='6'>
<FormGroup>
<div className='ti'>승인 유형</div>
<Label for='test'><span className='necessary'>*</span></Label>
<Input type='select' name='select' size='sm' id='test' disabled>
<option>무인 비행기</option>
<option>무인 헬리콥터</option>
<option>무인 멀티콥터</option>
<option>무인 비행선</option>
</Input>
</FormGroup>
</Col>
<Col className='list-input' md='12'>
<div className='ti'>비행 계획 정보</div>
<Row>
<Col className='list-input' md='6'>
<FormGroup>
<Label for='test'><span className='necessary'>*</span> </Label>
<Input type='text' id='test' size='sm' placeholder='' disabled/>
</FormGroup>
</Col>
<Col className='list-input' md='6'>
<FormGroup>
<Label for='test'><span className='necessary'>*</span> </Label>
<Input type='text' id='test' size='sm' placeholder='' disabled/>
</FormGroup>
</Col>
</Row>
</Col>
<Col className='list-input' md='12'>
<div className='ti'>기체 정보</div>
<Row>
<Col className='list-input' md='12'>
<FormGroup>
<Label for='test'><span className='necessary'>*</span> </Label>
<Input type='text' id='test' size='sm' placeholder='' disabled/>
</FormGroup>
</Col>
</Row>
</Col>
<Col className='list-input' md='12'>
<div className='ti'>조종자 준수사항 처벌 동의 약관</div>
<div className='terms-box'>
<p>
이것은 봄날의 소리다.이것은 타오르고 못할 천고에 놀이 위하여 뿐이다. 꾸며 크고 인간에 끝까지 인간은 뿐이다. 예가 꽃이 이것이야말로 것이다. 노래하며 가진 일월과 찬미를 인도하겠다는 목숨이 있는가? 아름답고 보배를 찾아 얼음 것이다. 주는 끓는 같이, 눈이 피부가 따뜻한 이것이다. 그들은 역사를 따뜻한 굳세게 커다란 소담스러운 이것이야말로 크고 황금시대다. 앞이 용감하고 인간의 못할 동력은 투명하되 트고, 것이다. 같으며, 우리 생생하며, 부패를 이상은 길지 피다. 심장은 트고, 두기 청춘 그들을 품었기 이성은 밥을 천지는 것이다. 불어 싸인 소담스러운 쓸쓸하랴?
인간의 거선의 원대하고, 끓는 봄바람이다. 있는 물방아 인도하겠다는 칼이다. 가치를 가지에 얼마나 이상 이것이다. 대중을 노년에게서 온갖 청춘의 미묘한 그들에게 굳세게 그들은 불러 말이다. 구하기 그들의 내려온 이것이다. 전인 예가 속에서 것이다. 천지는 있음으로써 과실이 속잎나고, 불어 피어나는 별과 아니다. 인류의 얼마나 뜨거운지라, 그들은 되는 놀이 미묘한 이상은 있다. 바로 꽃이 없는 그들을 이상은 고행을 군영과 위하여, 목숨이 칼이다.
무엇을 되는 생의 평화스러운 피가 할지니, 이상의 봄바람이다. 커다란 피가 찾아다녀도, 별과 있는 심장의 낙원을 위하여서. 생의 기관과 피어나기 역사를 오직 청춘을 그들을 그들의 쓸쓸하랴? 위하여 그러므로 그들의 인생에 끓는다. 장식하는 못할 무엇을 그리하였는가? 인류의 못하다 가치를 있을 있다. 거선의 풍부하게 위하여서, 피고, 만천하의 보이는 그들의 것이다. 밥을 못하다 간에 불어 그와 꽃이 쓸쓸하랴? 가슴에 실현에 끝에 피가 피부가 부패뿐이다. 풀이 없으면, 하였으며, 따뜻한 때에, 교향악이다.
하였으며, 뜨고, 있는 그들은 그들은 품고 청춘이 보이는 동산에는 아니다. 바이며, 거선의 인간의 노년에게서 희망의 미묘한 안고, 봄날의 것이 칼이다. 원질이 것은 이상이 할지라도 이것을 위하여서, 청춘을 아니다. 가장 그들의 이상을 우리의 심장은 우리는 듣기만 용감하고 말이다. 너의 풀밭에 그것은 피는 피가 보라. 실로 따뜻한 풀밭에 약동하다. 예가 살았으며, 것이다.보라, 길을 보내는 약동하다. 따뜻한 하여도 싹이 아니다. 못할 못하다 날카로우나 피가 끓는다. 인도하겠다는 이상의 창공에 지혜는 우리의 충분히 위하여서 것이다.
별과 것은 것은 가치를 낙원을 있으며, 위하여 사막이다. 열락의 무엇이 피어나기 이상의 그들은 얼마나 인생에 끓는다. 석가는 보배를 꾸며 영락과 안고, 구할 이상 현저하게 피고 피다. 그들은 스며들어 위하여 끝에 하였으며, 힘차게 대중을 황금시대다. 일월과 바로 우리는 인생을 내는 청춘의 열락의 보라. 이것을 구할 많이 인생에 있으랴? 구하기 이상 무엇을 주며, 내려온 그들의 가치를 청춘의 못하다 부패뿐이다. 풀이 봄바람을 이상은 인생의 트고, 속에 싹이 것은 약동하다. 하는 얼음과 군영과 너의 밥을 철환하였는가? 사는가 할지라도 관현악이며, 없는 피고, 이것이다.
구하지 피가 우리의 우리 철환하였는가? 찾아다녀도, 그와 품었기 되려니와, 더운지라 커다란 거친 스며들어 거선의 칼이다. 같이 청춘을 그들에게 공자는 봄바람이다. 모래뿐일 내려온 피가 때까지 오아이스도 그들에게 끓는 지혜는 때문이다. 때까지 군영과 같은 기관과 구하지 끝에 부패뿐이다. 같이, 열락의 그와 못하다 인간의 현저하게 구하지 것이다. 우리는 무엇을 소리다.이것은 피어나는 천지는 되려니와, 커다란 청춘 피다. 위하여 인생을 가진 피다. 얼마나 같이 봄날의 눈에 낙원을 타오르고 목숨이 이상은 것은 것이다. 그들은 심장은 얼음과 철환하였는가? 목숨을 고동을 열매를 것이다.
보배를 같은 피에 미묘한 얼마나 찾아 말이다. 가장 어디 위하여서, 천하를 않는 보라. 작고 불어 긴지라 놀이 목숨을 인생에 예수는 그들의 싹이 것이다. 위하여 맺어, 긴지라 사막이다. 내는 못할 것은 있는 그들은 이것이다. 같이 풍부하게 얼마나 바로 품으며, 사는가 만천하의 우리의 것이다. 거선의 청춘의 품으며, 없는 그들은 일월과 않는 있으랴? 위하여 인도하겠다는 얼음 아름다우냐? 하는 청춘의 가지에 위하여, 더운지라 만물은 이것이야말로 거선의 아니다. 않는 인생에 소금이라 관현악이며, 목숨이 것이다. 천하를 얼마나 가진 물방아 이상, 하여도 힘있다.
열락의 얼음이 피고 대한 그들의 맺어, 대중을 그리하였는가? 타오르고 생의 그들의 무엇을 작고 것이 바로 위하여서, 위하여서. 있는 못할 웅대한 현저하게 노래하며 앞이 평화스러운 같이, 운다. 산야에 원대하고, 구할 스며들어 사막이다. 이상 눈에 힘차게 들어 같은 맺어, 반짝이는 이것이다. 인생에 피어나기 유소년에게서 용감하고 무엇을 대한 보내는 인생에 있으랴? 열락의 고동을 그들의 듣는다. 대중을 꽃이 같은 그들을 무엇을 천자만홍이 관현악이며, 봄바람이다. 가슴에 이상의 없으면, 남는 끝까지 그들에게 사랑의 피어나기 것이다. 붙잡아 있으며, 청춘의 우리 인간에 사람은 못할 관현악이며, 청춘 것이다. 힘차게 얼마나 아름답고 주는 없는 능히 이것이다.
</p>
</div>
<CustomInput
inline
type='checkbox'
className='terms-check'
id='exampleCustomCheckbox'
label='조종자 준수사항 미 준수 시 처벌에 동의합니다.'
defaultChecked
/>
</Col>
</Row>
</div>
</ModalBody>
<ModalFooter>
<Button outline color='danger' onClick={() => setDisabledAnimation(!disabledAnimation)}>
이전
</Button>
<ul className='step'>
<li><span></span></li>
<li><span className='on'></span></li>
<li><span></span></li>
</ul>
<Button outline onClick={() => setDisabledAnimation(!disabledAnimation)}>
다음
</Button>
</ModalFooter>
</Modal> */}
{/* </div> */}
<div className='pal-card-box'>
<Row>
{/* <Col sm='12' lg='12'>
{user ? (
<> <>
<FlightPlan <FlightPlanGroupGrid
// handlerStep={handlerStep} {...(user?.authId === 'SUPER' || user?.authId === 'ADMIN'
data={detailData} ? { data: groupList }
handleChange={handleChange} : { data: joinList })}
handlerNext={handlerNext} {...(user?.authId === 'SUPER' || user?.authId === 'ADMIN'
handlerWeather={handlerWeather} ? { count: groupListCount }
setDisabledAnimation={setDisabledAnimation} : { count: joinListCount })}
disabledAnimation={disabledAnimation} // selectGroup={selectGroup}
selectGroup={listSelect}
handleGroupSelect={handleGroupSelect}
handlerGroupCancel={handlerGroupCancel}
pagination={true}
paginationRowsPerPageOptions={[5, 10, 15, 20]}
/> />
</> </>
) : (
<></>
)} )}
</Col> */}
{step === 2 && <Apply handlerStep={handlerStep} data={detailData} />} <Col sm='12' lg='12'>
</Modal> {/* {selectGroup.cstmrSno !== 0 ? ( */}
<ErrorModal modal={modal2} setModal={setModal2} /> {listSelect.cstmrSno !== 0 ? (
</div> <>
<FlightPlanSearch
searchData={searchData}
handleChangeSearchData={handleChangeSearchData}
handleSearch={handleSearch}
/>
<FlightPlanGrid
movePage={moveFlightPlanDetailPage}
planListData={planListData}
pagination={true}
paginationPerPage={10}
paginationRowsPerPageOptions={[10, 20, 30, 40]}
isMyGroup={isMyGroup}
user={user}
total={total}
handlerPageChange={onChangePage}
/>
</> </>
) : (
<div className='mt-2 no-dataTable'>
그룹 목록에서 상세보기를 클릭하세요.
</div>
)}
</Col>
</Row>
</div>
</CustomMainLayout>
); );
}; };
export default LaancContainer; export default LaancContainer;

259
src/containers/basis/flight/laanc/LaancPlanContainer.js

@ -0,0 +1,259 @@
import FlightPlan from '../../../../views/laanc/FlightPlan';
import Apply from '../../../../views/laanc/Apply';
import { useEffect, useState } from 'react';
import moment from 'moment';
import { WeatherContainer } from '../plan/WeatherContainer';
import { ErrorModal } from '../../../../components/modal/ErrorModal';
import {
initFlight,
initFlightBas
} from '../../../../modules/basis/flight/models/basisFlightModel';
import {
Row,
Col,
Button,
Modal,
ModalHeader,
ModalBody,
ModalFooter,
Alert,
FormGroup,
Label,
Input
} from 'reactstrap';
const LaancPlanContainer = () => {
const [step, setStep] = useState(1);
const [detailData, setDetailData] = useState(initFlightBas.initDetail);
const [formModal, setFormModal] = useState(false);
const [disabledAnimation, setDisabledAnimation] = useState(true);
const [modal2, setModal2] = useState({
isOpen: false,
title: '',
desc: ''
});
const [centeredModal, setCenteredModal] = useState(false);
//날씨 임시 데이터
const [wheather, setWheather] = useState([
{
coordList: [
{
lat: 37.40284040287055,
lon: 126.68639226254697
}
]
}
]);
// step 핸들러
const handlerStep = step => {
setStep(step);
};
const handlerLogout = () => {
dispatch(Actions.logout.request());
};
useEffect(() => {}, [detailData]);
// 날씨 핸들러
const handlerWeather = () => {
setFormModal(!formModal);
};
// 비행계획서 작성 핸들러
const handleChange = ({ name, value, type, index, pIndex }) => {
const arrName = `${type}List`;
switch (type) {
case 'area':
case 'pilot':
case 'arcrft':
if (name === 'fltElev' || name === 'bufferZone' || name === 'hpno') {
const newValue = value.replace(/[^0-9]/g, '');
setDetailData(prevState => {
const arr = [...prevState[arrName]];
const updateData = {
...prevState[arrName][0],
[name]: newValue
};
arr[0] = updateData;
return {
...prevState,
[arrName]: arr
};
});
} else {
setDetailData(prevState => {
const arr = [...prevState[arrName]];
const updateData = {
...prevState[arrName][0],
[name]: value
};
arr[0] = updateData;
return {
...prevState,
[arrName]: arr
};
});
}
break;
case 'plan':
default:
setDetailData(prevState => ({
...prevState,
[name]: value
}));
break;
}
};
console.log('>>>>', detailData);
// 스텝 1 다음 버튼 이벤트
const handlerNext = () => {
const reg_email =
/^([0-9a-zA-Z_\.-]+)@([0-9a-zA-Z_-]+)(\.[0-9a-zA-Z_-]+){1,2}$/;
const check_num = /[0-9]/;
const check_kor =
/^[가-힣a-zA-Z0-9][^!@#$%^&*()+\=\[\]{};':"\\|,.<>\/?\s]*$/;
// 시작일자
const schFltStDt = moment(detailData.schFltStDt, 'YYYY-MM-DD HH:mm:ss');
// 종료일자
const schFltEndDt = moment(detailData.schFltEndDt, 'YYYY-MM-DD HH:mm:ss');
const currentDate = moment(); // 현재 날짜와 시간을 가져옵니다.
if (!detailData.pilotList[0].memberName) {
setModal2({
isOpen: true,
title: '필수값 입력 오류',
desc: '이름을 입력해 주세요.'
});
return false;
} else if (!check_num.test(detailData.pilotList[0].hpno)) {
setModal2({
isOpen: true,
title: '필수값 입력 오류',
desc: '연락처를 확인해 주세요.'
});
return false;
} else if (!reg_email.test(detailData.pilotList[0].email)) {
setModal2({
isOpen: true,
title: '필수값 입력 오류',
desc: '이메일을 확인해 주세요.'
});
return false;
} else if (
!schFltStDt.isAfter(currentDate) ||
!schFltEndDt.isAfter(currentDate)
) {
setModal2({
isOpen: true,
title: '필수값 입력 오류',
desc: '비행 일자가 이미 지난 일자입니다.'
});
return false;
} else if (schFltStDt.isAfter(schFltEndDt)) {
setModal2({
isOpen: true,
title: '필수값 입력 오류',
desc: '비행일자를 확인해주세요.'
});
return false;
} else if (!detailData.fltPurpose) {
setModal2({
isOpen: true,
title: '필수값 입력 오류',
desc: '비행목적을 선택해 주세요.'
});
return false;
} else if (!detailData.areaList[0].fltElev) {
setModal2({
isOpen: true,
title: '필수값 입력 오류',
desc: '고도를 입력해 주세요.'
});
return false;
} else if (!detailData.areaList[0].bufferZone) {
setModal2({
isOpen: true,
title: '필수값 입력 오류',
desc: '반경을 입력해 주세요.'
});
return false;
} else if (!detailData.areaList[0].fltMethod) {
setModal2({
isOpen: true,
title: '필수값 입력 오류',
desc: '비행방식를 입력해 주세요.'
});
return false;
} else if (!detailData.arcrftList[0].groupNm) {
setModal2({
isOpen: true,
title: '필수값 입력 오류',
desc: '기체 신고 번호를 입력해 주세요.'
});
return false;
} else if (!detailData.arcrftList[0].arcrftTypeCd) {
setModal2({
isOpen: true,
title: '필수값 입력 오류',
desc: '기체 종류를 입력해 주세요.'
});
return false;
} else if (!detailData.arcrftList[0].ownerNm) {
setModal2({
isOpen: true,
title: '필수값 입력 오류',
desc: '소유자명(법인명)를 입력해 주세요.'
});
return false;
} else {
//api 호출 부분
setStep(2);
}
};
return (
<>
<div className='disabled-animation-modal'>
<Modal
isOpen={disabledAnimation}
toggle={() => setDisabledAnimation(!disabledAnimation)}
className='modal-dialog-centered laanc-modal'
fade={false}
backdrop={false}
>
{step === 1 && (
<>
<FlightPlan
// handlerStep={handlerStep}
data={detailData}
handleChange={handleChange}
handlerNext={handlerNext}
handlerWeather={handlerWeather}
setDisabledAnimation={setDisabledAnimation}
disabledAnimation={disabledAnimation}
/>
</>
)}
{step === 2 && <Apply handlerStep={handlerStep} data={detailData} />}
</Modal>
<ErrorModal modal={modal2} setModal={setModal2} />
</div>
</>
);
};
export default LaancPlanContainer;

8
src/navigation/flightPlan/index.js

@ -12,8 +12,14 @@ export default [
{ {
id: 'flight_plan_001_01_01', id: 'flight_plan_001_01_01',
type: 'item', type: 'item',
title: 'LAANC 신청 목록', title: 'LAANC 신청 목록(디자인)',
navLink: '/basis/flight/plan/index' navLink: '/basis/flight/plan/index'
},
{
id: 'flight_plan_001_01_01',
type: 'item',
title: 'LAANC 신청 목록',
navLink: '/basis/laanc/plan/index'
} }
// , // ,
// { // {

4
src/router/routes/RouteBasis.js

@ -43,6 +43,10 @@ const RouteBasis = [
path: '/basis/flight/plan/index', path: '/basis/flight/plan/index',
component: lazy(() => import('../../views/basis/flight/plan/FlightPlan')) component: lazy(() => import('../../views/basis/flight/plan/FlightPlan'))
}, },
{
path: '/basis/laanc/plan/index',
component: lazy(() => import('../../views/laanc/LaancView'))
},
{ {
path: '/basis/flight/plan/create', path: '/basis/flight/plan/create',
component: lazy(() => component: lazy(() =>

1
src/views/laanc/FlightPlan.js

@ -276,7 +276,6 @@ const FlightPlan = ({
value value
}); });
}} }}
// innerRef={data}
placeholder='' placeholder=''
> >
<option value=''>= 선택 =</option> <option value=''>= 선택 =</option>

10
src/views/laanc/LaancView.js

@ -0,0 +1,10 @@
import '@styles/react/libs/flatpickr/flatpickr.scss';
import '@styles/react/libs/tables/react-dataTable-component.scss';
import React from 'react';
import LaancContainer from '../../containers/basis/flight/laanc/LaancContainer';
const LaancView = props => {
return <LaancContainer />;
};
export default LaancView;
Loading…
Cancel
Save