Browse Source

비행계획서 신청(수정불가)

feature/auth
sanguu 2 years ago
parent
commit
27c7cbda39
  1. 64
      src/components/basis/flight/plan/FlightPlanAreaDetailForm.js
  2. 14
      src/components/basis/flight/plan/FlightPlanAreaMap.js
  3. 155
      src/components/basis/flight/plan/FlightPlanForm.js
  4. 3
      src/containers/basis/flight/plan/FlightPlanAreaDetailContainer.js

64
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, test }) => {
const coordList = data ? data[0].coordList : null; const coordList = data ? data[0].coordList : null;
@ -43,7 +43,7 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl
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'
@ -86,34 +86,64 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl
<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'><span className='necessary'>*</span>(m)</Label>
{test ?
<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={test}
placeholder='반경'
value={data[0].bufferZone ? data[0].bufferZone : ''}
onChange={(e) => {
const { name, value } = e.target;
handleChange({
name,
value
})
}}
/>
:
<Input
type='text'
id='bufferZone'
name='bufferZone'
bsSize='sm'
readOnly={coordList[0].lat && (data[0].areaType && data[0].areaType != ("POLYGON")) ? false : true}
placeholder='반경' placeholder='반경'
value={data[0].bufferZone ? data[0].bufferZone : ''} value={data[0].bufferZone ? data[0].bufferZone : ''}
onChange={(e) => { 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 ?
<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={test}
onClick={() => handleBufferList()} onClick={() => handleBufferList()}
> >
적용 적용
</Button.Ripple> </Button.Ripple>
:
<Button.Ripple
className='mr-1'
color='primary'
size='sm'
disabled={coordList[0].lat && (data[0].areaType && data[0].areaType != ("POLYGON")) ? false : true}
onClick={() => handleBufferList()}
>
적용
</Button.Ripple>
}
</div> </div>
</FormGroup> </FormGroup>
</Col> </Col>
@ -124,7 +154,9 @@ 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> <FormGroup>
<Label for='test'><span className='necessary'>*</span>(ft)</Label> <Label for='test'><span className='necessary'>*</span>(ft)</Label>
<Input <Input
readOnly={test}
type='text' type='text'
id='fltElev' id='fltElev'
name='fltElev' name='fltElev'
@ -132,7 +164,7 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl
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
@ -149,6 +181,7 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl
<FormGroup> <FormGroup>
<Label for='test'><span className='necessary'>*</span> </Label> <Label for='test'><span className='necessary'>*</span> </Label>
<Input <Input
readOnly={test}
type='text' type='text'
id='fltMethod' id='fltMethod'
name='fltMethod' name='fltMethod'
@ -156,7 +189,7 @@ const FlightPlanAreaDetailForm = ({ handleSave, handleClose, handleChange, handl
placeholder='비행 방식' placeholder='비행 방식'
value={data[0].fltMethod ? data[0].fltMethod : ''} value={data[0].fltMethod ? data[0].fltMethod : ''}
onChange={(e) => { onChange={(e) => {
const {name, value} = e.target; const { name, value } = e.target;
handleChange({ handleChange({
name, name,
value value
@ -172,15 +205,28 @@ 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 ?
<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={!coordList[0].lat ? true : false }
disabled={test}
> >
등록 등록
</Button.Ripple> </Button.Ripple>
:
<Button.Ripple
type='submit'
className='mr-1'
color='primary'
onClick={e => handleSave()}
disabled={!coordList[0].lat ? true : false}
>
등록
</Button.Ripple>
}
<Button.Ripple <Button.Ripple
className='mr-1' className='mr-1'
color='primary' color='primary'

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

@ -171,11 +171,12 @@ const FlightPlanAreaMap = (props) => {
color='primary' color='primary'
className='area-button' className='area-button'
onClick={e => handlerDrawType('RESET')} onClick={e => handlerDrawType('RESET')}
{...props.test? ( // {...props.test? (
{} // {}
):( // ):(
{disabled:true} // {disabled:false}
)} // )}
disabled={props.test}
> >
초기화 초기화
</Button.Ripple> </Button.Ripple>
@ -192,6 +193,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}
> >
WayPoint WayPoint
</Button.Ripple> </Button.Ripple>
@ -199,12 +201,14 @@ const FlightPlanAreaMap = (props) => {
className='mr-1' className='mr-1'
color='primary' color='primary'
onClick={e => handlerDrawType('CIRCLE')} onClick={e => handlerDrawType('CIRCLE')}
disabled={props.test}
> >
Circle Circle
</Button.Ripple> </Button.Ripple>
<Button.Ripple <Button.Ripple
color='primary' color='primary'
onClick={e => handlerDrawType('POLYGON')} onClick={e => handlerDrawType('POLYGON')}
disabled={props.test}
> >
Polygon Polygon
</Button.Ripple> </Button.Ripple>

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

@ -12,7 +12,7 @@ import {
import Flatpickr from 'react-flatpickr'; import Flatpickr from 'react-flatpickr';
import '@styles/react/libs/flatpickr/flatpickr.scss'; import '@styles/react/libs/flatpickr/flatpickr.scss';
import moment from 'moment'; import moment from 'moment';
import {initFlight, initFlightBas} from '../../../../modules/basis/flight/models/basisFlightModel'; import { initFlight, initFlightBas } from '../../../../modules/basis/flight/models/basisFlightModel';
import FlightPlanPilotContainer from '../../../../containers/basis/flight/plan/FlightPlanPilotContainer'; import FlightPlanPilotContainer from '../../../../containers/basis/flight/plan/FlightPlanPilotContainer';
import { FlightPlanModal } from './FlightPlanModal'; import { FlightPlanModal } from './FlightPlanModal';
import FlightPlanArcrftContainer from '../../../../containers/basis/flight/plan/FlightPlanArcrftContainer'; import FlightPlanArcrftContainer from '../../../../containers/basis/flight/plan/FlightPlanArcrftContainer';
@ -22,32 +22,30 @@ import { useSelector } from 'react-redux';
import { shallowEqual } from 'react-redux'; import { shallowEqual } from 'react-redux';
const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDelete, modal, handleDeleteArray }) => { const FlightPlanForm = ({ data, handleModal, handleChange, handleSave, handleDelete, modal, handleDeleteArray }) => {
const {areaList, pilotList, arcrftList} = data; const { areaList, pilotList, arcrftList } = data;
const { detail } = useSelector(state => state.flightState);
const [date ,setDate] = useState(); const [date, setDate] = useState();
const [isFlightDone, setIsFlightDone] = useState(); const [isFlightDone, setIsFlightDone] = useState();
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);
useEffect(() => { useEffect(() => {
if(detail.createDt) { if (detail.createDt) {
setDate(detail.schFltStDt); setDate(detail.schFltStDt);
} }
if(detail?.createUserId == user?.cstmrSno) { if (detail?.createUserId == user?.cstmrSno || !detail.createUserId) {
// console.log(true) // console.log(true)
setTest(true) setTest(false)
} else { } else {
// console.log(false) // console.log(false)
setTest(false) setTest(true)
} }
console.log(detail.createUserId, '생성')
console.log(user.cstmrSno, '로그인')
}, [detail]) }, [detail])
useEffect(() => { useEffect(() => {
@ -55,10 +53,10 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
}, []) }, [])
useEffect(() => { useEffect(() => {
if(date) { if (date) {
let cTime = new Date(); let cTime = new Date();
let pTime = new Date(date) let pTime = new Date(date)
if(cTime > pTime) { if (cTime > pTime) {
setIsFlightDone(true); setIsFlightDone(true);
} else { } else {
setIsFlightDone(false); setIsFlightDone(false);
@ -95,13 +93,14 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
<Label for='test'><span <Label for='test'><span
className='necessary'>*</span></Label> className='necessary'>*</span></Label>
<Input <Input
readOnly={test}
type='text' type='text'
id='memberName' id='memberName'
name='memberName' name='memberName'
// defaultValue={data.memberName} // defaultValue={data.memberName}
value={data.memberName || ''} value={data.memberName || ''}
onChange={(e) => { onChange={(e) => {
const {name, value} = e.target; const { name, value } = e.target;
handleChange({ handleChange({
type: 'plan', type: 'plan',
name, name,
@ -130,18 +129,18 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
bsSize='sm' bsSize='sm'
placeholder='+82' placeholder='+82'
onChange={(e) => { onChange={(e) => {
const {name, value} = e.target; const { name, value } = e.target;
handleChange({ handleChange({
type: 'plan', type: 'plan',
name, name,
value, value,
}) })
}} }}
readOnly readOnly />
/>
</div> </div>
<div className='m_ft_box'> <div className='m_ft_box'>
<Input <Input
readOnly={test}
type='text' type='text'
id='hpno' id='hpno'
name='hpno' name='hpno'
@ -149,7 +148,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
value={data.hpno || ''} value={data.hpno || ''}
bsSize='sm' bsSize='sm'
onChange={(e) => { onChange={(e) => {
const {name, value} = e.target; const { name, value } = e.target;
handleChange({ handleChange({
type: 'plan', type: 'plan',
name, name,
@ -166,6 +165,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
<Label for='test'><span <Label for='test'><span
className='necessary'>*</span></Label> className='necessary'>*</span></Label>
<Input <Input
readOnly={test}
type='text' type='text'
id='email' id='email'
name='email' name='email'
@ -173,7 +173,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
// value={data.email} // value={data.email}
bsSize='sm' bsSize='sm'
onChange={(e) => { onChange={(e) => {
const {name, value} = e.target; const { name, value } = e.target;
handleChange({ handleChange({
type: 'plan', type: 'plan',
name, name,
@ -237,6 +237,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
) )
} */} } */}
<Flatpickr <Flatpickr
disabled={test}
size='sm' size='sm'
className='form-control calendar-flat' className='form-control calendar-flat'
type='text' type='text'
@ -301,6 +302,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
) )
} */} } */}
<Flatpickr <Flatpickr
disabled={test}
size='sm' size='sm'
className='form-control calendar-flat' className='form-control calendar-flat'
type='text' type='text'
@ -328,13 +330,14 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
<span className='necessary'>*</span> <span className='necessary'>*</span>
</Label> </Label>
<Input <Input
disabled={test}
type='select' type='select'
id='fltPurpose' id='fltPurpose'
name='fltPurpose' name='fltPurpose'
value={data.fltPurpose} value={data.fltPurpose}
bsSize='sm' bsSize='sm'
onChange={(e) => { onChange={(e) => {
const {name, value} = e.target; const { name, value } = e.target;
handleChange({ handleChange({
type: 'plan', type: 'plan',
name, name,
@ -367,7 +370,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
<Button.Ripple <Button.Ripple
color="primary" color="primary"
onClick={(e) => { onClick={(e) => {
handleModal({target: 'area', isOpen: true}) handleModal({ target: 'area', isOpen: true })
}} }}
> >
비행 구역 설정 비행 구역 설정
@ -378,15 +381,16 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
<AreaForm key={i} index={i} data={item} <AreaForm key={i} index={i} data={item}
handleChange={handleChange} />) handleChange={handleChange} />)
: <AreaForm data={initFlightBas.area} : <AreaForm data={initFlightBas.area}
handleChange={handleChange}/>} handleChange={handleChange} />}
</dt> </dt>
<dt> <dt>
<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}
color="primary" color="primary"
onClick={(e) => { onClick={(e) => {
handleModal({target: 'pilot', isOpen: true}) handleModal({ target: 'pilot', isOpen: true })
}} }}
> >
조종사 조회 조종사 조회
@ -398,18 +402,19 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
index={i} index={i}
data={item} data={item}
handleChange={handleChange} handleChange={handleChange}
handleDeleteArray ={handleDeleteArray} handleDeleteArray={handleDeleteArray}
/>) />)
: <PilotForm data={initFlightBas.pilot} : <PilotForm data={initFlightBas.pilot}
handleChange={handleChange}/>} handleChange={handleChange} />}
</dt> </dt>
<dt> <dt>
<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}
color="primary" color="primary"
onClick={(e) => { onClick={(e) => {
handleModal({target: 'arcrft', isOpen: true}); handleModal({ target: 'arcrft', isOpen: true });
}} }}
> >
기체 조회 기체 조회
@ -421,11 +426,11 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
index={i} index={i}
data={item} data={item}
handleChange={handleChange} handleChange={handleChange}
handleDeleteArray ={handleDeleteArray} handleDeleteArray={handleDeleteArray}
/>) />)
: <ArcrftForm data={initFlightBas.arcrft} : <ArcrftForm data={initFlightBas.arcrft}
handleChange={handleChange}/>} handleChange={handleChange} />}
</dt> </dt>
<div className='d-flex align-items-center'> <div className='d-flex align-items-center'>
@ -467,39 +472,39 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
export default FlightPlanForm; export default FlightPlanForm;
const SelectModal = ({handleModal, modal, test}) => { const SelectModal = ({ handleModal, modal, test }) => {
let title = ''; let title = '';
let description = ''; let description = '';
let type = ''; let type = '';
let isOpen = false; let isOpen = false;
if(modal.pilot) { if (modal.pilot) {
isOpen = modal.pilot; isOpen = modal.pilot;
title = '조종사 조회'; title = '조종사 조회';
type = 'pilot'; type = 'pilot';
description = <FlightPlanPilotContainer handleModal={handleModal} type={type} /> description = <FlightPlanPilotContainer handleModal={handleModal} type={type} />
} }
if(modal.arcrft) { if (modal.arcrft) {
isOpen = modal.arcrft; isOpen = modal.arcrft;
title = '기체 조회'; title = '기체 조회';
type = 'arcrft'; type = 'arcrft';
description = <FlightPlanArcrftContainer handleModal={handleModal} type={type} />; description = <FlightPlanArcrftContainer handleModal={handleModal} type={type} />;
} }
if(modal.area) { if (modal.area) {
isOpen = modal.area; isOpen = modal.area;
title = '비행 구역 설정'; title = '비행 구역 설정';
type = 'area'; type = 'area';
description = <FlightPlanAreaContainer handleModal={handleModal} type={type} test={test}/>; description = <FlightPlanAreaContainer handleModal={handleModal} type={type} test={test} />;
} }
return ( return (
<FlightPlanModal <FlightPlanModal
title = {title} title={title}
description = {description} description={description}
type = {type} type={type}
isOpen = {isOpen} isOpen={isOpen}
handleModal={handleModal} handleModal={handleModal}
/> />
) )
@ -507,7 +512,7 @@ const SelectModal = ({handleModal, modal, test}) => {
} }
const AreaForm = ({data, handleChange, index}) => { const AreaForm = ({ data, handleChange, index }) => {
return (<div className='search-info-box'> return (<div className='search-info-box'>
<Row> <Row>
@ -547,7 +552,7 @@ const AreaForm = ({data, handleChange, index}) => {
bsSize='sm' bsSize='sm'
placeholder='-!!' placeholder='-!!'
onChange={(e) => { onChange={(e) => {
const {name, value} = e.target; const { name, value } = e.target;
handleChange({ handleChange({
type: 'coord', type: 'coord',
name, name,
@ -577,7 +582,7 @@ const AreaForm = ({data, handleChange, index}) => {
bsSize='sm' bsSize='sm'
placeholder='반경' placeholder='반경'
onChange={(e) => { onChange={(e) => {
const {name, value} = e.target; const { name, value } = e.target;
handleChange({ handleChange({
type: 'area', type: 'area',
name, name,
@ -598,7 +603,7 @@ const AreaForm = ({data, handleChange, index}) => {
bsSize='sm' bsSize='sm'
placeholder='고도' placeholder='고도'
onChange={(e) => { onChange={(e) => {
const {name, value} = e.target; const { name, value } = e.target;
handleChange({ handleChange({
type: 'area', type: 'area',
name, name,
@ -625,7 +630,7 @@ const AreaForm = ({data, handleChange, index}) => {
bsSize='sm' bsSize='sm'
placeholder='' placeholder=''
onChange={(e) => { onChange={(e) => {
const {name, value} = e.target; const { name, value } = e.target;
handleChange({ handleChange({
type: 'area', type: 'area',
name, name,
@ -640,7 +645,24 @@ const AreaForm = ({data, handleChange, index}) => {
</Row> </Row>
</div>) </div>)
} }
const PilotForm = ({data, handleChange, index, handleDeleteArray}) => { const PilotForm = ({ data, handleChange, index, handleDeleteArray }) => {
const [test, setTest] = useState();
const { user } = useSelector(state => state.authState, shallowEqual);
const { detail } = useSelector(state => state.flightState);
useEffect(() => {
if (detail?.createUserId == user?.cstmrSno || !detail.createUserId) {
// console.log(true)
setTest(false)
} else {
// console.log(false)
setTest(true)
}
}, [detail])
return (<div className='search-info-box'> return (<div className='search-info-box'>
<Row> <Row>
<Col className='list-input' lg={4} md={6} sm={12}> <Col className='list-input' lg={4} md={6} sm={12}>
@ -649,6 +671,7 @@ const PilotForm = ({data, handleChange, index, handleDeleteArray}) => {
<span className='necessary'>*</span> <span className='necessary'>*</span>
</Label> </Label>
<Input <Input
type='text' type='text'
id='memberName' id='memberName'
name='memberName' name='memberName'
@ -657,7 +680,7 @@ const PilotForm = ({data, handleChange, index, handleDeleteArray}) => {
bsSize='sm' bsSize='sm'
placeholder='' placeholder=''
onChange={(e) => { onChange={(e) => {
const {name, value} = e.target; const { name, value } = e.target;
handleChange({ handleChange({
type: 'pilot', type: 'pilot',
name, name,
@ -666,7 +689,6 @@ const PilotForm = ({data, handleChange, index, handleDeleteArray}) => {
}) })
}} }}
readOnly readOnly
/> />
</FormGroup> </FormGroup>
</Col> </Col>
@ -685,7 +707,7 @@ const PilotForm = ({data, handleChange, index, handleDeleteArray}) => {
bsSize='sm' bsSize='sm'
placeholder='+82' placeholder='+82'
onChange={(e) => { onChange={(e) => {
const {name, value} = e.target; const { name, value } = e.target;
handleChange({ handleChange({
type: 'pilot', type: 'pilot',
name, name,
@ -706,7 +728,7 @@ const PilotForm = ({data, handleChange, index, handleDeleteArray}) => {
bsSize='sm' bsSize='sm'
placeholder='010-0000-0000' placeholder='010-0000-0000'
onChange={(e) => { onChange={(e) => {
const {name, value} = e.target; const { name, value } = e.target;
handleChange({ handleChange({
type: 'pilot', type: 'pilot',
name, name,
@ -734,7 +756,7 @@ const PilotForm = ({data, handleChange, index, handleDeleteArray}) => {
bsSize='sm' bsSize='sm'
placeholder='' placeholder=''
onChange={(e) => { onChange={(e) => {
const {name, value} = e.target; const { name, value } = e.target;
handleChange({ handleChange({
type: 'pilot', type: 'pilot',
name, name,
@ -748,9 +770,10 @@ const PilotForm = ({data, handleChange, index, handleDeleteArray}) => {
</FormGroup> </FormGroup>
</Col> </Col>
<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}
color='danger' color='danger'
className='btn-icon' className='btn-icon'
onClick={() => onClick={() =>
@ -772,7 +795,23 @@ const PilotForm = ({data, handleChange, index, handleDeleteArray}) => {
} }
const ArcrftForm = ({data, handleChange, index, handleDeleteArray}) => { const ArcrftForm = ({ data, handleChange, index, handleDeleteArray }) => {
const [test, setTest] = useState();
const { user } = useSelector(state => state.authState, shallowEqual);
const { detail } = useSelector(state => state.flightState);
useEffect(() => {
if (detail?.createUserId == user?.cstmrSno || !detail.createUserId) {
// console.log(true)
setTest(false)
} else {
// console.log(false)
setTest(true)
}
}, [detail])
return (<div className='search-info-box'> return (<div className='search-info-box'>
<Row> <Row>
<Col className='list-input' lg={3} md={6} sm={12}> <Col className='list-input' lg={3} md={6} sm={12}>
@ -789,7 +828,7 @@ const ArcrftForm = ({data, handleChange, index, handleDeleteArray}) => {
bsSize='sm' bsSize='sm'
placeholder='' placeholder=''
onChange={(e) => { onChange={(e) => {
const {name, value} = e.target; const { name, value } = e.target;
handleChange({ handleChange({
type: 'arcrft', type: 'arcrft',
name, name,
@ -798,7 +837,6 @@ const ArcrftForm = ({data, handleChange, index, handleDeleteArray}) => {
}) })
}} }}
readOnly readOnly
/> />
</FormGroup> </FormGroup>
</Col> </Col>
@ -816,7 +854,7 @@ const ArcrftForm = ({data, handleChange, index, handleDeleteArray}) => {
bsSize='sm' bsSize='sm'
placeholder='' placeholder=''
onChange={(e) => { onChange={(e) => {
const {name, value} = e.target; const { name, value } = e.target;
handleChange({ handleChange({
type: 'arcrft', type: 'arcrft',
name, name,
@ -825,7 +863,6 @@ const ArcrftForm = ({data, handleChange, index, handleDeleteArray}) => {
}) })
}} }}
readOnly readOnly
/> />
</FormGroup> </FormGroup>
</Col> </Col>
@ -843,7 +880,7 @@ const ArcrftForm = ({data, handleChange, index, handleDeleteArray}) => {
bsSize='sm' bsSize='sm'
placeholder='' placeholder=''
onChange={(e) => { onChange={(e) => {
const {name, value} = e.target; const { name, value } = e.target;
handleChange({ handleChange({
type: 'arcrft', type: 'arcrft',
name, name,
@ -852,7 +889,6 @@ const ArcrftForm = ({data, handleChange, index, handleDeleteArray}) => {
}) })
}} }}
readOnly readOnly
/> />
</FormGroup> </FormGroup>
</Col> </Col>
@ -870,7 +906,7 @@ const ArcrftForm = ({data, handleChange, index, handleDeleteArray}) => {
bsSize='sm' bsSize='sm'
placeholder='' placeholder=''
onChange={(e) => { onChange={(e) => {
const {name, value} = e.target; const { name, value } = e.target;
handleChange({ handleChange({
type: 'arcrft', type: 'arcrft',
name, name,
@ -879,15 +915,14 @@ const ArcrftForm = ({data, handleChange, index, handleDeleteArray}) => {
}) })
}} }}
readOnly readOnly
/> />
</FormGroup> </FormGroup>
</Col> </Col>
{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}
color='danger' color='danger'
className='btn-icon' className='btn-icon'
onClick={() => onClick={() =>

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,test }) => {
const dispatch = useDispatch(); const dispatch = useDispatch();
const mapControl = useSelector(state => state.controlMapReducer); const mapControl = useSelector(state => state.controlMapReducer);
@ -115,6 +115,7 @@ const FlightPlanAreaDetailContainer = ({ handleModal }) => {
areaCoordList={areaCoordList} areaCoordList={areaCoordList}
data={areaDetail} data={areaDetail}
mapControl={mapControl} mapControl={mapControl}
test={test}
/> />
</Col> </Col>
<InfoModal modal={alertModal} setModal={setAlertModal} /> <InfoModal modal={alertModal} setModal={setAlertModal} />

Loading…
Cancel
Save