Browse Source

비행계획서 - 비행 시작 후 수정 불가

pull/2/head
junh_eee(이준희) 2 years ago
parent
commit
b56edf7892
  1. 134
      src/components/basis/flight/plan/FlightPlanAreaDetailForm.js
  2. 11
      src/components/basis/flight/plan/FlightPlanAreaMap.js
  3. 135
      src/components/basis/flight/plan/FlightPlanForm.js
  4. 15
      src/components/map/naver/draw/FlightPlanDraw.js
  5. 28
      src/containers/basis/flight/plan/FlightPlanAreaContainer.js
  6. 53
      src/containers/basis/flight/plan/FlightPlanAreaDetailContainer.js
  7. 219
      src/containers/basis/flight/plan/FlightPlanDetailContainer.js

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

@ -10,8 +10,16 @@ import {
Button Button
} from 'reactstrap'; } from 'reactstrap';
const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handleBufferList, data, mapControl, test }) => { const FlightPlanAreaDetailForm = ({
handleSave,
handleClose,
handleChange,
handleBufferList,
data,
mapControl,
test,
isDone
}) => {
const coordList = data ? data[0].coordList : null; const coordList = data ? data[0].coordList : null;
return ( return (
@ -36,14 +44,23 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl
<div className='search-info-box'> <div className='search-info-box'>
<Row> <Row>
{coordList ? {coordList ? (
coordList.map((coord, idx) => { coordList.map((coord, idx) => {
const latlon = coord.lat + ' / ' + coord.lon; const latlon = coord.lat + ' / ' + coord.lon;
return ( return (
<Col key={idx} className='list-input' lg={6} md={6} sm={12}> <Col
key={idx}
className='list-input'
lg={6}
md={6}
sm={12}
>
<FormGroup> <FormGroup>
<Label for='test'><span className='necessary'>*</span> {idx + 1} </Label> <Label for='test'>
<span className='necessary'>*</span>{' '}
{idx + 1}{' '}
</Label>
<Input <Input
type='text' type='text'
name='coord' name='coord'
@ -54,12 +71,14 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl
/> />
</FormGroup> </FormGroup>
</Col> </Col>
) );
}) })
: ) : (
<Col className='list-input' lg={6} md={6} sm={12}> <Col className='list-input' lg={6} md={6} sm={12}>
<FormGroup> <FormGroup>
<Label for='test'><span className='necessary'>*</span> 1</Label> <Label for='test'>
<span className='necessary'>*</span> 1
</Label>
<Input <Input
type='text' type='text'
name='coord' name='coord'
@ -69,8 +88,7 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl
/> />
</FormGroup> </FormGroup>
</Col> </Col>
} )}
</Row> </Row>
</div> </div>
</dt> </dt>
@ -85,65 +103,88 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl
<Col className='list-input' lg={6} md={6} sm={12}> <Col className='list-input' lg={6} md={6} sm={12}>
<FormGroup className='m_ft'> <FormGroup className='m_ft'>
<div className='m_ft_box'> <div className='m_ft_box'>
<Label for='test'><span className='necessary'>*</span>(m)</Label> <Label for='test'>
{test ? <span className='necessary'>*</span>(m)
</Label>
{test || isDone ? (
<Input <Input
type='text' type='text'
id='bufferZone' id='bufferZone'
name='bufferZone' name='bufferZone'
bsSize='sm' bsSize='sm'
readOnly={test} // readOnly={test}
disabled={test || isDone}
placeholder='반경' placeholder='반경'
value={data[0].bufferZone ? data[0].bufferZone : ''} value={
onChange={(e) => { data[0].bufferZone
? data[0].bufferZone
: ''
}
onChange={e => {
const { name, value } = e.target; const { name, value } = e.target;
handleChange({ handleChange({
name, name,
value value
}) });
}} }}
/> />
: ) : (
<Input <Input
type='text' type='text'
id='bufferZone' id='bufferZone'
name='bufferZone' name='bufferZone'
bsSize='sm' bsSize='sm'
readOnly={coordList[0].lat && (data[0].areaType && data[0].areaType != ("POLYGON")) ? false : true} readOnly={
coordList[0].lat &&
data[0].areaType &&
data[0].areaType != 'POLYGON'
? false
: true
}
placeholder='반경' placeholder='반경'
value={data[0].bufferZone ? data[0].bufferZone : ''} value={
onChange={(e) => { data[0].bufferZone
? data[0].bufferZone
: ''
}
onChange={e => {
const { name, value } = e.target; const { name, value } = e.target;
handleChange({ handleChange({
name, name,
value value
}) });
}} }}
/> />
} )}
</div> </div>
<div className='m_ft_box'> <div className='m_ft_box'>
{test ? {test || isDone ? (
<Button.Ripple <Button.Ripple
className='mr-1' className='mr-1'
color='primary' color='primary'
size='sm' size='sm'
disabled={test} disabled={test || isDone}
onClick={() => handleBufferList()} onClick={() => handleBufferList()}
> >
적용 적용
</Button.Ripple> </Button.Ripple>
: ) : (
<Button.Ripple <Button.Ripple
className='mr-1' className='mr-1'
color='primary' color='primary'
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()}
> >
적용 적용
</Button.Ripple> </Button.Ripple>
} )}
</div> </div>
</FormGroup> </FormGroup>
</Col> </Col>
@ -153,23 +194,26 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl
<Row> <Row>
<Col className='list-input' lg={6} md={6} sm={12}> <Col className='list-input' lg={6} md={6} sm={12}>
<FormGroup> <FormGroup>
<Label for='test'><span className='necessary'>*</span>(ft)</Label> <Label for='test'>
<span className='necessary'>*</span>(ft)
</Label>
<Input <Input
readOnly={test} // readOnly={test}
type='text' type='text'
id='fltElev' id='fltElev'
name='fltElev' name='fltElev'
bsSize='sm' bsSize='sm'
placeholder='고도' placeholder='고도'
value={data[0].fltElev ? data[0].fltElev : ''} value={data[0].fltElev ? data[0].fltElev : ''}
onChange={(e) => { onChange={e => {
const { name, value } = e.target; const { name, value } = e.target;
handleChange({ handleChange({
name, name,
value value
}) });
}} }}
disabled={test || isDone}
/> />
</FormGroup> </FormGroup>
</Col> </Col>
@ -179,22 +223,27 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl
<Row> <Row>
<Col className='list-input' lg={6} md={6} sm={12}> <Col className='list-input' lg={6} md={6} sm={12}>
<FormGroup> <FormGroup>
<Label for='test'><span className='necessary'>*</span> </Label> <Label for='test'>
<span className='necessary'>*</span>
</Label>
<Input <Input
readOnly={test} // readOnly={test}
type='text' type='text'
id='fltMethod' id='fltMethod'
name='fltMethod' name='fltMethod'
bsSize='sm' bsSize='sm'
placeholder='비행 방식' placeholder='비행 방식'
value={data[0].fltMethod ? data[0].fltMethod : ''} value={
onChange={(e) => { data[0].fltMethod ? data[0].fltMethod : ''
}
onChange={e => {
const { name, value } = e.target; const { name, value } = e.target;
handleChange({ handleChange({
name, name,
value value
}) });
}} }}
disabled={test || isDone}
/> />
</FormGroup> </FormGroup>
</Col> </Col>
@ -205,18 +254,17 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl
</div> </div>
<div className='d-flex align-items-center mt-2'> <div className='d-flex align-items-center mt-2'>
{test ? {test || isDone ? (
<Button.Ripple <Button.Ripple
type='submit' type='submit'
className='mr-1' className='mr-1'
color='primary' color='primary'
onClick={e => handleSave()} onClick={e => handleSave()}
disabled={test || isDone}
disabled={test}
> >
등록 등록
</Button.Ripple> </Button.Ripple>
: ) : (
<Button.Ripple <Button.Ripple
type='submit' type='submit'
className='mr-1' className='mr-1'
@ -226,7 +274,7 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl
> >
등록 등록
</Button.Ripple> </Button.Ripple>
} )}
<Button.Ripple <Button.Ripple
className='mr-1' className='mr-1'
color='primary' color='primary'
@ -241,7 +289,7 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl
</Row> </Row>
</CardBody> </CardBody>
</Card> </Card>
) );
} };
export default FlightPlanAreaDetailForm; export default FlightPlanAreaDetailForm;

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

