|
|
@ -19,6 +19,7 @@ import FlightPlanArcrftContainer from '../../../../containers/basis/flight/plan/ |
|
|
|
import FlightPlanAreaContainer from '../../../../containers/basis/flight/plan/FlightPlanAreaContainer'; |
|
|
|
import FlightPlanAreaContainer from '../../../../containers/basis/flight/plan/FlightPlanAreaContainer'; |
|
|
|
import { X } from 'react-feather'; |
|
|
|
import { X } from 'react-feather'; |
|
|
|
import { useSelector } from 'react-redux'; |
|
|
|
import { useSelector } 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 }) => { |
|
|
@ -29,10 +30,24 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele |
|
|
|
const [date ,setDate] = useState(); |
|
|
|
const [date ,setDate] = useState(); |
|
|
|
const [isFlightDone, setIsFlightDone] = useState(); |
|
|
|
const [isFlightDone, setIsFlightDone] = useState(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const [test, setTest] = useState(); |
|
|
|
|
|
|
|
const { user } = useSelector(state => state.authState, shallowEqual); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
if(detail.createDt) { |
|
|
|
if(detail.createDt) { |
|
|
|
setDate(detail.schFltStDt); |
|
|
|
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]) |
|
|
|
}, [detail]) |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
@ -361,7 +376,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele |
|
|
|
{areaList |
|
|
|
{areaList |
|
|
|
? areaList.map((item, i) => |
|
|
|
? areaList.map((item, i) => |
|
|
|
<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> |
|
|
@ -444,6 +459,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele |
|
|
|
<SelectModal
|
|
|
|
<SelectModal
|
|
|
|
modal={modal} |
|
|
|
modal={modal} |
|
|
|
handleModal={handleModal}
|
|
|
|
handleModal={handleModal}
|
|
|
|
|
|
|
|
test={test} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</Row> |
|
|
|
</Row> |
|
|
|
) |
|
|
|
) |
|
|
@ -451,7 +467,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele |
|
|
|
|
|
|
|
|
|
|
|
export default FlightPlanForm; |
|
|
|
export default FlightPlanForm; |
|
|
|
|
|
|
|
|
|
|
|
const SelectModal = ({handleModal, modal}) => { |
|
|
|
const SelectModal = ({handleModal, modal, test}) => { |
|
|
|
let title = ''; |
|
|
|
let title = ''; |
|
|
|
let description = ''; |
|
|
|
let description = ''; |
|
|
|
let type = ''; |
|
|
|
let type = ''; |
|
|
@ -475,7 +491,7 @@ const SelectModal = ({handleModal, modal}) => { |
|
|
|
isOpen = modal.area; |
|
|
|
isOpen = modal.area; |
|
|
|
title = '비행 구역 설정'; |
|
|
|
title = '비행 구역 설정'; |
|
|
|
type = 'area'; |
|
|
|
type = 'area'; |
|
|
|
description = <FlightPlanAreaContainer handleModal={handleModal} type={type}/>; |
|
|
|
description = <FlightPlanAreaContainer handleModal={handleModal} type={type} test={test}/>; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|