Browse Source

비행계획서 - 본인 외 수정 불가

pull/2/head
junh_eee 2 years ago
parent
commit
87c36227b2
  1. 20
      src/components/basis/flight/plan/FlightPlanAreaMap.js
  2. 22
      src/components/basis/flight/plan/FlightPlanForm.js
  3. 4
      src/containers/basis/flight/plan/FlightPlanAreaContainer.js

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

@ -49,6 +49,21 @@ const FlightPlanAreaMap = (props) => {
}, [areaCoordList]); }, [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 = () => { const ModeInit = () => {
setMode(mapControl.drawType) setMode(mapControl.drawType)
} }
@ -156,6 +171,11 @@ const FlightPlanAreaMap = (props) => {
color='primary' color='primary'
className='area-button' className='area-button'
onClick={e => handlerDrawType('RESET')} onClick={e => handlerDrawType('RESET')}
{...props.test? (
{}
):(
{disabled:true}
)}
> >
초기화 초기화
</Button.Ripple> </Button.Ripple>

22
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 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 (

4
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 { drawTypeChangeAction } from '../../../../modules/control/map/actions/controlMapActions';
import FlightPlanAreaDetailContainer from './FlightPlanAreaDetailContainer'; import FlightPlanAreaDetailContainer from './FlightPlanAreaDetailContainer';
const FlightPlanAreaContainer = ({handleModal}) => { const FlightPlanAreaContainer = ({handleModal, test}) => {
const dispatch = useDispatch(); const dispatch = useDispatch();
const { publicAreaList} = useSelector(state => state.flightState); const { publicAreaList} = useSelector(state => state.flightState);
@ -42,12 +42,14 @@ const FlightPlanAreaContainer = ({handleModal}) => {
<FlightPlanAreaMap <FlightPlanAreaMap
airArea={airArea} airArea={airArea}
handleConfirm={handleConfirm} handleConfirm={handleConfirm}
test={test}
/> />
) : null} ) : null}
</Col> </Col>
<Col md={6} lg={6}> <Col md={6} lg={6}>
<FlightPlanAreaDetailContainer <FlightPlanAreaDetailContainer
handleModal={handleModal} handleModal={handleModal}
test={test}
/> />
</Col> </Col>
</Row> </Row>

Loading…
Cancel
Save