Browse Source

LAANC 날씨 임시 데이터로 기능 추가

pull/2/head
sanguu516(박상현) 1 year ago
parent
commit
62ee57f43a
  1. 6
      src/views/laanc/FlightPlan.js
  2. 42
      src/views/laanc/LeftMenu.js

6
src/views/laanc/FlightPlan.js

@ -33,7 +33,7 @@ import {
sensorClickAction sensorClickAction
} from '../../modules/control/map/actions/controlMapActions'; } from '../../modules/control/map/actions/controlMapActions';
import { useHistory } from 'react-router-dom'; import { useHistory } from 'react-router-dom';
const FlightPlan = ({ handleChange, handlerNext, data }) => { const FlightPlan = ({ handleChange, handlerNext, data, handlerWeather }) => {
const user = useSelector(state => state.authState); const user = useSelector(state => state.authState);
const history = useHistory(); const history = useHistory();
@ -97,7 +97,9 @@ const FlightPlan = ({ handleChange, handlerNext, data }) => {
> >
Polygon Polygon
</Button.Ripple> </Button.Ripple>
<Button.Ripple color='info'>날씨 정보</Button.Ripple> <Button.Ripple color='info' onClick={handlerWeather}>
날씨 정보
</Button.Ripple>
</div> </div>
</dt> </dt>
<div className='search-info-ti d-flex justify-content-between'> <div className='search-info-ti d-flex justify-content-between'>

42
src/views/laanc/LeftMenu.js

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

Loading…
Cancel
Save