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 React, { useEffect, useState } from 'react'; |
||||||
import { useDispatch, useSelector } from 'react-redux'; |
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 * as Actions from '../../../../modules/basis/flight/actions/basisFlightAction'; |
||||||
import FlightPlanAreaMap from '../../../../components/basis/flight/plan/FlightPlanAreaMap'; |
import FlightPlanAreaMap from '../../../../components/basis/flight/plan/FlightPlanAreaMap'; |
||||||
import { drawTypeChangeAction } from '../../../../modules/control/map/actions/controlMapActions'; |
import { drawTypeChangeAction } from '../../../../modules/control/map/actions/controlMapActions'; |
||||||
import FlightPlanAreaDetailContainer from './FlightPlanAreaDetailContainer'; |
import FlightPlanAreaDetailContainer from './FlightPlanAreaDetailContainer'; |
||||||
|
|
||||||
const FlightPlanAreaContainer = ({handleModal, test}) => { |
const FlightPlanAreaContainer = ({ handleModal, test, isDone }) => { |
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch(); |
||||||
|
|
||||||
const { publicAreaList} = useSelector(state => state.flightState); |
const { publicAreaList } = useSelector(state => state.flightState); |
||||||
const [airArea, setAirArea] = useState(null);
|
const [airArea, setAirArea] = useState(null); |
||||||
|
|
||||||
useEffect(() => { |
useEffect(() => { |
||||||
dispatch(drawTypeChangeAction('')); |
dispatch(drawTypeChangeAction('')); |
||||||
getAirAreaList(); |
getAirAreaList(); |
||||||
}, []); |
}, []); |
||||||
|
|
||||||
useEffect(() => { |
useEffect(() => { |
||||||
setAirArea(publicAreaList); |
setAirArea(publicAreaList); |
||||||
}, [publicAreaList]) |
}, [publicAreaList]); |
||||||
|
|
||||||
|
const getAirAreaList = () => { |
||||||
|
dispatch(Actions.PUBLIC_AREA_LIST.request()); |
||||||
|
}; |
||||||
|
|
||||||
const getAirAreaList = () => { |
const handleConfirm = areaList => { |
||||||
dispatch(Actions.PUBLIC_AREA_LIST.request()); |
if (areaList === undefined) { |
||||||
|
alert('영역을 설정해 주세요.'); |
||||||
|
return false; |
||||||
} |
} |
||||||
|
|
||||||
const handleConfirm = (areaList) => { |
dispatch(Actions.AREA_COORDINATE_LIST_SAVE(areaList)); |
||||||
if(areaList === undefined) { |
}; |
||||||
alert('영역을 설정해 주세요.') |
|
||||||
return false; |
return ( |
||||||
}
|
<Row> |
||||||
|
<Col md={6} lg={6}> |
||||||
dispatch(Actions.AREA_COORDINATE_LIST_SAVE(areaList)) |
{airArea != null ? ( |
||||||
} |
<FlightPlanAreaMap |
||||||
|
airArea={airArea} |
||||||
return ( |
handleConfirm={handleConfirm} |
||||||
<Row> |
test={test} |
||||||
<Col md={6} lg={6}> |
isDone={isDone} |
||||||
{airArea != null ? ( |
/> |
||||||
<FlightPlanAreaMap |
) : null} |
||||||
airArea={airArea}
|
</Col> |
||||||
handleConfirm={handleConfirm} |
<Col md={6} lg={6}> |
||||||
test={test} |
<FlightPlanAreaDetailContainer |
||||||
/> |
handleModal={handleModal} |
||||||
) : null}
|
test={test} |
||||||
</Col> |
isDone={isDone} |
||||||
<Col md={6} lg={6}> |
/> |
||||||
<FlightPlanAreaDetailContainer
|
</Col> |
||||||
handleModal={handleModal} |
</Row> |
||||||
test={test} |
); |
||||||
/> |
}; |
||||||
</Col> |
|
||||||
</Row> |
|
||||||
|
|
||||||
) |
|
||||||
} |
|
||||||
|
|
||||||
export default FlightPlanAreaContainer; |
export default FlightPlanAreaContainer; |
||||||
|
Loading…
Reference in new issue