@ -214,7 +214,8 @@ const FlightPlanAreaMap = props => {
handleCoordinates={handleCoordinates} handleCoordinates={handleCoordinates}
handleInitCoordinates={handleInitCoordinates} handleInitCoordinates={handleInitCoordinates}
handleConfirm={props.handleConfirm} handleConfirm={props.handleConfirm}
isDisabled={props.test} isYour={props.test}
isDone={props.isDone}
/> />
) : null} ) : null}
@ -304,7 +305,7 @@ const FlightPlanAreaMap = props => {
className='mr-1' className='mr-1'
color='primary' color='primary'
onClick={e => handlerDrawType('LINE')} onClick={e => handlerDrawType('LINE')}
disabled={props.test} disabled={props.test || props.isDone}
> >
WayPoint WayPoint
</Button.Ripple> </Button.Ripple>
@ -312,7 +313,7 @@ const FlightPlanAreaMap = props => {
className='mr-1' className='mr-1'
color='primary' color='primary'
onClick={e => handlerDrawType('CIRCLE')} onClick={e => handlerDrawType('CIRCLE')}
disabled={props.test} disabled={props.test || props.isDone}
> >
Circle Circle
</Button.Ripple> </Button.Ripple>
@ -320,7 +321,7 @@ const FlightPlanAreaMap = props => {
className='mr-1' className='mr-1'
color='primary' color='primary'
onClick={e => handlerDrawType('POLYGON')} onClick={e => handlerDrawType('POLYGON')}
disabled={props.test} disabled={props.test || props.isDone}
> >
Polygon Polygon
</Button.Ripple> </Button.Ripple>
@ -332,7 +333,7 @@ const FlightPlanAreaMap = props => {
// ):( // ):(
// {disabled:false} // {disabled:false}
// )} // )}
disabled={props.test} disabled={props.test || props.isDone}
> >
초기화 초기화
</Button.Ripple> </Button.Ripple>

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

@ -34,7 +34,8 @@ const FlightPlanForm = ({
handleSave, handleSave,
handleDelete, handleDelete,
modal, modal,
handleDeleteArray handleDeleteArray,
isDone
}) => { }) => {
const { areaList, pilotList, arcrftList } = data; const { areaList, pilotList, arcrftList } = data;
@ -79,7 +80,7 @@ const FlightPlanForm = ({
<span className='necessary'>*</span> <span className='necessary'>*</span>
</Label> </Label>
<Input <Input
readOnly={test} // readOnly={test}
type='text' type='text'
id='memberName' id='memberName'
name='memberName' name='memberName'
@ -95,6 +96,7 @@ const FlightPlanForm = ({
}} }}
bsSize='sm' bsSize='sm'
placeholder='' placeholder=''
disabled={isDone || test}
/> />
</FormGroup> </FormGroup>
</Col> </Col>
@ -126,7 +128,7 @@ const FlightPlanForm = ({
</div> </div>
<div className='m_ft_box'> <div className='m_ft_box'>
<Input <Input
readOnly={test} // readOnly={test}
type='text' type='text'
id='hpno' id='hpno'
name='hpno' name='hpno'
@ -142,6 +144,7 @@ const FlightPlanForm = ({
}); });
}} }}
placeholder='010-0000-0000' placeholder='010-0000-0000'
disabled={isDone || test}
/> />
</div> </div>
</FormGroup> </FormGroup>
@ -152,7 +155,7 @@ const FlightPlanForm = ({
<span className='necessary'>*</span> <span className='necessary'>*</span>
</Label> </Label>
<Input <Input
readOnly={test} // readOnly={test}
type='text' type='text'
id='email' id='email'
name='email' name='email'
@ -169,6 +172,7 @@ const FlightPlanForm = ({
}} }}
// innerRef={props.data} // innerRef={props.data}
placeholder='' placeholder=''
disabled={isDone || test}
/> />
</FormGroup> </FormGroup>
</Col> </Col>
@ -187,45 +191,8 @@ const FlightPlanForm = ({
<span className='necessary'>*</span> <span className='necessary'>*</span>
비행시작일자 비행시작일자
</Label> </Label>
{/* {
(isFlightDone) ?
(
<Input
type='text'
id='groupNm'
name='groupNm'
value={data.schFltStDt}
bsSize='sm'
placeholder=''
readOnly
/>
)
:
(
<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"}}}
/>
)
} */}
<Flatpickr <Flatpickr
disabled={test} // disabled={test}
className='form-control form-control-sm' className='form-control form-control-sm'
type='text' type='text'
id='schFltStDt' id='schFltStDt'
@ -245,6 +212,7 @@ const FlightPlanForm = ({
}); });
}} }}
placeholder='비행 시작일자 선택(클릭)' placeholder='비행 시작일자 선택(클릭)'
disabled={isDone || test}
// {...{options:{minDate: "today"}}} // {...{options:{minDate: "today"}}}
/> />
</FormGroup> </FormGroup>
@ -255,45 +223,8 @@ const FlightPlanForm = ({
<span className='necessary'>*</span> <span className='necessary'>*</span>
비행종료일자 비행종료일자
</Label> </Label>
{/* {
(isFlightDone) ?
(
<Input
type='text'
id='groupNm'
name='groupNm'
value={data.schFltEndDt}
bsSize='sm'
placeholder=''
readOnly
/>
)
:
(
<Flatpickr <Flatpickr
size='sm' // disabled={test}
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"}}}
/>
)
} */}
<Flatpickr
disabled={test}
className='form-control form-control-sm' className='form-control form-control-sm'
type='text' type='text'
id='schFltEndDt' id='schFltEndDt'
@ -313,6 +244,7 @@ const FlightPlanForm = ({
}); });
}} }}
placeholder='비행 종료일자 선택(클릭)' placeholder='비행 종료일자 선택(클릭)'
disabled={isDone || test}
// {...{options:{minDate: "today"}}} // {...{options:{minDate: "today"}}}
/> />
</FormGroup> </FormGroup>
@ -324,7 +256,7 @@ const FlightPlanForm = ({
목적 목적
</Label> </Label>
<Input <Input
disabled={test} // disabled={test}
type='select' type='select'
id='fltPurpose' id='fltPurpose'
name='fltPurpose' name='fltPurpose'
@ -338,6 +270,7 @@ const FlightPlanForm = ({
value value
}); });
}} }}
disabled={isDone || test}
// innerRef={props.data} // innerRef={props.data}
// className={classnames({ // className={classnames({
// 'is-invalid': props.errors.arcrftTypeCd // 'is-invalid': props.errors.arcrftTypeCd
@ -402,7 +335,7 @@ const FlightPlanForm = ({
<div className='search-info-ti d-flex justify-content-between'> <div className='search-info-ti d-flex justify-content-between'>
<h4 className='ti'>조종사 정보</h4> <h4 className='ti'>조종사 정보</h4>
<Button.Ripple <Button.Ripple
disabled={test} disabled={test || isDone}
color='primary' color='primary'
onClick={e => { onClick={e => {
handleModal({ target: 'pilot', isOpen: true }); handleModal({ target: 'pilot', isOpen: true });
@ -419,6 +352,7 @@ const FlightPlanForm = ({
data={item} data={item}
handleChange={handleChange} handleChange={handleChange}
handleDeleteArray={handleDeleteArray} handleDeleteArray={handleDeleteArray}
isDone={isDone}
/> />
)) ))
) : ( ) : (
@ -432,7 +366,7 @@ const FlightPlanForm = ({
<div className='search-info-ti d-flex justify-content-between'> <div className='search-info-ti d-flex justify-content-between'>
<h4 className='ti'>기체 정보</h4> <h4 className='ti'>기체 정보</h4>
<Button.Ripple <Button.Ripple
disabled={test} disabled={test || isDone}
color='primary' color='primary'
onClick={e => { onClick={e => {
handleModal({ target: 'arcrft', isOpen: true }); handleModal({ target: 'arcrft', isOpen: true });
@ -449,6 +383,7 @@ const FlightPlanForm = ({
data={item} data={item}
handleChange={handleChange} handleChange={handleChange}
handleDeleteArray={handleDeleteArray} handleDeleteArray={handleDeleteArray}
isDone={isDone}
/> />
)) ))
) : ( ) : (
@ -461,7 +396,7 @@ const FlightPlanForm = ({
<div className='d-flex align-items-center'> <div className='d-flex align-items-center'>
<Button.Ripple <Button.Ripple
disabled={test} disabled={test || isDone}
className='mr-1' className='mr-1'
color='primary' color='primary'
size='sm' size='sm'
@ -471,7 +406,7 @@ const FlightPlanForm = ({
</Button.Ripple> </Button.Ripple>
{data.planSno ? ( {data.planSno ? (
<Button.Ripple <Button.Ripple
disabled={test} disabled={test || isDone}
color='danger' color='danger'
size='sm' size='sm'
onClick={handleDelete} onClick={handleDelete}
@ -489,14 +424,19 @@ const FlightPlanForm = ({
</CardBody> </CardBody>
</Card> </Card>
</Col> </Col>
<SelectModal modal={modal} handleModal={handleModal} test={test} /> <SelectModal
modal={modal}
handleModal={handleModal}
test={test}
isDone={isDone}
/>
</Row> </Row>
); );
}; };
export default FlightPlanForm; export default FlightPlanForm;
const SelectModal = ({ handleModal, modal, test }) => { const SelectModal = ({ handleModal, modal, test, isDone }) => {
let title = ''; let title = '';
let description = ''; let description = '';
let type = ''; let type = '';
@ -529,6 +469,7 @@ const SelectModal = ({ handleModal, modal, test }) => {
handleModal={handleModal} handleModal={handleModal}
type={type} type={type}
test={test} test={test}
isDone={isDone}
/> />
); );
} }
@ -686,7 +627,13 @@ const AreaForm = ({ data, handleChange, index }) => {
</div> </div>
); );
}; };
const PilotForm = ({ data, handleChange, index, handleDeleteArray }) => { const PilotForm = ({
data,
handleChange,
index,
handleDeleteArray,
isDone
}) => {
const [test, setTest] = useState(); const [test, setTest] = useState();
const { user } = useSelector(state => state.authState, shallowEqual); const { user } = useSelector(state => state.authState, shallowEqual);
const { detail } = useSelector(state => state.flightState); const { detail } = useSelector(state => state.flightState);
@ -806,7 +753,7 @@ const PilotForm = ({ data, handleChange, index, handleDeleteArray }) => {
<Col className='search-info-box-del-btn' lg={1} md={6} sm={12}> <Col className='search-info-box-del-btn' lg={1} md={6} sm={12}>
{data.groupNm ? ( {data.groupNm ? (
<Button.Ripple <Button.Ripple
disabled={test} disabled={test || isDone}
color='danger' color='danger'
className='btn-icon' className='btn-icon'
onClick={() => handleDeleteArray({ type: 'pilot', index })} onClick={() => handleDeleteArray({ type: 'pilot', index })}
@ -822,7 +769,13 @@ const PilotForm = ({ data, handleChange, index, handleDeleteArray }) => {
); );
}; };
const ArcrftForm = ({ data, handleChange, index, handleDeleteArray }) => { const ArcrftForm = ({
data,
handleChange,
index,
handleDeleteArray,
isDone
}) => {
const [test, setTest] = useState(); const [test, setTest] = useState();
const { user } = useSelector(state => state.authState, shallowEqual); const { user } = useSelector(state => state.authState, shallowEqual);
const { detail } = useSelector(state => state.flightState); const { detail } = useSelector(state => state.flightState);
@ -945,7 +898,7 @@ const ArcrftForm = ({ data, handleChange, index, handleDeleteArray }) => {
{data.groupNm ? ( {data.groupNm ? (
<Col className='search-info-box-del-btn' lg={1} md={6} sm={12}> <Col className='search-info-box-del-btn' lg={1} md={6} sm={12}>
<Button.Ripple <Button.Ripple
disabled={test} disabled={test || isDone}
color='danger' color='danger'
className='btn-icon' className='btn-icon'
onClick={() => handleDeleteArray({ type: 'arcrft', index })} onClick={() => handleDeleteArray({ type: 'arcrft', index })}

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

@ -7,7 +7,8 @@ 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 isDisabled = props.isDisabled; const isYour = props.isYour;
const isDone = props.isDone;
const [pastPolyline, setPolyline] = useState(); const [pastPolyline, setPolyline] = useState();
const [pastBuffer, setBuffer] = useState(); const [pastBuffer, setBuffer] = useState();
@ -590,7 +591,8 @@ export const FlightPlanDraw = props => {
let clickSet; let clickSet;
{ {
isDisabled === true ? (clickSet = false) : (clickSet = true); // isDisabled === true ? (clickSet = false) : (clickSet = true);
(isYour || isDone) === true ? (clickSet = false) : (clickSet = true);
} }
if (areas.areaType && areas.areaType === 'LINE') { if (areas.areaType && areas.areaType === 'LINE') {
@ -629,7 +631,8 @@ export const FlightPlanDraw = props => {
); );
// dragCircleEve.push(naver.maps.Event.addListener(dragCircle[i], 'mousedown', function () { onMouseDownDrag(i) })) // dragCircleEve.push(naver.maps.Event.addListener(dragCircle[i], 'mousedown', function () { onMouseDownDrag(i) }))
{ {
isDisabled // isDisabled
isYour || isDone
? {} ? {}
: dragCircleEve.push( : dragCircleEve.push(
naver.maps.Event.addListener( naver.maps.Event.addListener(
@ -741,7 +744,8 @@ export const FlightPlanDraw = props => {
); );
// dragCircleEve.push(naver.maps.Event.addListener(dragCircle[i], 'mousedown', function () { onMouseDownDrag(i) })) // dragCircleEve.push(naver.maps.Event.addListener(dragCircle[i], 'mousedown', function () { onMouseDownDrag(i) }))
{ {
isDisabled // isDisabled
isYour || isDone
? {} ? {}
: dragCircleEve.push( : dragCircleEve.push(
naver.maps.Event.addListener( naver.maps.Event.addListener(
@ -838,7 +842,8 @@ export const FlightPlanDraw = props => {
}); });
// Eve.mousedownEve = naver.maps.Event.addListener(circle, 'mousedown', function () { onMouseDownDrag(0); }) // Eve.mousedownEve = naver.maps.Event.addListener(circle, 'mousedown', function () { onMouseDownDrag(0); })
{ {
isDisabled // isDisabled
isYour || isDone
? {} ? {}
: (Eve.mousedownEve = naver.maps.Event.addListener( : (Eve.mousedownEve = naver.maps.Event.addListener(
circle, circle,

28
src/containers/basis/flight/plan/FlightPlanAreaContainer.js

@ -1,15 +1,15 @@
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { useDispatch, useSelector } from 'react-redux'; import { useDispatch, useSelector } from 'react-redux';
import {Col, Row } from 'reactstrap'; import { Col, Row } from 'reactstrap';
import * as Actions from '../../../../modules/basis/flight/actions/basisFlightAction'; import * as Actions from '../../../../modules/basis/flight/actions/basisFlightAction';
import FlightPlanAreaMap from '../../../../components/basis/flight/plan/FlightPlanAreaMap'; import FlightPlanAreaMap from '../../../../components/basis/flight/plan/FlightPlanAreaMap';
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, test}) => { const FlightPlanAreaContainer = ({ handleModal, test, isDone }) => {
const dispatch = useDispatch(); const dispatch = useDispatch();
const { publicAreaList} = useSelector(state => state.flightState); const { publicAreaList } = useSelector(state => state.flightState);
const [airArea, setAirArea] = useState(null); const [airArea, setAirArea] = useState(null);
useEffect(() => { useEffect(() => {
@ -19,21 +19,20 @@ const FlightPlanAreaContainer = ({handleModal, test}) => {
useEffect(() => { useEffect(() => {
setAirArea(publicAreaList); setAirArea(publicAreaList);
}, [publicAreaList]) }, [publicAreaList]);
const getAirAreaList = () => { const getAirAreaList = () => {
dispatch(Actions.PUBLIC_AREA_LIST.request()); dispatch(Actions.PUBLIC_AREA_LIST.request());
} };
const handleConfirm = (areaList) => { const handleConfirm = areaList => {
if(areaList === undefined) { if (areaList === undefined) {
alert('영역을 설정해 주세요.') alert('영역을 설정해 주세요.');
return false; return false;
} }
dispatch(Actions.AREA_COORDINATE_LIST_SAVE(areaList)) dispatch(Actions.AREA_COORDINATE_LIST_SAVE(areaList));
} };
return ( return (
<Row> <Row>
@ -43,6 +42,7 @@ const FlightPlanAreaContainer = ({handleModal, test}) => {
airArea={airArea} airArea={airArea}
handleConfirm={handleConfirm} handleConfirm={handleConfirm}
test={test} test={test}
isDone={isDone}
/> />
) : null} ) : null}
</Col> </Col>
@ -50,11 +50,11 @@ const FlightPlanAreaContainer = ({handleModal, test}) => {
<FlightPlanAreaDetailContainer <FlightPlanAreaDetailContainer
handleModal={handleModal} handleModal={handleModal}
test={test} test={test}
isDone={isDone}
/> />
</Col> </Col>
</Row> </Row>
);
) };
}
export default FlightPlanAreaContainer; export default FlightPlanAreaContainer;

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

@ -3,34 +3,35 @@ import { useDispatch, useSelector } from 'react-redux';
import { Col, Row, Form } from 'reactstrap'; import { Col, Row, Form } from 'reactstrap';
import * as Actions from '../../../../modules/basis/flight/actions/basisFlightAction'; import * as Actions from '../../../../modules/basis/flight/actions/basisFlightAction';
import FlightPlanAreaDetailForm from '../../../../components/basis/flight/plan/FlightPlanAreaDetailForm'; import FlightPlanAreaDetailForm from '../../../../components/basis/flight/plan/FlightPlanAreaDetailForm';
import {initFlightBas} from '../../../../modules/basis/flight/models/basisFlightModel'; import { initFlightBas } from '../../../../modules/basis/flight/models/basisFlightModel';
import { InfoModal } from '../../../../components/modal/InfoModal'; import { InfoModal } from '../../../../components/modal/InfoModal';
import axios from '../../../../modules/utils/customAxiosUtil'; import axios from '../../../../modules/utils/customAxiosUtil';
const FlightPlanAreaDetailContainer = ({ handleModal, test, isDone }) => {
const FlightPlanAreaDetailContainer = ({ handleModal,test }) => {
const dispatch = useDispatch(); const dispatch = useDispatch();
const mapControl = useSelector(state => state.controlMapReducer); const mapControl = useSelector(state => state.controlMapReducer);
const { areaCoordList, detail } = useSelector(state => state.flightState); const { areaCoordList, detail } = useSelector(state => state.flightState);
const [areaDetail, setAreaDetail] = useState(initFlightBas.initDetail.areaList); const [areaDetail, setAreaDetail] = useState(
initFlightBas.initDetail.areaList
);
const [alertModal, setAlertModal] = useState({ const [alertModal, setAlertModal] = useState({
isOpen: false, isOpen: false,
title: '', title: '',
desc: '' desc: ''
}); });
const handleClose = (status) => { const handleClose = status => {
handleModal({ type: 'area', isOpne: false}); handleModal({ type: 'area', isOpne: false });
} };
const handleSave = async () => { const handleSave = async () => {
const resultAreaDetail = areaDetail.map(area => { const resultAreaDetail = areaDetail.map(area => {
return { return {
...area, ...area,
coordList : areaDetail[0].coordList coordList: areaDetail[0].coordList
} };
}) });
// const resultAreaDetail_api = areaDetail.map((area, i) => { // const resultAreaDetail_api = areaDetail.map((area, i) => {
// let polygonCoord = areaDetail[0].coordList.concat(areaDetail[0].coordList[0]); // let polygonCoord = areaDetail[0].coordList.concat(areaDetail[0].coordList[0]);
@ -50,43 +51,44 @@ const FlightPlanAreaDetailContainer = ({ handleModal,test }) => {
const { data } = await axios.post( const { data } = await axios.post(
// `api/bas/flight/airspace/contains`, resultAreaDetail_api // `api/bas/flight/airspace/contains`, resultAreaDetail_api
`api/bas/flight/airspace/contains`, resultAreaDetail `api/bas/flight/airspace/contains`,
) resultAreaDetail
);
if(data.result) { if (data.result) {
setAlertModal({ setAlertModal({
isOpen: true, isOpen: true,
title: '우회 여부 확인', title: '우회 여부 확인',
desc: '경로상에 비행 금지된 구역이 있습니다.\n우회하여 경로 설정해주시기 바랍니다.' desc: '경로상에 비행 금지된 구역이 있습니다.\n우회하여 경로 설정해주시기 바랍니다.'
}) });
return false; return false;
} }
dispatch(Actions.AREA_DETAIL_LIST_SAVE(resultAreaDetail)); dispatch(Actions.AREA_DETAIL_LIST_SAVE(resultAreaDetail));
handleModal({ type: 'area', isOpne: false}); handleModal({ type: 'area', isOpne: false });
} };
const handleChange = ({ name, value }) => { const handleChange = ({ name, value }) => {
setAreaDetail(prevState => { setAreaDetail(prevState => {
const areaList = prevState.map((area, i) => { const areaList = prevState.map((area, i) => {
return { return {
...area, ...area,
[name] : value [name]: value
} };
}); });
return areaList; return areaList;
}) });
} };
const handleBufferList = () => { const handleBufferList = () => {
dispatch(Actions.FLIGHT_PLAN_AREA_BUFFER_LIST.request(areaDetail)); dispatch(Actions.FLIGHT_PLAN_AREA_BUFFER_LIST.request(areaDetail));
} };
useEffect(() => { useEffect(() => {
// 좌표등록 (등록 시 데이터 초기화) // 좌표등록 (등록 시 데이터 초기화)
if(areaCoordList !== undefined) { if (areaCoordList !== undefined) {
setAreaDetail(areaCoordList); // 새로 만든 영역 setAreaDetail(areaCoordList); // 새로 만든 영역
} }
}, [areaCoordList]); }, [areaCoordList]);
@ -103,7 +105,6 @@ const FlightPlanAreaDetailContainer = ({ handleModal,test }) => {
// }, []) // }, [])
return ( return (
<Row> <Row>
<Col> <Col>
@ -116,12 +117,12 @@ const FlightPlanAreaDetailContainer = ({ handleModal,test }) => {
data={areaDetail} data={areaDetail}
mapControl={mapControl} mapControl={mapControl}
test={test} test={test}
isDone={isDone}
/> />
</Col> </Col>
<InfoModal modal={alertModal} setModal={setAlertModal} /> <InfoModal modal={alertModal} setModal={setAlertModal} />
</Row> </Row>
);
) };
}
export default FlightPlanAreaDetailContainer; export default FlightPlanAreaDetailContainer;

219
src/containers/basis/flight/plan/FlightPlanDetailContainer.js

@ -4,25 +4,26 @@ import { CustomDetailLayout } from '../../../../components/layout/CustomDetailLa
import { useHistory, useLocation, useParams } from 'react-router-dom'; import { useHistory, useLocation, useParams } from 'react-router-dom';
import { useDispatch, useSelector } from 'react-redux'; import { useDispatch, useSelector } from 'react-redux';
import * as Actions from '../../../../modules/basis/flight/actions/basisFlightAction'; import * as Actions from '../../../../modules/basis/flight/actions/basisFlightAction';
import { initFlight, initFlightBas } from '../../../../modules/basis/flight/models/basisFlightModel'; import {
initFlight,
initFlightBas
} from '../../../../modules/basis/flight/models/basisFlightModel';
import { AiFillPropertySafety } from 'react-icons/ai'; import { AiFillPropertySafety } from 'react-icons/ai';
import { ErrorModal } from '../../../../components/modal/ErrorModal'; import { ErrorModal } from '../../../../components/modal/ErrorModal';
import { CgArrowLeftR } from 'react-icons/cg'; import { CgArrowLeftR } from 'react-icons/cg';
const initModal = { const initModal = {
area: false, area: false,
pilot: false, pilot: false,
arcrft: false arcrft: false
} };
const FlightPlanDetailContainer = () => { const FlightPlanDetailContainer = () => {
const dispatch = useDispatch(); const dispatch = useDispatch();
const history = useHistory();
const location = useLocation();
const urlParams = useParams(); const urlParams = useParams();
const flightState = useSelector(state => state.flightState); const flightState = useSelector(state => state.flightState);
const { detail, pilotSelect, arcrftSelect, areaList, selectGroup } = flightState; const { detail, pilotSelect, arcrftSelect, areaList, selectGroup } =
flightState;
const [modal, setModal] = useState(initModal); const [modal, setModal] = useState(initModal);
const [detailData, setDetailData] = useState(initFlightBas.initDetail); const [detailData, setDetailData] = useState(initFlightBas.initDetail);
//모달 관련 설정 //모달 관련 설정
@ -32,18 +33,41 @@ const FlightPlanDetailContainer = () => {
desc: '' desc: ''
}); });
const [date, setDate] = useState();
const [isDone, setIsDone] = useState();
useEffect(() => {
setDate('');
}, []);
useEffect(() => {
if (date) {
let cTime = new Date();
let pTime = new Date(date);
if (cTime > pTime) {
setIsDone(true);
} else {
setIsDone(false);
}
}
}, [date]);
useEffect(() => { useEffect(() => {
if (Object.keys(urlParams).length === 0 && urlParams.constructor === Object) return; if (Object.keys(urlParams).length === 0 && urlParams.constructor === Object)
return;
dispatch(Actions.FLIGHT_PLAN_DETAIL.request(urlParams.planSno)); dispatch(Actions.FLIGHT_PLAN_DETAIL.request(urlParams.planSno));
}, [urlParams]) }, [urlParams]);
useEffect(() => { useEffect(() => {
if (detail.createDt) {
setDate(detail.schFltStDt);
}
setDetailData({ setDetailData({
...detail, ...detail,
cstmrSno: sessionStorage.getItem('cstmrSno'), cstmrSno: sessionStorage.getItem('cstmrSno'),
groupId: sessionStorage.getItem('groupId'), groupId: sessionStorage.getItem('groupId')
}); });
}, [detail]) }, [detail]);
useEffect(() => { useEffect(() => {
if (pilotSelect !== undefined) { if (pilotSelect !== undefined) {
@ -59,7 +83,7 @@ const FlightPlanDetailContainer = () => {
pilot.hpno = pilotSelect.hpno; pilot.hpno = pilotSelect.hpno;
// 파일럿 중복 확인 // 파일럿 중복 확인
let checking = true let checking = true;
pilotList.forEach((p, i) => { pilotList.forEach((p, i) => {
if (p.cstmrSno === pilotSelect.cstmrSno) { if (p.cstmrSno === pilotSelect.cstmrSno) {
@ -84,12 +108,11 @@ const FlightPlanDetailContainer = () => {
return { return {
...prevState, ...prevState,
['pilotList']: pilotList ['pilotList']: pilotList
} };
}); });
} }
} }
}, [pilotSelect]);
}, [pilotSelect])
useEffect(() => { useEffect(() => {
if (arcrftSelect !== undefined) { if (arcrftSelect !== undefined) {
@ -131,11 +154,11 @@ const FlightPlanDetailContainer = () => {
return { return {
...prevState, ...prevState,
['arcrftList']: arcrftList ['arcrftList']: arcrftList
} };
}) });
} }
} }
}, [arcrftSelect]) }, [arcrftSelect]);
useEffect(() => { useEffect(() => {
if (areaList !== undefined) { if (areaList !== undefined) {
@ -151,8 +174,8 @@ const FlightPlanDetailContainer = () => {
...coord, ...coord,
planAreaSno: area.planAreaSno, planAreaSno: area.planAreaSno,
planAreaCoordSno: 0 planAreaCoordSno: 0
} };
}) });
} }
return { return {
@ -162,19 +185,18 @@ const FlightPlanDetailContainer = () => {
fltElev: targetArea.fltElev ? targetArea.fltElev : 0, fltElev: targetArea.fltElev ? targetArea.fltElev : 0,
fltMethod: targetArea.fltMethod ? targetArea.fltMethod : '', fltMethod: targetArea.fltMethod ? targetArea.fltMethod : '',
coordList: targetCoordList coordList: targetCoordList
} };
}); });
setDetailData(prevState => { setDetailData(prevState => {
return { return {
...prevState, ...prevState,
['areaList']: createAreaList ['areaList']: createAreaList
} };
}) });
// dispatch(Actions.AREA_DETAIL_INIT()); // dispatch(Actions.AREA_DETAIL_INIT());
} }
}, [areaList]); }, [areaList]);
useEffect(() => { useEffect(() => {
@ -182,18 +204,20 @@ const FlightPlanDetailContainer = () => {
dispatch(Actions.PILOT_ARCRFT_SELECT_INIT()); dispatch(Actions.PILOT_ARCRFT_SELECT_INIT());
}, [flightState]); }, [flightState]);
const handleModal = (modal) => { const handleModal = modal => {
if (modal.target === 'area' && modal.isOpen) { if (modal.target === 'area' && modal.isOpen) {
if (detailData.areaList) { if (detailData.areaList) {
dispatch(Actions.FLIGHT_PLAN_AREA_BUFFER_LIST.request(detailData.areaList)); dispatch(
Actions.FLIGHT_PLAN_AREA_BUFFER_LIST.request(detailData.areaList)
);
} }
} }
setModal(prevState => ({ setModal(prevState => ({
...initModal, ...initModal,
[modal.target]: modal.isOpen [modal.target]: modal.isOpen
})) }));
} };
// 변경감지 // 변경감지
const handleChange = ({ name, value, type, index, pIndex }) => { const handleChange = ({ name, value, type, index, pIndex }) => {
@ -202,9 +226,9 @@ const FlightPlanDetailContainer = () => {
case 'coord': case 'coord':
// TODO 추후 삭제 필요 start // TODO 추후 삭제 필요 start
if (name == 'lonlat') { if (name == 'lonlat') {
const values = value.split("/"); const values = value.split('/');
let latValue = 1 let latValue = 1;
let lonValue = 1 let lonValue = 1;
if (values.length == 1) { if (values.length == 1) {
latValue = values[0].trim(); latValue = values[0].trim();
} else if (values.length == 2) { } else if (values.length == 2) {
@ -223,18 +247,18 @@ const FlightPlanDetailContainer = () => {
...coord, ...coord,
lat: latValue, lat: latValue,
lon: lonValue lon: lonValue
} };
}) });
return { return {
...area, ...area,
coordList coordList
} };
}) });
return { return {
...prevState, ...prevState,
areaList areaList
} };
}) });
return; return;
} }
// TODO 추후 삭제 필요 end // TODO 추후 삭제 필요 end
@ -245,14 +269,14 @@ const FlightPlanDetailContainer = () => {
const updateData = { const updateData = {
...coordArr[index], ...coordArr[index],
[name]: value [name]: value
} };
coordArr[index] = updateData; coordArr[index] = updateData;
areaArr[pIndex] = coordArr areaArr[pIndex] = coordArr;
return { return {
...prevState, ...prevState,
areaList: areaArr areaList: areaArr
} };
}) });
break; break;
case 'area': case 'area':
case 'pilot': case 'pilot':
@ -262,23 +286,23 @@ const FlightPlanDetailContainer = () => {
const updateData = { const updateData = {
...prevState[arrName][index], ...prevState[arrName][index],
[name]: value [name]: value
} };
arr[index] = updateData; arr[index] = updateData;
return { return {
...prevState, ...prevState,
[arrName]: arr [arrName]: arr
} };
}) });
break; break;
case 'plan': case 'plan':
default: default:
setDetailData(prevState => ({ setDetailData(prevState => ({
...prevState, ...prevState,
[name]: value [name]: value
})) }));
break; break;
} }
} };
// 추가 // 추가
const handleAddArray = ({ type, pIndex }) => { const handleAddArray = ({ type, pIndex }) => {
@ -292,8 +316,8 @@ const FlightPlanDetailContainer = () => {
return { return {
...prevState, ...prevState,
areaList: [...areaArr] areaList: [...areaArr]
} };
}) });
break; break;
case 'area': case 'area':
case 'pilot': case 'pilot':
@ -301,21 +325,21 @@ const FlightPlanDetailContainer = () => {
return { return {
...prevState, ...prevState,
[arrName]: [...prevState[arrName], initFlightBas[type]] [arrName]: [...prevState[arrName], initFlightBas[type]]
} };
}) });
break; break;
case 'arcrft': case 'arcrft':
setDetailData(prevState => { setDetailData(prevState => {
return { return {
...prevState, ...prevState,
[arrName]: [...prevState[arrName], initFlightBas[type]] [arrName]: [...prevState[arrName], initFlightBas[type]]
} };
}) });
break; break;
default: default:
break; break;
} }
} };
// 삭제 // 삭제
const handleDeleteArray = ({ type, index, pIndex }) => { const handleDeleteArray = ({ type, index, pIndex }) => {
const arrName = `${type}List`; const arrName = `${type}List`;
@ -329,8 +353,8 @@ const FlightPlanDetailContainer = () => {
return { return {
...prevState, ...prevState,
areaList: [...areaArr] areaList: [...areaArr]
} };
}) });
break; break;
case 'area': case 'area':
case 'pilot': case 'pilot':
@ -338,49 +362,48 @@ const FlightPlanDetailContainer = () => {
const arr = [...prevState[arrName]]; const arr = [...prevState[arrName]];
const deleteData = arr.splice(index, 1); const deleteData = arr.splice(index, 1);
const id = initFlight.detail['pilotList'] const id = initFlight.detail['pilotList'];
if (arr.length > 0) { if (arr.length > 0) {
return { return {
...prevState, ...prevState,
[arrName]: arr [arrName]: arr
} };
} } else {
else {
return { return {
...prevState, ...prevState,
[arrName]: id [arrName]: id
};
} }
} });
})
break; break;
case 'arcrft': case 'arcrft':
setDetailData(prevState => { setDetailData(prevState => {
const arr = [...prevState[arrName]]; const arr = [...prevState[arrName]];
const deleteData = arr.splice(index, 1); const deleteData = arr.splice(index, 1);
const id = initFlight.detail['arcrftList'] const id = initFlight.detail['arcrftList'];
if (arr.length > 0) { if (arr.length > 0) {
return { return {
...prevState, ...prevState,
[arrName]: arr [arrName]: arr
} };
} } else {
else {
return { return {
...prevState, ...prevState,
[arrName]: id [arrName]: id
};
} }
} });
})
break; break;
default: default:
break; break;
} }
} };
// 저장 // 저장
const handleSave = () => { const handleSave = () => {
const reg_email = /^([0-9a-zA-Z_\.-]+)@([0-9a-zA-Z_-]+)(\.[0-9a-zA-Z_-]+){1,2}$/; const reg_email =
/^([0-9a-zA-Z_\.-]+)@([0-9a-zA-Z_-]+)(\.[0-9a-zA-Z_-]+){1,2}$/;
const check_num = /[0-9]/; const check_num = /[0-9]/;
const check_kor = const check_kor =
/^[가-힣a-zA-Z0-9][^!@#$%^&*()+\=\[\]{};':"\\|,.<>\/?\s]*$/; /^[가-힣a-zA-Z0-9][^!@#$%^&*()+\=\[\]{};':"\\|,.<>\/?\s]*$/;
@ -393,9 +416,7 @@ const FlightPlanDetailContainer = () => {
}); });
return false; return false;
} } else if (!detailData.hpno) {
else if (!detailData.hpno) {
setModal2({ setModal2({
isOpen: true, isOpen: true,
title: '필수값 입력 오류', title: '필수값 입력 오류',
@ -403,9 +424,7 @@ const FlightPlanDetailContainer = () => {
}); });
return false; return false;
} } else if (!detailData.email) {
else if (!detailData.email) {
setModal2({ setModal2({
isOpen: true, isOpen: true,
title: '필수값 입력 오류', title: '필수값 입력 오류',
@ -413,8 +432,7 @@ const FlightPlanDetailContainer = () => {
}); });
return false; return false;
} } else if (!detailData.fltPurpose) {
else if (!detailData.fltPurpose) {
setModal2({ setModal2({
isOpen: true, isOpen: true,
title: '필수값 입력 오류', title: '필수값 입력 오류',
@ -422,8 +440,7 @@ const FlightPlanDetailContainer = () => {
}); });
return false; return false;
} } else if (!detailData.areaList[0].coordList[0].lat) {
else if (!detailData.areaList[0].coordList[0].lat) {
setModal2({ setModal2({
isOpen: true, isOpen: true,
title: '필수값 입력 오류', title: '필수값 입력 오류',
@ -431,8 +448,7 @@ const FlightPlanDetailContainer = () => {
}); });
return false; return false;
} } else if (!detailData.areaList[0].fltElev) {
else if (!detailData.areaList[0].fltElev) {
setModal2({ setModal2({
isOpen: true, isOpen: true,
title: '필수값 입력 오류', title: '필수값 입력 오류',
@ -440,8 +456,7 @@ const FlightPlanDetailContainer = () => {
}); });
return false; return false;
} } else if (!detailData.areaList[0].fltMethod) {
else if (!detailData.areaList[0].fltMethod) {
setModal2({ setModal2({
isOpen: true, isOpen: true,
title: '필수값 입력 오류', title: '필수값 입력 오류',
@ -449,8 +464,7 @@ const FlightPlanDetailContainer = () => {
}); });
return false; return false;
} } else if (!detailData.pilotList[0].groupNm) {
else if (!detailData.pilotList[0].groupNm) {
setModal2({ setModal2({
isOpen: true, isOpen: true,
title: '필수값 입력 오류', title: '필수값 입력 오류',
@ -458,8 +472,7 @@ const FlightPlanDetailContainer = () => {
}); });
return false; return false;
} } else if (!detailData.arcrftList[0].groupNm) {
else if (!detailData.arcrftList[0].groupNm) {
setModal2({ setModal2({
isOpen: true, isOpen: true,
title: '필수값 입력 오류', title: '필수값 입력 오류',
@ -467,16 +480,14 @@ const FlightPlanDetailContainer = () => {
}); });
return false; return false;
} } else if (!check_kor.test(detailData.memberName)) {
else if (!check_kor.test(detailData.memberName)) {
setModal2({ setModal2({
isOpen: true, isOpen: true,
title: '필수값 입력 오류', title: '필수값 입력 오류',
desc: '지원하지 않는 입력값 입니다.' desc: '지원하지 않는 입력값 입니다.'
}); });
return false; return false;
} } else if (!check_num.test(detailData.hpno)) {
else if (!check_num.test(detailData.hpno)) {
setModal2({ setModal2({
isOpen: true, isOpen: true,
title: '필수값 입력 오류', title: '필수값 입력 오류',
@ -488,7 +499,7 @@ const FlightPlanDetailContainer = () => {
setModal2({ setModal2({
isOpen: true, isOpen: true,
title: '필수값 입력 오류', title: '필수값 입력 오류',
desc: '이메일 형식을 다시 확인해 주세요.', desc: '이메일 형식을 다시 확인해 주세요.'
}); });
return false; return false;
} }
@ -498,19 +509,30 @@ const FlightPlanDetailContainer = () => {
dispatch(Actions.FLIGHT_PLAN_UPDATE.request(detailData)); dispatch(Actions.FLIGHT_PLAN_UPDATE.request(detailData));
} }
dispatch(Actions.FLIGHT_PLAN_GROUP_SELECT({ cstmrSno: 0, groupId: '', groupNm: '' })); dispatch(
} Actions.FLIGHT_PLAN_GROUP_SELECT({
cstmrSno: 0,
groupId: '',
groupNm: ''
})
);
};
// 삭제 // 삭제
const handleDelete = () => { const handleDelete = () => {
if (!urlParams.planSno || urlParams.planSno) { if (!urlParams.planSno || urlParams.planSno) {
dispatch(Actions.FLIGHT_PLAN_DELETE.request(urlParams.planSno)); dispatch(Actions.FLIGHT_PLAN_DELETE.request(urlParams.planSno));
} }
dispatch(Actions.FLIGHT_PLAN_GROUP_SELECT({ cstmrSno: 0, groupId: '', groupNm: '' })); dispatch(
} Actions.FLIGHT_PLAN_GROUP_SELECT({
cstmrSno: 0,
groupId: '',
groupNm: ''
})
);
};
return ( return (
<CustomDetailLayout title={"비행 계획 신청서"}> <CustomDetailLayout title={'비행 계획 신청서'}>
<FlightPlanForm <FlightPlanForm
modal={modal} modal={modal}
data={detailData} data={detailData}
@ -520,6 +542,7 @@ const FlightPlanDetailContainer = () => {
handleChange={handleChange} handleChange={handleChange}
handleAddArray={handleAddArray} handleAddArray={handleAddArray}
handleDeleteArray={handleDeleteArray} handleDeleteArray={handleDeleteArray}
isDone={isDone}
// handlerSave={ // handlerSave={
// pageType === 'create' ? handlerCreate : handlerUpdate // pageType === 'create' ? handlerCreate : handlerUpdate
// } // }
@ -534,7 +557,7 @@ const FlightPlanDetailContainer = () => {
{/* setModal={setModal}*/} {/* setModal={setModal}*/}
{/*/>*/} {/*/>*/}
</CustomDetailLayout> </CustomDetailLayout>
) );
}; };
export default FlightPlanDetailContainer; export default FlightPlanDetailContainer;

Loading…
Cancel
Save