Browse Source

비행계획서 - 수정불가 롤백

pull/2/head
junh_eee 2 years ago
parent
commit
b37e1541f1
  1. 9
      src/components/basis/flight/plan/FlightPlanAreaDetailForm.js
  2. 15
      src/components/basis/flight/plan/FlightPlanAreaMap.js
  3. 64
      src/components/basis/flight/plan/FlightPlanForm.js
  4. 30
      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
} from 'reactstrap';
const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handleBufferList, data, mapControl, isFlightDone}) => {
const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handleBufferList, data, mapControl}) => {
const coordList = data ? data[0].coordList : null;
@ -102,8 +102,6 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl
value
})
}}
{...(isFlightDone? {readOnly:true} : {})}
/>
</div>
<div className='m_ft_box'>
@ -113,7 +111,6 @@ 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>
@ -141,7 +138,6 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl
value
})
}}
{...(isFlightDone? {readOnly:true} : {})}
/>
</FormGroup>
</Col>
@ -166,7 +162,6 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl
value
})
}}
{...(isFlightDone? {readOnly:true} : {})}
/>
</FormGroup>
</Col>
@ -183,7 +178,6 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl
color='primary'
onClick={e => handleSave()}
disabled={!coordList[0].lat ? true : false }
{...(isFlightDone)? {disabled:true} : {} }
>
등록
</Button.Ripple>
@ -191,7 +185,6 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl
className='mr-1'
color='primary'
onClick={e => handleClose()}
{...(isFlightDone)? {disabled:true} : {} }
>
닫기
</Button.Ripple>

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

