diff --git a/src/components/basis/flight/plan/FlightPlanAreaDetailForm.js b/src/components/basis/flight/plan/FlightPlanAreaDetailForm.js index 9697c1b5..0eac3d74 100644 --- a/src/components/basis/flight/plan/FlightPlanAreaDetailForm.js +++ b/src/components/basis/flight/plan/FlightPlanAreaDetailForm.js @@ -10,7 +10,7 @@ import { Button } from 'reactstrap'; -const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handleBufferList, data ,mapControl}) => { +const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handleBufferList, data, mapControl, isFlightDone}) => { const coordList = data ? data[0].coordList : null; @@ -101,7 +101,9 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl name, value }) - }} + }} + {...(isFlightDone? {readOnly:true} : {})} + />
@@ -111,6 +113,7 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl size='sm' disabled={coordList[0].lat && (data[0].areaType && data[0].areaType != ("POLYGON")) ? false : true } onClick={() => handleBufferList()} + {...(isFlightDone)? {disabled:true} : {} } > 적용 @@ -137,7 +140,8 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl name, value }) - }} + }} + {...(isFlightDone? {readOnly:true} : {})} /> @@ -162,6 +166,7 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl value }) }} + {...(isFlightDone? {readOnly:true} : {})} /> @@ -178,6 +183,7 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl color='primary' onClick={e => handleSave()} disabled={!coordList[0].lat ? true : false } + {...(isFlightDone)? {disabled:true} : {} } > 등록 @@ -185,6 +191,7 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl className='mr-1' color='primary' onClick={e => handleClose()} + {...(isFlightDone)? {disabled:true} : {} } > 닫기 diff --git a/src/components/basis/flight/plan/FlightPlanAreaMap.js b/src/components/basis/flight/plan/FlightPlanAreaMap.js index 56d9edf7..4112baf5 100644 --- a/src/components/basis/flight/plan/FlightPlanAreaMap.js +++ b/src/components/basis/flight/plan/FlightPlanAreaMap.js @@ -14,7 +14,8 @@ import { AREA_COORDINATE_LIST_SAVE } from '../../../../modules/basis/flight/acti const FlightPlanAreaMap = (props) => { const dispatch = useDispatch(); const naver = window.naver; - const airArea = props.airArea; + const airArea = props.airArea; + const isFlightDone = props.isFlightDone; const mapControl = useSelector(state => state.controlMapReducer); const { areaCoordList } = useSelector(state => state.flightState); @@ -141,6 +142,7 @@ const FlightPlanAreaMap = (props) => { handleCoordinates={handleCoordinates} handleInitCoordinates={handleInitCoordinates} handleConfirm={props.handleConfirm} + isFlightDone={isFlightDone} /> : null} {/* { handlerDrawType('RESET')} + onClick={e => handlerDrawType('RESET')} + {...(isFlightDone)? {disabled:true} : {} } > 초기화 @@ -170,6 +173,7 @@ const FlightPlanAreaMap = (props) => { className='mr-1' color='primary' onClick={e => handlerDrawType('LINE')} + {...(isFlightDone)? {disabled:true} : {} } > WayPoint @@ -177,12 +181,14 @@ const FlightPlanAreaMap = (props) => { className='mr-1' color='primary' onClick={e => handlerDrawType('CIRCLE')} + {...(isFlightDone)? {disabled:true} : {} } > Circle handlerDrawType('POLYGON')} + {...(isFlightDone)? {disabled:true} : {} } > Polygon diff --git a/src/components/basis/flight/plan/FlightPlanForm.js b/src/components/basis/flight/plan/FlightPlanForm.js index be3574bc..9aa2be20 100644 --- a/src/components/basis/flight/plan/FlightPlanForm.js +++ b/src/components/basis/flight/plan/FlightPlanForm.js @@ -326,7 +326,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele onClick={(e) => { handleModal({target: 'area', isOpen: true}) }} - {...(isFlightDone)? {disabled:true} : {} } + // {...(isFlightDone)? {disabled:true} : {} } > 비행 구역 설정 @@ -422,7 +422,8 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele ) @@ -430,7 +431,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele export default FlightPlanForm; -const SelectModal = ({handleModal, modal}) => { +const SelectModal = ({handleModal, modal, isFlightDone}) => { let title = ''; let description = ''; let type = ''; @@ -454,7 +455,7 @@ const SelectModal = ({handleModal, modal}) => { isOpen = modal.area; title = '비행 구역 설정'; type = 'area'; - description = ; + description = ; } return ( diff --git a/src/components/map/naver/draw/FlightPlanDraw.js b/src/components/map/naver/draw/FlightPlanDraw.js index c2b42fc0..96af9a16 100644 --- a/src/components/map/naver/draw/FlightPlanDraw.js +++ b/src/components/map/naver/draw/FlightPlanDraw.js @@ -7,6 +7,7 @@ import { InfoModal } from '../../../modal/InfoModal'; export const FlightPlanDraw = props => { const dispatch = useDispatch(); const mapControl = useSelector(state => state.controlMapReducer); + const isFlightDone = props.isFlightDone; const [pastPolyline, setPolyline] = useState(); const [pastBuffer, setBuffer] = useState(); @@ -611,6 +612,8 @@ export const FlightPlanDraw = props => { setPolyline(polyline) //dragCircle 생성 + let clickSet; + {isFlightDone? {clickSet:'false'} : {clickSet:'true'} } for(let i = 0; i < paths.length; i++) { dragCircle.push( new naver.maps.Circle({ @@ -621,10 +624,15 @@ export const FlightPlanDraw = props => { center: paths[i], radius: 15, map: map, - clickable: true + clickable: clickSet }) ) - dragCircleEve.push(naver.maps.Event.addListener(dragCircle[i], 'mousedown', function () { onMouseDownDrag(i) })) + {isFlightDone ? + {} + : + dragCircleEve.push(naver.maps.Event.addListener(dragCircle[i], 'mousedown', function () { onMouseDownDrag(i) })) + } + } setDragCircle(dragCircle); @@ -713,6 +721,8 @@ export const FlightPlanDraw = props => { setPolygon(polygon); //dragCircle 생성 + let clickSet; + {isFlightDone? {clickSet:'false'} : {clickSet:'true'} } for(let i = 0; i < paths.length; i++) { dragCircle.push( new naver.maps.Circle({ @@ -723,10 +733,14 @@ export const FlightPlanDraw = props => { center: paths[i], radius: 15, map: map, - clickable: true + clickable: clickSet }) ) - dragCircleEve.push(naver.maps.Event.addListener(dragCircle[i], 'mousedown', function () { onMouseDownDrag(i) })) + {isFlightDone ? + {} + : + dragCircleEve.push(naver.maps.Event.addListener(dragCircle[i], 'mousedown', function () { onMouseDownDrag(i) })) + } } setDragCircle(dragCircle); @@ -807,6 +821,8 @@ export const FlightPlanDraw = props => { pastCircle.forEach(prev => prev.setMap(null)); } + let clickSet; + {isFlightDone? {clickSet:'false'} : {clickSet:'true'} } circle = new naver.maps.Circle({ strokeColor: '#283046', strokeOpacity: 1, @@ -816,9 +832,13 @@ export const FlightPlanDraw = props => { center: paths[0], radius: areas.bufferZone, map: map, - clickable: true + clickable: clickSet }); - Eve.mousedownEve = naver.maps.Event.addListener(circle, 'mousedown', function () { onMouseDownDrag(0); }) + {isFlightDone ? + {} + : + Eve.mousedownEve = naver.maps.Event.addListener(circle, 'mousedown', function () { onMouseDownDrag(0); }) + } setCircle([circle]); diff --git a/src/containers/basis/flight/plan/FlightPlanAreaContainer.js b/src/containers/basis/flight/plan/FlightPlanAreaContainer.js index 617e58fe..d91c90dc 100644 --- a/src/containers/basis/flight/plan/FlightPlanAreaContainer.js +++ b/src/containers/basis/flight/plan/FlightPlanAreaContainer.js @@ -6,7 +6,7 @@ import FlightPlanAreaMap from '../../../../components/basis/flight/plan/FlightPl import { drawTypeChangeAction } from '../../../../modules/control/map/actions/controlMapActions'; import FlightPlanAreaDetailContainer from './FlightPlanAreaDetailContainer'; -const FlightPlanAreaContainer = ({handleModal}) => { +const FlightPlanAreaContainer = ({handleModal, isFlightDone}) => { const dispatch = useDispatch(); const { publicAreaList} = useSelector(state => state.flightState); @@ -42,12 +42,14 @@ const FlightPlanAreaContainer = ({handleModal}) => { ) : null} diff --git a/src/containers/basis/flight/plan/FlightPlanAreaDetailContainer.js b/src/containers/basis/flight/plan/FlightPlanAreaDetailContainer.js index d1053e23..ec4a45c9 100644 --- a/src/containers/basis/flight/plan/FlightPlanAreaDetailContainer.js +++ b/src/containers/basis/flight/plan/FlightPlanAreaDetailContainer.js @@ -8,7 +8,7 @@ import { InfoModal } from '../../../../components/modal/InfoModal'; import axios from '../../../../modules/utils/customAxiosUtil'; -const FlightPlanAreaDetailContainer = ({ handleModal }) => { +const FlightPlanAreaDetailContainer = ({ handleModal, isFlightDone }) => { const dispatch = useDispatch(); const mapControl = useSelector(state => state.controlMapReducer); @@ -114,6 +114,7 @@ const FlightPlanAreaDetailContainer = ({ handleModal }) => { areaCoordList={areaCoordList} data={areaDetail} mapControl={mapControl} + isFlightDone={isFlightDone} />