|
|
|
@ -12,7 +12,7 @@ import {
|
|
|
|
|
import Flatpickr from 'react-flatpickr'; |
|
|
|
|
import '@styles/react/libs/flatpickr/flatpickr.scss'; |
|
|
|
|
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 { FlightPlanModal } from './FlightPlanModal'; |
|
|
|
|
import FlightPlanArcrftContainer from '../../../../containers/basis/flight/plan/FlightPlanArcrftContainer'; |
|
|
|
@ -22,49 +22,47 @@ import { useSelector } from 'react-redux';
|
|
|
|
|
import { shallowEqual } from 'react-redux'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDelete, modal, handleDeleteArray }) => { |
|
|
|
|
const {areaList, pilotList, arcrftList} = data; |
|
|
|
|
const FlightPlanForm = ({ data, handleModal, handleChange, handleSave, handleDelete, modal, handleDeleteArray }) => { |
|
|
|
|
const { areaList, pilotList, arcrftList } = data; |
|
|
|
|
|
|
|
|
|
const { detail } = useSelector(state => state.flightState); |
|
|
|
|
|
|
|
|
|
const [date ,setDate] = useState(); |
|
|
|
|
const [isFlightDone, setIsFlightDone] = useState(); |
|
|
|
|
const [date, setDate] = useState(); |
|
|
|
|
const [isFlightDone, setIsFlightDone] = useState(); |
|
|
|
|
|
|
|
|
|
const [test, setTest] = useState(); |
|
|
|
|
const { user } = useSelector(state => state.authState, shallowEqual); |
|
|
|
|
const [test, setTest] = useState(); |
|
|
|
|
const { user } = useSelector(state => state.authState, shallowEqual); |
|
|
|
|
const { detail } = useSelector(state => state.flightState); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
if(detail.createDt) { |
|
|
|
|
setDate(detail.schFltStDt); |
|
|
|
|
} |
|
|
|
|
useEffect(() => { |
|
|
|
|
if (detail.createDt) { |
|
|
|
|
setDate(detail.schFltStDt); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(detail?.createUserId == user?.cstmrSno) { |
|
|
|
|
// console.log(true)
|
|
|
|
|
setTest(true) |
|
|
|
|
} else { |
|
|
|
|
// console.log(false)
|
|
|
|
|
setTest(false) |
|
|
|
|
} |
|
|
|
|
console.log(detail.createUserId, '생성') |
|
|
|
|
console.log(user.cstmrSno, '로그인') |
|
|
|
|
}, [detail]) |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
setDate(''); |
|
|
|
|
}, []) |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
if(date) { |
|
|
|
|
let cTime = new Date(); |
|
|
|
|
let pTime = new Date(date) |
|
|
|
|
if(cTime > pTime) { |
|
|
|
|
setIsFlightDone(true); |
|
|
|
|
} else { |
|
|
|
|
setIsFlightDone(false); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, [date]) |
|
|
|
|
if (detail?.createUserId == user?.cstmrSno || !detail.createUserId) { |
|
|
|
|
// console.log(true)
|
|
|
|
|
setTest(false) |
|
|
|
|
} else { |
|
|
|
|
// console.log(false)
|
|
|
|
|
setTest(true) |
|
|
|
|
} |
|
|
|
|
}, [detail]) |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
setDate(''); |
|
|
|
|
}, []) |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
if (date) { |
|
|
|
|
let cTime = new Date(); |
|
|
|
|
let pTime = new Date(date) |
|
|
|
|
if (cTime > pTime) { |
|
|
|
|
setIsFlightDone(true); |
|
|
|
|
} else { |
|
|
|
|
setIsFlightDone(false); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, [date]) |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<Row> |
|
|
|
@ -95,13 +93,14 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
|
|
|
|
|
<Label for='test'><span |
|
|
|
|
className='necessary'>*</span>성명</Label> |
|
|
|
|
<Input |
|
|
|
|
readOnly={test} |
|
|
|
|
type='text' |
|
|
|
|
id='memberName' |
|
|
|
|
name='memberName' |
|
|
|
|
// defaultValue={data.memberName}
|
|
|
|
|
value={data.memberName || ''} |
|
|
|
|
onChange={(e) => { |
|
|
|
|
const {name, value} = e.target; |
|
|
|
|
const { name, value } = e.target; |
|
|
|
|
handleChange({ |
|
|
|
|
type: 'plan', |
|
|
|
|
name, |
|
|
|
@ -130,18 +129,18 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
|
|
|
|
|
bsSize='sm' |
|
|
|
|
placeholder='+82' |
|
|
|
|
onChange={(e) => { |
|
|
|
|
const {name, value} = e.target; |
|
|
|
|
const { name, value } = e.target; |
|
|
|
|
handleChange({ |
|
|
|
|
type: 'plan', |
|
|
|
|
name, |
|
|
|
|
value, |
|
|
|
|
}) |
|
|
|
|
}} |
|
|
|
|
readOnly |
|
|
|
|
/> |
|
|
|
|
readOnly /> |
|
|
|
|
</div> |
|
|
|
|
<div className='m_ft_box'> |
|
|
|
|
<Input |
|
|
|
|
readOnly={test} |
|
|
|
|
type='text' |
|
|
|
|
id='hpno' |
|
|
|
|
name='hpno' |
|
|
|
@ -149,7 +148,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
|
|
|
|
|
value={data.hpno || ''} |
|
|
|
|
bsSize='sm' |
|
|
|
|
onChange={(e) => { |
|
|
|
|
const {name, value} = e.target; |
|
|
|
|
const { name, value } = e.target; |
|
|
|
|
handleChange({ |
|
|
|
|
type: 'plan', |
|
|
|
|
name, |
|
|
|
@ -166,6 +165,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
|
|
|
|
|
<Label for='test'><span |
|
|
|
|
className='necessary'>*</span>이메일</Label> |
|
|
|
|
<Input |
|
|
|
|
readOnly={test} |
|
|
|
|
type='text' |
|
|
|
|
id='email' |
|
|
|
|
name='email' |
|
|
|
@ -173,7 +173,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
|
|
|
|
|
// value={data.email}
|
|
|
|
|
bsSize='sm' |
|
|
|
|
onChange={(e) => { |
|
|
|
|
const {name, value} = e.target; |
|
|
|
|
const { name, value } = e.target; |
|
|
|
|
handleChange({ |
|
|
|
|
type: 'plan', |
|
|
|
|
name, |
|
|
|
@ -236,7 +236,8 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
|
|
|
|
|
/> |
|
|
|
|
) |
|
|
|
|
} */} |
|
|
|
|
<Flatpickr
|
|
|
|
|
<Flatpickr |
|
|
|
|
disabled={test} |
|
|
|
|
size='sm' |
|
|
|
|
className='form-control calendar-flat' |
|
|
|
|
type='text' |
|
|
|
@ -248,14 +249,14 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
|
|
|
|
|
onChange={(date) => { |
|
|
|
|
const value = moment(date[0]).format('YYYY-MM-DD HH:mm:ss') || ''; |
|
|
|
|
handleChange({ |
|
|
|
|
type: 'plan', |
|
|
|
|
type: 'plan', |
|
|
|
|
name: 'schFltStDt', |
|
|
|
|
value |
|
|
|
|
}) |
|
|
|
|
}} |
|
|
|
|
}} |
|
|
|
|
placeholder='비행 시작일자 선택(클릭)' |
|
|
|
|
// {...{options:{minDate: "today"}}}
|
|
|
|
|
/> |
|
|
|
|
// {...{options:{minDate: "today"}}}
|
|
|
|
|
/> |
|
|
|
|
</FormGroup> |
|
|
|
|
</Col> |
|
|
|
|
<Col className='list-input' lg={4} md={4} sm={12}> |
|
|
|
@ -300,26 +301,27 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
|
|
|
|
|
/> |
|
|
|
|
) |
|
|
|
|
} */} |
|
|
|
|
<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"}}}
|
|
|
|
|
/> |
|
|
|
|
<Flatpickr |
|
|
|
|
disabled={test} |
|
|
|
|
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}> |
|
|
|
@ -328,23 +330,24 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
|
|
|
|
|
<span className='necessary'>*</span>비행 목적 |
|
|
|
|
</Label> |
|
|
|
|
<Input |
|
|
|
|
disabled={test} |
|
|
|
|
type='select' |
|
|
|
|
id='fltPurpose' |
|
|
|
|
name='fltPurpose' |
|
|
|
|
value={data.fltPurpose} |
|
|
|
|
bsSize='sm' |
|
|
|
|
onChange={(e) => { |
|
|
|
|
const {name, value} = e.target; |
|
|
|
|
const { name, value } = e.target; |
|
|
|
|
handleChange({ |
|
|
|
|
type: 'plan', |
|
|
|
|
name, |
|
|
|
|
value, |
|
|
|
|
}) |
|
|
|
|
}} |
|
|
|
|
// innerRef={props.data}
|
|
|
|
|
// className={classnames({
|
|
|
|
|
// 'is-invalid': props.errors.arcrftTypeCd
|
|
|
|
|
// })}
|
|
|
|
|
// innerRef={props.data}
|
|
|
|
|
// className={classnames({
|
|
|
|
|
// 'is-invalid': props.errors.arcrftTypeCd
|
|
|
|
|
// })}
|
|
|
|
|
> |
|
|
|
|
{/* TODO CDNOT 코드연동 필요 */} |
|
|
|
|
<option value=''>= 선택 =</option> |
|
|
|
@ -367,7 +370,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
|
|
|
|
|
<Button.Ripple |
|
|
|
|
color="primary" |
|
|
|
|
onClick={(e) => { |
|
|
|
|
handleModal({target: 'area', isOpen: true}) |
|
|
|
|
handleModal({ target: 'area', isOpen: true }) |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
비행 구역 설정 |
|
|
|
@ -376,17 +379,18 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
|
|
|
|
|
{areaList |
|
|
|
|
? areaList.map((item, i) => |
|
|
|
|
<AreaForm key={i} index={i} data={item} |
|
|
|
|
handleChange={handleChange} />) |
|
|
|
|
handleChange={handleChange} />) |
|
|
|
|
: <AreaForm data={initFlightBas.area} |
|
|
|
|
handleChange={handleChange}/>} |
|
|
|
|
handleChange={handleChange} />} |
|
|
|
|
</dt> |
|
|
|
|
<dt> |
|
|
|
|
<div className='search-info-ti d-flex justify-content-between'> |
|
|
|
|
<h4 className='ti'>조종사 정보</h4> |
|
|
|
|
<Button.Ripple |
|
|
|
|
disabled={test} |
|
|
|
|
color="primary" |
|
|
|
|
onClick={(e) => { |
|
|
|
|
handleModal({target: 'pilot', isOpen: true}) |
|
|
|
|
handleModal({ target: 'pilot', isOpen: true }) |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
조종사 조회 |
|
|
|
@ -395,21 +399,22 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
|
|
|
|
|
{pilotList |
|
|
|
|
? pilotList.map((item, i) => |
|
|
|
|
<PilotForm key={i} |
|
|
|
|
index={i} |
|
|
|
|
data={item} |
|
|
|
|
handleChange={handleChange} |
|
|
|
|
handleDeleteArray ={handleDeleteArray} |
|
|
|
|
/>) |
|
|
|
|
index={i} |
|
|
|
|
data={item} |
|
|
|
|
handleChange={handleChange} |
|
|
|
|
handleDeleteArray={handleDeleteArray} |
|
|
|
|
/>) |
|
|
|
|
: <PilotForm data={initFlightBas.pilot} |
|
|
|
|
handleChange={handleChange}/>} |
|
|
|
|
handleChange={handleChange} />} |
|
|
|
|
</dt> |
|
|
|
|
<dt> |
|
|
|
|
<div className='search-info-ti d-flex justify-content-between'> |
|
|
|
|
<h4 className='ti'>기체 정보</h4> |
|
|
|
|
<Button.Ripple |
|
|
|
|
disabled={test} |
|
|
|
|
color="primary" |
|
|
|
|
onClick={(e) => { |
|
|
|
|
handleModal({target: 'arcrft', isOpen: true}); |
|
|
|
|
handleModal({ target: 'arcrft', isOpen: true }); |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
기체 조회 |
|
|
|
@ -418,14 +423,14 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
|
|
|
|
|
{arcrftList |
|
|
|
|
? arcrftList.map((item, i) => |
|
|
|
|
<ArcrftForm key={i} |
|
|
|
|
index={i} |
|
|
|
|
data={item} |
|
|
|
|
handleChange={handleChange} |
|
|
|
|
handleDeleteArray ={handleDeleteArray} |
|
|
|
|
/>) |
|
|
|
|
|
|
|
|
|
index={i} |
|
|
|
|
data={item} |
|
|
|
|
handleChange={handleChange} |
|
|
|
|
handleDeleteArray={handleDeleteArray} |
|
|
|
|
/>) |
|
|
|
|
|
|
|
|
|
: <ArcrftForm data={initFlightBas.arcrft} |
|
|
|
|
handleChange={handleChange}/>} |
|
|
|
|
handleChange={handleChange} />} |
|
|
|
|
</dt> |
|
|
|
|
|
|
|
|
|
<div className='d-flex align-items-center'> |
|
|
|
@ -456,9 +461,9 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
|
|
|
|
|
</CardBody> |
|
|
|
|
</Card> |
|
|
|
|
</Col> |
|
|
|
|
<SelectModal
|
|
|
|
|
<SelectModal |
|
|
|
|
modal={modal} |
|
|
|
|
handleModal={handleModal}
|
|
|
|
|
handleModal={handleModal} |
|
|
|
|
test={test} |
|
|
|
|
/> |
|
|
|
|
</Row> |
|
|
|
@ -467,47 +472,47 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele
|
|
|
|
|
|
|
|
|
|
export default FlightPlanForm; |
|
|
|
|
|
|
|
|
|
const SelectModal = ({handleModal, modal, test}) => { |
|
|
|
|
const SelectModal = ({ handleModal, modal, test }) => { |
|
|
|
|
let title = ''; |
|
|
|
|
let description = ''; |
|
|
|
|
let type = ''; |
|
|
|
|
let isOpen = false; |
|
|
|
|
|
|
|
|
|
if(modal.pilot) { |
|
|
|
|
if (modal.pilot) { |
|
|
|
|
isOpen = modal.pilot; |
|
|
|
|
title = '조종사 조회'; |
|
|
|
|
type = 'pilot'; |
|
|
|
|
description = <FlightPlanPilotContainer handleModal={handleModal} type={type} /> |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(modal.arcrft) { |
|
|
|
|
if (modal.arcrft) { |
|
|
|
|
isOpen = modal.arcrft; |
|
|
|
|
title = '기체 조회'; |
|
|
|
|
type = 'arcrft'; |
|
|
|
|
description = <FlightPlanArcrftContainer handleModal={handleModal} type={type} />; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(modal.area) { |
|
|
|
|
if (modal.area) { |
|
|
|
|
isOpen = modal.area; |
|
|
|
|
title = '비행 구역 설정'; |
|
|
|
|
type = 'area'; |
|
|
|
|
description = <FlightPlanAreaContainer handleModal={handleModal} type={type} test={test}/>; |
|
|
|
|
description = <FlightPlanAreaContainer handleModal={handleModal} type={type} test={test} />; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<FlightPlanModal
|
|
|
|
|
title = {title} |
|
|
|
|
description = {description} |
|
|
|
|
type = {type} |
|
|
|
|
isOpen = {isOpen}
|
|
|
|
|
handleModal={handleModal}
|
|
|
|
|
<FlightPlanModal |
|
|
|
|
title={title} |
|
|
|
|
description={description} |
|
|
|
|
type={type} |
|
|
|
|
isOpen={isOpen} |
|
|
|
|
handleModal={handleModal} |
|
|
|
|
/> |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const AreaForm = ({data, handleChange, index}) => { |
|
|
|
|
const AreaForm = ({ data, handleChange, index }) => { |
|
|
|
|
|
|
|
|
|
return (<div className='search-info-box'> |
|
|
|
|
<Row> |
|
|
|
@ -547,7 +552,7 @@ const AreaForm = ({data, handleChange, index}) => {
|
|
|
|
|
bsSize='sm' |
|
|
|
|
placeholder='-!!' |
|
|
|
|
onChange={(e) => { |
|
|
|
|
const {name, value} = e.target; |
|
|
|
|
const { name, value } = e.target; |
|
|
|
|
handleChange({ |
|
|
|
|
type: 'coord', |
|
|
|
|
name, |
|
|
|
@ -577,7 +582,7 @@ const AreaForm = ({data, handleChange, index}) => {
|
|
|
|
|
bsSize='sm' |
|
|
|
|
placeholder='반경' |
|
|
|
|
onChange={(e) => { |
|
|
|
|
const {name, value} = e.target; |
|
|
|
|
const { name, value } = e.target; |
|
|
|
|
handleChange({ |
|
|
|
|
type: 'area', |
|
|
|
|
name, |
|
|
|
@ -598,7 +603,7 @@ const AreaForm = ({data, handleChange, index}) => {
|
|
|
|
|
bsSize='sm' |
|
|
|
|
placeholder='고도' |
|
|
|
|
onChange={(e) => { |
|
|
|
|
const {name, value} = e.target; |
|
|
|
|
const { name, value } = e.target; |
|
|
|
|
handleChange({ |
|
|
|
|
type: 'area', |
|
|
|
|
name, |
|
|
|
@ -625,7 +630,7 @@ const AreaForm = ({data, handleChange, index}) => {
|
|
|
|
|
bsSize='sm' |
|
|
|
|
placeholder='' |
|
|
|
|
onChange={(e) => { |
|
|
|
|
const {name, value} = e.target; |
|
|
|
|
const { name, value } = e.target; |
|
|
|
|
handleChange({ |
|
|
|
|
type: 'area', |
|
|
|
|
name, |
|
|
|
@ -640,7 +645,24 @@ const AreaForm = ({data, handleChange, index}) => {
|
|
|
|
|
</Row> |
|
|
|
|
</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'> |
|
|
|
|
<Row> |
|
|
|
|
<Col className='list-input' lg={4} md={6} sm={12}> |
|
|
|
@ -649,6 +671,7 @@ const PilotForm = ({data, handleChange, index, handleDeleteArray}) => {
|
|
|
|
|
<span className='necessary'>*</span>성명 |
|
|
|
|
</Label> |
|
|
|
|
<Input |
|
|
|
|
|
|
|
|
|
type='text' |
|
|
|
|
id='memberName' |
|
|
|
|
name='memberName' |
|
|
|
@ -657,7 +680,7 @@ const PilotForm = ({data, handleChange, index, handleDeleteArray}) => {
|
|
|
|
|
bsSize='sm' |
|
|
|
|
placeholder='' |
|
|
|
|
onChange={(e) => { |
|
|
|
|
const {name, value} = e.target; |
|
|
|
|
const { name, value } = e.target; |
|
|
|
|
handleChange({ |
|
|
|
|
type: 'pilot', |
|
|
|
|
name, |
|
|
|
@ -666,7 +689,6 @@ const PilotForm = ({data, handleChange, index, handleDeleteArray}) => {
|
|
|
|
|
}) |
|
|
|
|
}} |
|
|
|
|
readOnly |
|
|
|
|
|
|
|
|
|
/> |
|
|
|
|
</FormGroup> |
|
|
|
|
</Col> |
|
|
|
@ -685,7 +707,7 @@ const PilotForm = ({data, handleChange, index, handleDeleteArray}) => {
|
|
|
|
|
bsSize='sm' |
|
|
|
|
placeholder='+82' |
|
|
|
|
onChange={(e) => { |
|
|
|
|
const {name, value} = e.target; |
|
|
|
|
const { name, value } = e.target; |
|
|
|
|
handleChange({ |
|
|
|
|
type: 'pilot', |
|
|
|
|
name, |
|
|
|
@ -706,7 +728,7 @@ const PilotForm = ({data, handleChange, index, handleDeleteArray}) => {
|
|
|
|
|
bsSize='sm' |
|
|
|
|
placeholder='010-0000-0000' |
|
|
|
|
onChange={(e) => { |
|
|
|
|
const {name, value} = e.target; |
|
|
|
|
const { name, value } = e.target; |
|
|
|
|
handleChange({ |
|
|
|
|
type: 'pilot', |
|
|
|
|
name, |
|
|
|
@ -734,7 +756,7 @@ const PilotForm = ({data, handleChange, index, handleDeleteArray}) => {
|
|
|
|
|
bsSize='sm' |
|
|
|
|
placeholder='' |
|
|
|
|
onChange={(e) => { |
|
|
|
|
const {name, value} = e.target; |
|
|
|
|
const { name, value } = e.target; |
|
|
|
|
handleChange({ |
|
|
|
|
type: 'pilot', |
|
|
|
|
name, |
|
|
|
@ -748,9 +770,10 @@ const PilotForm = ({data, handleChange, index, handleDeleteArray}) => {
|
|
|
|
|
</FormGroup> |
|
|
|
|
</Col> |
|
|
|
|
<Col className='search-info-box-del-btn' lg={1} md={6} sm={12}> |
|
|
|
|
{data.groupNm? |
|
|
|
|
{data.groupNm ? |
|
|
|
|
( |
|
|
|
|
<Button.Ripple |
|
|
|
|
disabled={test} |
|
|
|
|
color='danger' |
|
|
|
|
className='btn-icon' |
|
|
|
|
onClick={() => |
|
|
|
@ -765,14 +788,30 @@ const PilotForm = ({data, handleChange, index, handleDeleteArray}) => {
|
|
|
|
|
( |
|
|
|
|
<></> |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
</Col> |
|
|
|
|
} |
|
|
|
|
</Col> |
|
|
|
|
</Row> |
|
|
|
|
</div>) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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'> |
|
|
|
|
<Row> |
|
|
|
|
<Col className='list-input' lg={3} md={6} sm={12}> |
|
|
|
@ -789,7 +828,7 @@ const ArcrftForm = ({data, handleChange, index, handleDeleteArray}) => {
|
|
|
|
|
bsSize='sm' |
|
|
|
|
placeholder='' |
|
|
|
|
onChange={(e) => { |
|
|
|
|
const {name, value} = e.target; |
|
|
|
|
const { name, value } = e.target; |
|
|
|
|
handleChange({ |
|
|
|
|
type: 'arcrft', |
|
|
|
|
name, |
|
|
|
@ -798,7 +837,6 @@ const ArcrftForm = ({data, handleChange, index, handleDeleteArray}) => {
|
|
|
|
|
}) |
|
|
|
|
}} |
|
|
|
|
readOnly |
|
|
|
|
|
|
|
|
|
/> |
|
|
|
|
</FormGroup> |
|
|
|
|
</Col> |
|
|
|
@ -816,7 +854,7 @@ const ArcrftForm = ({data, handleChange, index, handleDeleteArray}) => {
|
|
|
|
|
bsSize='sm' |
|
|
|
|
placeholder='' |
|
|
|
|
onChange={(e) => { |
|
|
|
|
const {name, value} = e.target; |
|
|
|
|
const { name, value } = e.target; |
|
|
|
|
handleChange({ |
|
|
|
|
type: 'arcrft', |
|
|
|
|
name, |
|
|
|
@ -825,7 +863,6 @@ const ArcrftForm = ({data, handleChange, index, handleDeleteArray}) => {
|
|
|
|
|
}) |
|
|
|
|
}} |
|
|
|
|
readOnly |
|
|
|
|
|
|
|
|
|
/> |
|
|
|
|
</FormGroup> |
|
|
|
|
</Col> |
|
|
|
@ -843,7 +880,7 @@ const ArcrftForm = ({data, handleChange, index, handleDeleteArray}) => {
|
|
|
|
|
bsSize='sm' |
|
|
|
|
placeholder='' |
|
|
|
|
onChange={(e) => { |
|
|
|
|
const {name, value} = e.target; |
|
|
|
|
const { name, value } = e.target; |
|
|
|
|
handleChange({ |
|
|
|
|
type: 'arcrft', |
|
|
|
|
name, |
|
|
|
@ -852,7 +889,6 @@ const ArcrftForm = ({data, handleChange, index, handleDeleteArray}) => {
|
|
|
|
|
}) |
|
|
|
|
}} |
|
|
|
|
readOnly |
|
|
|
|
|
|
|
|
|
/> |
|
|
|
|
</FormGroup> |
|
|
|
|
</Col> |
|
|
|
@ -870,7 +906,7 @@ const ArcrftForm = ({data, handleChange, index, handleDeleteArray}) => {
|
|
|
|
|
bsSize='sm' |
|
|
|
|
placeholder='' |
|
|
|
|
onChange={(e) => { |
|
|
|
|
const {name, value} = e.target; |
|
|
|
|
const { name, value } = e.target; |
|
|
|
|
handleChange({ |
|
|
|
|
type: 'arcrft', |
|
|
|
|
name, |
|
|
|
@ -879,29 +915,28 @@ const ArcrftForm = ({data, handleChange, index, handleDeleteArray}) => {
|
|
|
|
|
}) |
|
|
|
|
}} |
|
|
|
|
readOnly |
|
|
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
</FormGroup> |
|
|
|
|
</Col> |
|
|
|
|
{data.groupNm? |
|
|
|
|
( |
|
|
|
|
<Col className='search-info-box-del-btn' lg={1} md={6} sm={12}> |
|
|
|
|
<Button.Ripple |
|
|
|
|
color='danger' |
|
|
|
|
className='btn-icon' |
|
|
|
|
onClick={() => |
|
|
|
|
handleDeleteArray({ type: 'arcrft', index }) |
|
|
|
|
} |
|
|
|
|
> |
|
|
|
|
<X size={14} /> |
|
|
|
|
</Button.Ripple> |
|
|
|
|
</Col> |
|
|
|
|
) |
|
|
|
|
: |
|
|
|
|
( |
|
|
|
|
<></> |
|
|
|
|
) |
|
|
|
|
{data.groupNm ? |
|
|
|
|
( |
|
|
|
|
<Col className='search-info-box-del-btn' lg={1} md={6} sm={12}> |
|
|
|
|
<Button.Ripple |
|
|
|
|
disabled={test} |
|
|
|
|
color='danger' |
|
|
|
|
className='btn-icon' |
|
|
|
|
onClick={() => |
|
|
|
|
handleDeleteArray({ type: 'arcrft', index }) |
|
|
|
|
} |
|
|
|
|
> |
|
|
|
|
<X size={14} /> |
|
|
|
|
</Button.Ripple> |
|
|
|
|
</Col> |
|
|
|
|
) |
|
|
|
|
: |
|
|
|
|
( |
|
|
|
|
<></> |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
</Row> |
|
|
|
|
</div>) |
|
|
|
|