junh_eee(이준희)
2 years ago
7 changed files with 751 additions and 720 deletions
@ -1,60 +1,60 @@
|
||||
import React, { useEffect, useState } from 'react'; |
||||
import { useDispatch, useSelector } from 'react-redux'; |
||||
import {Col, Row } from 'reactstrap'; |
||||
import { Col, Row } from 'reactstrap'; |
||||
import * as Actions from '../../../../modules/basis/flight/actions/basisFlightAction'; |
||||
import FlightPlanAreaMap from '../../../../components/basis/flight/plan/FlightPlanAreaMap'; |
||||
import { drawTypeChangeAction } from '../../../../modules/control/map/actions/controlMapActions'; |
||||
import FlightPlanAreaDetailContainer from './FlightPlanAreaDetailContainer'; |
||||
|
||||
const FlightPlanAreaContainer = ({handleModal, test}) => { |
||||
const dispatch = useDispatch();
|
||||
const FlightPlanAreaContainer = ({ handleModal, test, isDone }) => { |
||||
const dispatch = useDispatch(); |
||||
|
||||
const { publicAreaList} = useSelector(state => state.flightState); |
||||
const [airArea, setAirArea] = useState(null);
|
||||
const { publicAreaList } = useSelector(state => state.flightState); |
||||
const [airArea, setAirArea] = useState(null); |
||||
|
||||
useEffect(() => { |
||||
dispatch(drawTypeChangeAction('')); |
||||
getAirAreaList(); |
||||
}, []); |
||||
useEffect(() => { |
||||
dispatch(drawTypeChangeAction('')); |
||||
getAirAreaList(); |
||||
}, []); |
||||
|
||||
useEffect(() => { |
||||
setAirArea(publicAreaList); |
||||
}, [publicAreaList]) |
||||
useEffect(() => { |
||||
setAirArea(publicAreaList); |
||||
}, [publicAreaList]); |
||||
|
||||
const getAirAreaList = () => { |
||||
dispatch(Actions.PUBLIC_AREA_LIST.request()); |
||||
}; |
||||
|
||||
const getAirAreaList = () => { |
||||
dispatch(Actions.PUBLIC_AREA_LIST.request()); |
||||
}
|
||||
|
||||
const handleConfirm = (areaList) => { |
||||
if(areaList === undefined) { |
||||
alert('영역을 설정해 주세요.') |
||||
return false; |
||||
}
|
||||
|
||||
dispatch(Actions.AREA_COORDINATE_LIST_SAVE(areaList)) |
||||
const handleConfirm = areaList => { |
||||
if (areaList === undefined) { |
||||
alert('영역을 설정해 주세요.'); |
||||
return false; |
||||
} |
||||
|
||||
return ( |
||||
<Row> |
||||
<Col md={6} lg={6}> |
||||
{airArea != null ? ( |
||||
<FlightPlanAreaMap |
||||
airArea={airArea}
|
||||
handleConfirm={handleConfirm} |
||||
test={test} |
||||
/> |
||||
) : null}
|
||||
</Col> |
||||
<Col md={6} lg={6}> |
||||
<FlightPlanAreaDetailContainer
|
||||
handleModal={handleModal} |
||||
test={test} |
||||
/> |
||||
</Col> |
||||
</Row> |
||||
|
||||
) |
||||
} |
||||
dispatch(Actions.AREA_COORDINATE_LIST_SAVE(areaList)); |
||||
}; |
||||
|
||||
return ( |
||||
<Row> |
||||
<Col md={6} lg={6}> |
||||
{airArea != null ? ( |
||||
<FlightPlanAreaMap |
||||
airArea={airArea} |
||||
handleConfirm={handleConfirm} |
||||
test={test} |
||||
isDone={isDone} |
||||
/> |
||||
) : null} |
||||
</Col> |
||||
<Col md={6} lg={6}> |
||||
<FlightPlanAreaDetailContainer |
||||
handleModal={handleModal} |
||||
test={test} |
||||
isDone={isDone} |
||||
/> |
||||
</Col> |
||||
</Row> |
||||
); |
||||
}; |
||||
|
||||
export default FlightPlanAreaContainer; |
||||
|
Loading…
Reference in new issue