Browse Source

비행계획서 - 수정불가 계획서 비행구역 조회

pull/2/head
junh_eee 2 years ago
parent
commit
e5b7f88a4e
  1. 9
      src/components/basis/flight/plan/FlightPlanAreaDetailForm.js
  2. 6
      src/components/basis/flight/plan/FlightPlanAreaMap.js
  3. 7
      src/components/basis/flight/plan/FlightPlanForm.js
  4. 32
      src/components/map/naver/draw/FlightPlanDraw.js
  5. 4
      src/containers/basis/flight/plan/FlightPlanAreaContainer.js
  6. 3
      src/containers/basis/flight/plan/FlightPlanAreaDetailContainer.js

9
src/components/basis/flight/plan/FlightPlanAreaDetailForm.js

@ -10,7 +10,7 @@ import {
Button Button
} from 'reactstrap'; } 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; const coordList = data ? data[0].coordList : null;
@ -102,6 +102,8 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl
value value
}) })
}} }}
{...(isFlightDone? {readOnly:true} : {})}
/> />
</div> </div>
<div className='m_ft_box'> <div className='m_ft_box'>
@ -111,6 +113,7 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl
size='sm' size='sm'
disabled={coordList[0].lat && (data[0].areaType && data[0].areaType != ("POLYGON")) ? false : true } disabled={coordList[0].lat && (data[0].areaType && data[0].areaType != ("POLYGON")) ? false : true }
onClick={() => handleBufferList()} onClick={() => handleBufferList()}
{...(isFlightDone)? {disabled:true} : {} }
> >
적용 적용
</Button.Ripple> </Button.Ripple>
@ -138,6 +141,7 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl
value value
}) })
}} }}
{...(isFlightDone? {readOnly:true} : {})}
/> />
</FormGroup> </FormGroup>
</Col> </Col>
@ -162,6 +166,7 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl
value value
}) })
}} }}
{...(isFlightDone? {readOnly:true} : {})}
/> />
</FormGroup> </FormGroup>
</Col> </Col>
@ -178,6 +183,7 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl
color='primary' color='primary'
onClick={e => handleSave()} onClick={e => handleSave()}
disabled={!coordList[0].lat ? true : false } disabled={!coordList[0].lat ? true : false }
{...(isFlightDone)? {disabled:true} : {} }
> >
등록 등록
</Button.Ripple> </Button.Ripple>
@ -185,6 +191,7 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl
className='mr-1' className='mr-1'
color='primary' color='primary'
onClick={e => handleClose()} onClick={e => handleClose()}
{...(isFlightDone)? {disabled:true} : {} }
> >
닫기 닫기
</Button.Ripple> </Button.Ripple>

6
src/components/basis/flight/plan/FlightPlanAreaMap.js

