Browse Source

Merge branch 'master' of http://gitea.palntour.com/pav/pav-home

pull/2/head
이학준 2 years ago
parent
commit
e7cf5dc304
  1. 9
      src/components/basis/flight/plan/FlightPlanAreaDetailForm.js
  2. 99
      src/components/basis/flight/plan/FlightPlanForm.js
  3. 30
      src/components/map/naver/draw/FlightPlanDraw.js
  4. 4
      src/containers/basis/flight/plan/FlightPlanAreaContainer.js
  5. 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>

99
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>
@ -187,7 +184,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
<Label for='test'>
<span className='necessary'>*</span>
</Label>
{
{/* {
(isFlightDone) ?
(
<Input
@ -223,8 +220,27 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
{...{options:{minDate: "today"}}}
/>
)
}
} */}
<Flatpickr
size='sm'
className='form-control calendar-flat'
type='text'
id='schFltStDt'
name='schFltStDt'
data-enable-time
// defaultValue={data.schFltStDt}
value={data.schFltStDt}
onChange={(date) => {
const value = moment(date[0]).format('YYYY-MM-DD HH:mm:ss') || '';
handleChange({
type: 'plan',
name: 'schFltStDt',
value
})
}}
placeholder='비행 시작일자 선택(클릭)'
// {...{options:{minDate: "today"}}}
/>
</FormGroup>
</Col>
<Col className='list-input' lg={4} md={4} sm={12}>
@ -232,7 +248,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
<Label for='test'>
<span className='necessary'>*</span>
</Label>
{
{/* {
(isFlightDone) ?
(
<Input
@ -268,7 +284,27 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
{...{options:{minDate: "today"}}}
/>
)
}
} */}
<Flatpickr
size='sm'
className='form-control calendar-flat'
type='text'
id='schFltEndDt'
name='schFltEndDt'
data-enable-time
// defaultValue={data.schFltEndDt}
value={data.schFltEndDt}
onChange={(date) => {
const value = moment(date[0]).format('YYYY-MM-DD HH:mm:ss') || '';
handleChange({
type: 'plan',
name: 'schFltEndDt',
value
})
}}
placeholder='비행 종료일자 선택(클릭)'
// {...{options:{minDate: "today"}}}
/>
</FormGroup>
</Col>
<Col className='list-input' lg={4} md={4} sm={12}>
@ -277,7 +313,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,17 +326,12 @@ 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>
@ -308,9 +339,6 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
<option value='비행훈련'>= 비행훈련 =</option>
<option value='비행교육'>= 비행교육 =</option>
<option value='비행실기시험'>= 비행실기시험 =</option>
</>
}
</Input>
</FormGroup>
</Col>
@ -326,7 +354,6 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
onClick={(e) => {
handleModal({target: 'area', isOpen: true})
}}
// {...(isFlightDone)? {disabled:true} : {} }
>
비행 구역 설정
</Button.Ripple>
@ -346,7 +373,6 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
onClick={(e) => {
handleModal({target: 'pilot', isOpen: true})
}}
{...(isFlightDone)? {disabled:true} : {} }
>
조종사 조회
</Button.Ripple>
@ -358,7 +384,6 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
data={item}
handleChange={handleChange}
handleDeleteArray ={handleDeleteArray}
isFlightDone={isFlightDone}
/>)
: <PilotForm data={initFlightBas.pilot}
handleChange={handleChange}/>}
@ -371,7 +396,6 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
onClick={(e) => {
handleModal({target: 'arcrft', isOpen: true});
}}
{...(isFlightDone)? {disabled:true} : {} }
>
기체 조회
</Button.Ripple>
@ -383,7 +407,6 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
data={item}
handleChange={handleChange}
handleDeleteArray ={handleDeleteArray}
isFlightDone={isFlightDone}
/>)
: <ArcrftForm data={initFlightBas.arcrft}
@ -396,7 +419,6 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
color='primary'
size='sm'
onClick={handleSave}
{...(isFlightDone)? {disabled:true} : {} }
>
저장
</Button.Ripple>
@ -404,7 +426,6 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
color='danger'
size='sm'
onClick={handleDelete}
{...(isFlightDone)? {disabled:true} : {} }
>
삭제
</Button.Ripple>
@ -423,7 +444,6 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
<SelectModal
modal={modal}
handleModal={handleModal}
isFlightDone={isFlightDone}
/>
</Row>
)
@ -431,7 +451,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 +475,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 +624,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 +740,6 @@ const PilotForm = ({data, handleChange, index, handleDeleteArray, isFlightDone})
onClick={() =>
handleDeleteArray({ type: 'pilot', index })
}
{...(isFlightDone)? {disabled:true} : {} }
>
<X size={14} />
</Button.Ripple>
@ -737,7 +756,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 +868,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 +877,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,16 +725,13 @@ 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