@ -15,14 +15,15 @@ const FlightPlanAreaMap = (props) => {
const dispatch = useDispatch();
const naver = window.naver;
const airArea = props.airArea;
const isFlightDone = props.isFlightDone;
const mapControl = useSelector(state => state.controlMapReducer);
const { areaCoordList } = useSelector(state => state.flightState);
const [map, setMap] = useState();
const [isMapLoad, setIsMapLoad] = useState(false);
const [mode, setMode] = useState();
const [mapAreaCoordList, setMapAreaCoordList] = useState(initFlightBas.initDetail.areaList);
const [mapAreaCoordList, setMapAreaCoordList] = useState(initFlightBas.initDetail.areaList);
let dragCircleSize;
useEffect(() => {
NaverMapInit();
@ -55,15 +56,19 @@ const FlightPlanAreaMap = (props) => {
center.lon = areaCoordList[0].coordList[0].lon === 0 ? 126.610166 : areaCoordList[0].coordList[0].lon;
if(areaCoordList[0].bufferZone>=0 && areaCoordList[0].bufferZone<2000){
bufferzoom.bufferzoom =13;
dragCircleSize = 15;
}
else if(areaCoordList[0].bufferZone>=2000 && areaCoordList[0].bufferZone <5000){
bufferzoom.bufferzoom =12;
dragCircleSize = 20;
}
else if(areaCoordList[0].bufferZone>=5000 && areaCoordList[0].bufferZone <=9000){
bufferzoom.bufferzoom =11;
dragCircleSize = 25;
}
else{
bufferzoom.bufferzoom =10;
dragCircleSize = 30;
}
}
console.log("bufferzoom>>",bufferzoom);
@ -142,7 +147,7 @@ const FlightPlanAreaMap = (props) => {
handleCoordinates={handleCoordinates}
handleInitCoordinates={handleInitCoordinates}
handleConfirm={props.handleConfirm}
isFlightDone={isFlightDone}
dragCircleSize={dragCircleSize}
/> : null}
{/* <Button.Ripple
@ -156,7 +161,6 @@ const FlightPlanAreaMap = (props) => {
color='primary'
className='area-button'
onClick={e => handlerDrawType('RESET')}
{...(isFlightDone)? {disabled:true} : {} }
>
초기화
</Button.Ripple>
@ -173,7 +177,6 @@ const FlightPlanAreaMap = (props) => {
className='mr-1'
color='primary'
onClick={e => handlerDrawType('LINE')}
{...(isFlightDone)? {disabled:true} : {} }
>
WayPoint
</Button.Ripple>
@ -181,14 +184,12 @@ 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>

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

@ -96,7 +96,6 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
bsSize='sm'
placeholder=''
{ ...(isFlightDone ? {readOnly:true} : {}) }
/>
</FormGroup>
</Col>
@ -143,7 +142,6 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
})
}}
placeholder='010-0000-0000'
{ ...(isFlightDone ? {readOnly:true} : {}) }
/>
</div>
</FormGroup>
@ -169,7 +167,6 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
}}
// innerRef={props.data}
placeholder=''
{ ...(isFlightDone ? {readOnly:true} : {}) }
/>
</FormGroup>
</Col>
@ -277,7 +274,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
<span className='necessary'>*</span>
</Label>
<Input
{...(isFlightDone? {type:'text'} : {type:'select'})}
type='select'
id='fltPurpose'
name='fltPurpose'
value={data.fltPurpose}
@ -290,27 +287,19 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
value,
})
}}
{...(isFlightDone? {readOnly:true} : {})}
// innerRef={props.data}
// className={classnames({
// 'is-invalid': props.errors.arcrftTypeCd
// })}
>
{/* TODO CDNOT 코드연동 필요 */}
{ isFlightDone ?
<></>
:
<>
<option value=''>= 선택 =</option>
<option value='시험비행'>= 시험비행 =</option>
<option value='교육비행'>= 교육비행 =</option>
<option value='사진/영상촬영'>= 사진/영상촬영 =</option>
<option value='비행훈련'>= 비행훈련 =</option>
<option value='비행교육'>= 비행교육 =</option>
<option value='비행실기시험'>= 비행실기시험 =</option>
</>
}
<option value=''>= 선택 =</option>
<option value='시험비행'>= 시험비행 =</option>
<option value='교육비행'>= 교육비행 =</option>
<option value='사진/영상촬영'>= 사진/영상촬영 =</option>
<option value='비행훈련'>= 비행훈련 =</option>
<option value='비행교육'>= 비행교육 =</option>
<option value='비행실기시험'>= 비행실기시험 =</option>
</Input>
</FormGroup>
</Col>
@ -326,7 +315,6 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
onClick={(e) => {
handleModal({target: 'area', isOpen: true})
}}
// {...(isFlightDone)? {disabled:true} : {} }
>
비행 구역 설정
</Button.Ripple>
@ -346,7 +334,6 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
onClick={(e) => {
handleModal({target: 'pilot', isOpen: true})
}}
{...(isFlightDone)? {disabled:true} : {} }
>
조종사 조회
</Button.Ripple>
@ -358,7 +345,6 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
data={item}
handleChange={handleChange}
handleDeleteArray ={handleDeleteArray}
isFlightDone={isFlightDone}
/>)
: <PilotForm data={initFlightBas.pilot}
handleChange={handleChange}/>}
@ -371,7 +357,6 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
onClick={(e) => {
handleModal({target: 'arcrft', isOpen: true});
}}
{...(isFlightDone)? {disabled:true} : {} }
>
기체 조회
</Button.Ripple>
@ -383,7 +368,6 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
data={item}
handleChange={handleChange}
handleDeleteArray ={handleDeleteArray}
isFlightDone={isFlightDone}
/>)
: <ArcrftForm data={initFlightBas.arcrft}
@ -396,7 +380,6 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
color='primary'
size='sm'
onClick={handleSave}
{...(isFlightDone)? {disabled:true} : {} }
>
저장
</Button.Ripple>
@ -404,7 +387,6 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
color='danger'
size='sm'
onClick={handleDelete}
{...(isFlightDone)? {disabled:true} : {} }
>
삭제
</Button.Ripple>
@ -423,7 +405,6 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
<SelectModal
modal={modal}
handleModal={handleModal}
isFlightDone={isFlightDone}
/>
</Row>
)
@ -431,7 +412,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
export default FlightPlanForm;
const SelectModal = ({handleModal, modal, isFlightDone}) => {
const SelectModal = ({handleModal, modal}) => {
let title = '';
let description = '';
let type = '';
@ -455,7 +436,7 @@ const SelectModal = ({handleModal, modal, isFlightDone}) => {
isOpen = modal.area;
title = '비행 구역 설정';
type = 'area';
description = <FlightPlanAreaContainer handleModal={handleModal} type={type} isFlightDone={isFlightDone}/>;
description = <FlightPlanAreaContainer handleModal={handleModal} type={type}/>;
}
return (
@ -604,7 +585,7 @@ const AreaForm = ({data, handleChange, index}) => {
</Row>
</div>)
}
const PilotForm = ({data, handleChange, index, handleDeleteArray, isFlightDone}) => {
const PilotForm = ({data, handleChange, index, handleDeleteArray}) => {
return (<div className='search-info-box'>
<Row>
<Col className='list-input' lg={4} md={6} sm={12}>
@ -720,7 +701,6 @@ const PilotForm = ({data, handleChange, index, handleDeleteArray, isFlightDone})
onClick={() =>
handleDeleteArray({ type: 'pilot', index })
}
{...(isFlightDone)? {disabled:true} : {} }
>
<X size={14} />
</Button.Ripple>
@ -737,7 +717,7 @@ const PilotForm = ({data, handleChange, index, handleDeleteArray, isFlightDone})
}
const ArcrftForm = ({data, handleChange, index, handleDeleteArray, isFlightDone}) => {
const ArcrftForm = ({data, handleChange, index, handleDeleteArray}) => {
return (<div className='search-info-box'>
<Row>
<Col className='list-input' lg={3} md={6} sm={12}>
@ -849,25 +829,6 @@ const ArcrftForm = ({data, handleChange, index, handleDeleteArray, isFlightDone}
</FormGroup>
</Col>
{/* {index !== 0 ?
(
<Col className='count-del-btn' xs={12} md={2} xl={2} >
<Button.Ripple
color='danger'
className='text-nowrap px-1'
onClick={() =>
handleDeleteArray({ type: 'pilot', index })
}
outline
>
<X size={14} className='mr-50' />
<span>삭제</span>
</Button.Ripple>
</Col>
)
:
<></>
} */}
{data.groupNm?
(
<Col className='search-info-box-del-btn' lg={1} md={6} sm={12}>
@ -877,7 +838,6 @@ const ArcrftForm = ({data, handleChange, index, handleDeleteArray, isFlightDone}
onClick={() =>
handleDeleteArray({ type: 'arcrft', index })
}
{...(isFlightDone)? {disabled:true} : {} }
>
<X size={14} />
</Button.Ripple>

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

@ -7,7 +7,6 @@ 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();
@ -31,6 +30,7 @@ export const FlightPlanDraw = props => {
const naver = props.naver;
const map = props.map;
let mode = props.mode;
let dragCircleSize = props.dragCircleSize;
let areaInfo;
let lastDistance;
@ -612,8 +612,6 @@ 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({
@ -622,16 +620,13 @@ export const FlightPlanDraw = props => {
fillColor: '#ffffff',
fillOpacity: 1,
center: paths[i],
radius: 15,
radius: 17,
// radius: dragCircleSize,
map: map,
clickable: clickSet
clickable: true
})
)
{isFlightDone ?
{}
:
dragCircleEve.push(naver.maps.Event.addListener(dragCircle[i], 'mousedown', function () { onMouseDownDrag(i) }))
}
}
@ -721,8 +716,6 @@ 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({
@ -732,15 +725,12 @@ export const FlightPlanDraw = props => {
fillOpacity: 1,
center: paths[i],
radius: 15,
// radius: dragCircleSize,
map: map,
clickable: clickSet
clickable: true
})
)
{isFlightDone ?
{}
:
dragCircleEve.push(naver.maps.Event.addListener(dragCircle[i], 'mousedown', function () { onMouseDownDrag(i) }))
}
}
setDragCircle(dragCircle);
@ -821,8 +811,6 @@ 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,
@ -832,13 +820,9 @@ export const FlightPlanDraw = props => {
center: paths[0],
radius: areas.bufferZone,
map: map,
clickable: clickSet
clickable: true
});
{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, isFlightDone}) => {
const FlightPlanAreaContainer = ({handleModal}) => {
const dispatch = useDispatch();
const { publicAreaList} = useSelector(state => state.flightState);
@ -42,14 +42,12 @@ const FlightPlanAreaContainer = ({handleModal, isFlightDone}) => {
<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, isFlightDone }) => {
const FlightPlanAreaDetailContainer = ({ handleModal }) => {
const dispatch = useDispatch();
const mapControl = useSelector(state => state.controlMapReducer);
@ -114,7 +114,6 @@ const FlightPlanAreaDetailContainer = ({ handleModal, isFlightDone }) => {
areaCoordList={areaCoordList}
data={areaDetail}
mapControl={mapControl}
isFlightDone={isFlightDone}
/>
</Col>
<InfoModal modal={alertModal} setModal={setAlertModal} />

Loading…
Cancel
Save