From 87c36227b2132e9f42b555308562da63588e3e75 Mon Sep 17 00:00:00 2001 From: junh_eee Date: Thu, 15 Sep 2022 16:54:43 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B9=84=ED=96=89=EA=B3=84=ED=9A=8D=EC=84=9C?= =?UTF-8?q?=20-=20=EB=B3=B8=EC=9D=B8=20=EC=99=B8=20=EC=88=98=EC=A0=95=20?= =?UTF-8?q?=EB=B6=88=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basis/flight/plan/FlightPlanAreaMap.js | 20 +++++++++++++++++ .../basis/flight/plan/FlightPlanForm.js | 22 ++++++++++++++++--- .../flight/plan/FlightPlanAreaContainer.js | 4 +++- 3 files changed, 42 insertions(+), 4 deletions(-) diff --git a/src/components/basis/flight/plan/FlightPlanAreaMap.js b/src/components/basis/flight/plan/FlightPlanAreaMap.js index c4c53a0..9444bf7 100644 --- a/src/components/basis/flight/plan/FlightPlanAreaMap.js +++ b/src/components/basis/flight/plan/FlightPlanAreaMap.js @@ -49,6 +49,21 @@ const FlightPlanAreaMap = (props) => { }, [areaCoordList]); + + const search = (latlng) => { + naver.maps.Service.reverseGeocode({ + coords: latlng, + orders: [ + naver.maps.Service.OrderType.ADDR, + naver.maps.Service.OrderType.ROAD_ADDR + ].join(',') + }, ) + } + + + + + const ModeInit = () => { setMode(mapControl.drawType) } @@ -156,6 +171,11 @@ const FlightPlanAreaMap = (props) => { color='primary' className='area-button' onClick={e => handlerDrawType('RESET')} + {...props.test? ( + {} + ):( + {disabled:true} + )} > 초기화 diff --git a/src/components/basis/flight/plan/FlightPlanForm.js b/src/components/basis/flight/plan/FlightPlanForm.js index 44c6bef..7ddf9bc 100644 --- a/src/components/basis/flight/plan/FlightPlanForm.js +++ b/src/components/basis/flight/plan/FlightPlanForm.js @@ -19,6 +19,7 @@ import FlightPlanArcrftContainer from '../../../../containers/basis/flight/plan/ import FlightPlanAreaContainer from '../../../../containers/basis/flight/plan/FlightPlanAreaContainer'; import { X } from 'react-feather'; import { useSelector } from 'react-redux'; +import { shallowEqual } from 'react-redux'; 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 [isFlightDone, setIsFlightDone] = useState(); + const [test, setTest] = useState(); + const { user } = useSelector(state => state.authState, shallowEqual); + + 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(() => { @@ -361,7 +376,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele {areaList ? areaList.map((item, i) => ) + handleChange={handleChange} />) : } @@ -444,6 +459,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele ) @@ -451,7 +467,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele export default FlightPlanForm; -const SelectModal = ({handleModal, modal}) => { +const SelectModal = ({handleModal, modal, test}) => { let title = ''; let description = ''; let type = ''; @@ -475,7 +491,7 @@ const SelectModal = ({handleModal, modal}) => { isOpen = modal.area; title = '비행 구역 설정'; type = 'area'; - description = ; + description = ; } return ( diff --git a/src/containers/basis/flight/plan/FlightPlanAreaContainer.js b/src/containers/basis/flight/plan/FlightPlanAreaContainer.js index 617e58f..3561bdd 100644 --- a/src/containers/basis/flight/plan/FlightPlanAreaContainer.js +++ b/src/containers/basis/flight/plan/FlightPlanAreaContainer.js @@ -6,7 +6,7 @@ import FlightPlanAreaMap from '../../../../components/basis/flight/plan/FlightPl import { drawTypeChangeAction } from '../../../../modules/control/map/actions/controlMapActions'; import FlightPlanAreaDetailContainer from './FlightPlanAreaDetailContainer'; -const FlightPlanAreaContainer = ({handleModal}) => { +const FlightPlanAreaContainer = ({handleModal, test}) => { const dispatch = useDispatch(); const { publicAreaList} = useSelector(state => state.flightState); @@ -42,12 +42,14 @@ const FlightPlanAreaContainer = ({handleModal}) => { ) : null}