@ -15,6 +15,7 @@ const FlightPlanAreaMap = (props) => {
const dispatch = useDispatch(); const dispatch = useDispatch();
const naver = window.naver; const naver = window.naver;
const airArea = props.airArea; const airArea = props.airArea;
const isFlightDone = props.isFlightDone;
const mapControl = useSelector(state => state.controlMapReducer); const mapControl = useSelector(state => state.controlMapReducer);
const { areaCoordList } = useSelector(state => state.flightState); const { areaCoordList } = useSelector(state => state.flightState);
@ -141,6 +142,7 @@ const FlightPlanAreaMap = (props) => {
handleCoordinates={handleCoordinates} handleCoordinates={handleCoordinates}
handleInitCoordinates={handleInitCoordinates} handleInitCoordinates={handleInitCoordinates}
handleConfirm={props.handleConfirm} handleConfirm={props.handleConfirm}
isFlightDone={isFlightDone}
/> : null} /> : null}
{/* <Button.Ripple {/* <Button.Ripple
@ -154,6 +156,7 @@ const FlightPlanAreaMap = (props) => {
color='primary' color='primary'
className='area-button' className='area-button'
onClick={e => handlerDrawType('RESET')} onClick={e => handlerDrawType('RESET')}
{...(isFlightDone)? {disabled:true} : {} }
> >
초기화 초기화
</Button.Ripple> </Button.Ripple>
@ -170,6 +173,7 @@ const FlightPlanAreaMap = (props) => {
className='mr-1' className='mr-1'
color='primary' color='primary'
onClick={e => handlerDrawType('LINE')} onClick={e => handlerDrawType('LINE')}
{...(isFlightDone)? {disabled:true} : {} }
> >
WayPoint WayPoint
</Button.Ripple> </Button.Ripple>
@ -177,12 +181,14 @@ const FlightPlanAreaMap = (props) => {
className='mr-1' className='mr-1'
color='primary' color='primary'
onClick={e => handlerDrawType('CIRCLE')} onClick={e => handlerDrawType('CIRCLE')}
{...(isFlightDone)? {disabled:true} : {} }
> >
Circle Circle
</Button.Ripple> </Button.Ripple>
<Button.Ripple <Button.Ripple
color='primary' color='primary'
onClick={e => handlerDrawType('POLYGON')} onClick={e => handlerDrawType('POLYGON')}
{...(isFlightDone)? {disabled:true} : {} }
> >
Polygon Polygon
</Button.Ripple> </Button.Ripple>

7
src/components/basis/flight/plan/FlightPlanForm.js

@ -326,7 +326,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
onClick={(e) => { onClick={(e) => {
handleModal({target: 'area', isOpen: true}) handleModal({target: 'area', isOpen: true})
}} }}
{...(isFlightDone)? {disabled:true} : {} } // {...(isFlightDone)? {disabled:true} : {} }
> >
비행 구역 설정 비행 구역 설정
</Button.Ripple> </Button.Ripple>
@ -423,6 +423,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
<SelectModal <SelectModal
modal={modal} modal={modal}
handleModal={handleModal} handleModal={handleModal}
isFlightDone={isFlightDone}
/> />
</Row> </Row>
) )
@ -430,7 +431,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
export default FlightPlanForm; export default FlightPlanForm;
const SelectModal = ({handleModal, modal}) => { const SelectModal = ({handleModal, modal, isFlightDone}) => {
let title = ''; let title = '';
let description = ''; let description = '';
let type = ''; let type = '';
@ -454,7 +455,7 @@ const SelectModal = ({handleModal, modal}) => {
isOpen = modal.area; isOpen = modal.area;
title = '비행 구역 설정'; title = '비행 구역 설정';
type = 'area'; type = 'area';
description = <FlightPlanAreaContainer handleModal={handleModal} type={type} />; description = <FlightPlanAreaContainer handleModal={handleModal} type={type} isFlightDone={isFlightDone}/>;
} }
return ( return (

32
src/components/map/naver/draw/FlightPlanDraw.js

@ -7,6 +7,7 @@ import { InfoModal } from '../../../modal/InfoModal';
export const FlightPlanDraw = props => { export const FlightPlanDraw = props => {
const dispatch = useDispatch(); const dispatch = useDispatch();
const mapControl = useSelector(state => state.controlMapReducer); const mapControl = useSelector(state => state.controlMapReducer);
const isFlightDone = props.isFlightDone;
const [pastPolyline, setPolyline] = useState(); const [pastPolyline, setPolyline] = useState();
const [pastBuffer, setBuffer] = useState(); const [pastBuffer, setBuffer] = useState();
@ -611,6 +612,8 @@ export const FlightPlanDraw = props => {
setPolyline(polyline) setPolyline(polyline)
//dragCircle 생성 //dragCircle 생성
let clickSet;
{isFlightDone? {clickSet:'false'} : {clickSet:'true'} }
for(let i = 0; i < paths.length; i++) { for(let i = 0; i < paths.length; i++) {
dragCircle.push( dragCircle.push(
new naver.maps.Circle({ new naver.maps.Circle({
@ -621,10 +624,15 @@ export const FlightPlanDraw = props => {
center: paths[i], center: paths[i],
radius: 15, radius: 15,
map: map, 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); setDragCircle(dragCircle);
@ -713,6 +721,8 @@ export const FlightPlanDraw = props => {
setPolygon(polygon); setPolygon(polygon);
//dragCircle 생성 //dragCircle 생성
let clickSet;
{isFlightDone? {clickSet:'false'} : {clickSet:'true'} }
for(let i = 0; i < paths.length; i++) { for(let i = 0; i < paths.length; i++) {
dragCircle.push( dragCircle.push(
new naver.maps.Circle({ new naver.maps.Circle({
@ -723,10 +733,14 @@ export const FlightPlanDraw = props => {
center: paths[i], center: paths[i],
radius: 15, radius: 15,
map: map, 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); setDragCircle(dragCircle);
@ -807,6 +821,8 @@ export const FlightPlanDraw = props => {
pastCircle.forEach(prev => prev.setMap(null)); pastCircle.forEach(prev => prev.setMap(null));
} }
let clickSet;
{isFlightDone? {clickSet:'false'} : {clickSet:'true'} }
circle = new naver.maps.Circle({ circle = new naver.maps.Circle({
strokeColor: '#283046', strokeColor: '#283046',
strokeOpacity: 1, strokeOpacity: 1,
@ -816,9 +832,13 @@ export const FlightPlanDraw = props => {
center: paths[0], center: paths[0],
radius: areas.bufferZone, radius: areas.bufferZone,
map: map, 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]); setCircle([circle]);

4
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 { drawTypeChangeAction } from '../../../../modules/control/map/actions/controlMapActions';
import FlightPlanAreaDetailContainer from './FlightPlanAreaDetailContainer'; import FlightPlanAreaDetailContainer from './FlightPlanAreaDetailContainer';
const FlightPlanAreaContainer = ({handleModal}) => { const FlightPlanAreaContainer = ({handleModal, isFlightDone}) => {
const dispatch = useDispatch(); const dispatch = useDispatch();
const { publicAreaList} = useSelector(state => state.flightState); const { publicAreaList} = useSelector(state => state.flightState);
@ -42,12 +42,14 @@ const FlightPlanAreaContainer = ({handleModal}) => {
<FlightPlanAreaMap <FlightPlanAreaMap
airArea={airArea} airArea={airArea}
handleConfirm={handleConfirm} handleConfirm={handleConfirm}
isFlightDone={isFlightDone}
/> />
) : null} ) : null}
</Col> </Col>
<Col md={6} lg={6}> <Col md={6} lg={6}>
<FlightPlanAreaDetailContainer <FlightPlanAreaDetailContainer
handleModal={handleModal} handleModal={handleModal}
isFlightDone={isFlightDone}
/> />
</Col> </Col>
</Row> </Row>

3
src/containers/basis/flight/plan/FlightPlanAreaDetailContainer.js

@ -8,7 +8,7 @@ import { InfoModal } from '../../../../components/modal/InfoModal';
import axios from '../../../../modules/utils/customAxiosUtil'; import axios from '../../../../modules/utils/customAxiosUtil';
const FlightPlanAreaDetailContainer = ({ handleModal }) => { const FlightPlanAreaDetailContainer = ({ handleModal, isFlightDone }) => {
const dispatch = useDispatch(); const dispatch = useDispatch();
const mapControl = useSelector(state => state.controlMapReducer); const mapControl = useSelector(state => state.controlMapReducer);
@ -114,6 +114,7 @@ const FlightPlanAreaDetailContainer = ({ handleModal }) => {
areaCoordList={areaCoordList} areaCoordList={areaCoordList}
data={areaDetail} data={areaDetail}
mapControl={mapControl} mapControl={mapControl}
isFlightDone={isFlightDone}
/> />
</Col> </Col>
<InfoModal modal={alertModal} setModal={setAlertModal} /> <InfoModal modal={alertModal} setModal={setAlertModal} />

Loading…
Cancel
Save