Browse Source

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

feature/auth
junh_eee 2 years ago
parent
commit
e5b7f88a4e
  1. 13
      src/components/basis/flight/plan/FlightPlanAreaDetailForm.js
  2. 10
      src/components/basis/flight/plan/FlightPlanAreaMap.js
  3. 9
      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

13
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} : {})}
/>
</div>
<div className='m_ft_box'>
@ -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} : {} }
>
적용
</Button.Ripple>
@ -137,7 +140,8 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl
name,
value
})
}}
}}
{...(isFlightDone? {readOnly:true} : {})}
/>
</FormGroup>
</Col>
@ -162,6 +166,7 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl
value
})
}}
{...(isFlightDone? {readOnly:true} : {})}
/>
</FormGroup>
</Col>
@ -178,6 +183,7 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl
color='primary'
onClick={e => handleSave()}
disabled={!coordList[0].lat ? true : false }
{...(isFlightDone)? {disabled:true} : {} }
>
등록
</Button.Ripple>
@ -185,6 +191,7 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl
className='mr-1'
color='primary'
onClick={e => handleClose()}
{...(isFlightDone)? {disabled:true} : {} }
>
닫기
</Button.Ripple>

10
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}
{/* <Button.Ripple
@ -153,7 +155,8 @@ const FlightPlanAreaMap = (props) => {
<Button.Ripple
color='primary'
className='area-button'
onClick={e => handlerDrawType('RESET')}
onClick={e => handlerDrawType('RESET')}
{...(isFlightDone)? {disabled:true} : {} }
>
초기화
</Button.Ripple>
@ -170,6 +173,7 @@ const FlightPlanAreaMap = (props) => {
className='mr-1'
color='primary'
onClick={e => handlerDrawType('LINE')}
{...(isFlightDone)? {disabled:true} : {} }
>
WayPoint
</Button.Ripple>
@ -177,12 +181,14 @@ const FlightPlanAreaMap = (props) => {
className='mr-1'
color='primary'
onClick={e => handlerDrawType('CIRCLE')}
{...(isFlightDone)? {disabled:true} : {} }
>
Circle
</Button.Ripple>
<Button.Ripple
color='primary'
onClick={e => handlerDrawType('POLYGON')}
{...(isFlightDone)? {disabled:true} : {} }
>
Polygon
</Button.Ripple>

9
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} : {} }
>
비행 구역 설정
</Button.Ripple>
@ -422,7 +422,8 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
</Col>
<SelectModal
modal={modal}
handleModal={handleModal}
handleModal={handleModal}
isFlightDone={isFlightDone}
/>
</Row>
)
@ -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 = <FlightPlanAreaContainer handleModal={handleModal} type={type} />;
description = <FlightPlanAreaContainer handleModal={handleModal} type={type} isFlightDone={isFlightDone}/>;
}
return (

32
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]);

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 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}) => {
<FlightPlanAreaMap
airArea={airArea}
handleConfirm={handleConfirm}
isFlightDone={isFlightDone}
/>
) : null}
</Col>
<Col md={6} lg={6}>
<FlightPlanAreaDetailContainer
handleModal={handleModal}
isFlightDone={isFlightDone}
/>
</Col>
</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';
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}
/>
</Col>
<InfoModal modal={alertModal} setModal={setAlertModal} />

Loading…
Cancel
Save