From 2e4ce5c265eaa57034189d14f692d2757c0c2428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?junh=5Feee=28=EC=9D=B4=EC=A4=80=ED=9D=AC=29?= Date: Thu, 25 Aug 2022 16:34:59 +0900 Subject: [PATCH 1/7] =?UTF-8?q?=EB=B9=84=ED=96=89=EA=B3=84=ED=9A=8D?= =?UTF-8?q?=EC=84=9C=20-=20=EB=B9=84=ED=96=89=20=EC=8B=9C=EC=9E=91=20?= =?UTF-8?q?=EB=B0=8F=20=EC=A2=85=EB=A3=8C=20=EA=B3=84=ED=9A=8D=EC=84=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20=EB=B6=88=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basis/flight/plan/FlightPlanForm.js | 189 +++++++++++++----- 1 file changed, 138 insertions(+), 51 deletions(-) diff --git a/src/components/basis/flight/plan/FlightPlanForm.js b/src/components/basis/flight/plan/FlightPlanForm.js index 33c3d05..adbd92a 100644 --- a/src/components/basis/flight/plan/FlightPlanForm.js +++ b/src/components/basis/flight/plan/FlightPlanForm.js @@ -1,4 +1,4 @@ -import React, { useEffect } from 'react'; +import React, { useEffect, useState } from 'react'; import { Card, CardBody, @@ -24,6 +24,34 @@ import { useDispatch, useSelector } from 'react-redux'; const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDelete, modal, handleDeleteArray }) => { const {areaList, pilotList, arcrftList} = data; + const flightState = useSelector(state => state.flightState); + const { detail } = flightState; + + const [date ,setDate] = useState(); + const [isBigCurrent, setIsBigCurrent] = useState(); + + useEffect(() => { + if(detail.createDt) { + setDate(detail.schFltStDt); + } + }, [detail]) + + useEffect(() => { + setDate(''); + }, []) + + useEffect(() => { + if(date) { + let cTime = new Date(); + let pTime = new Date(date) + if(cTime > pTime) { + setIsBigCurrent(true); + } else { + setIsBigCurrent(false); + } + } + }, [date]) + return ( @@ -69,6 +97,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele bsSize='sm' placeholder='' + { ...(isBigCurrent ? {readOnly:true} : {}) } /> @@ -84,7 +113,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele id='clncd' name='clncd' // defaultValue={data.clncd} - value={data.clncd || '+81'} + value={data.clncd || '+82'} bsSize='sm' placeholder='+82' onChange={(e) => { @@ -115,6 +144,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele }) }} placeholder='010-0000-0000' + { ...(isBigCurrent ? {readOnly:true} : {}) } /> @@ -140,6 +170,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele }} // innerRef={props.data} placeholder='' + { ...(isBigCurrent ? {readOnly:true} : {}) } /> @@ -157,24 +188,43 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele - { - const value = moment(date[0]).format('YYYY-MM-DD HH:mm:ss') || ''; - handleChange({ - type: 'plan', - name: 'schFltStDt', - value - }) - }} - placeholder='비행 시작일자 선택(클릭)'/> - + { + (isBigCurrent) ? + ( + + ) + : + ( + { + const value = moment(date[0]).format('YYYY-MM-DD HH:mm:ss') || ''; + handleChange({ + type: 'plan', + name: 'schFltStDt', + value + }) + }} + placeholder='비행 시작일자 선택(클릭)' + {...{options:{minDate: "today"}}} + /> + ) + } @@ -182,23 +232,43 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele - { - const value = moment(date[0]).format('YYYY-MM-DD HH:mm:ss') || ''; - handleChange({ - type: 'plan', - name: 'schFltEndDt', - value - }) - }} - placeholder='비행 종료일자 선택(클릭)'/> - + { + (isBigCurrent) ? + ( + + ) + : + ( + { + const value = moment(date[0]).format('YYYY-MM-DD HH:mm:ss') || ''; + handleChange({ + type: 'plan', + name: 'schFltEndDt', + value + }) + }} + placeholder='비행 종료일자 선택(클릭)' + {...{options:{minDate: "today"}}} + /> + ) + } @@ -207,7 +277,8 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele *비행 목적 {/* TODO CDNOT 코드연동 필요 */} - - - - - - - + { isBigCurrent ? + <> + : + <> + + + + + + + + + } @@ -246,9 +324,10 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele

비행 구역 정보

{ + onClick={(e) => { handleModal({target: 'area', isOpen: true}) - }} + }} + {...(isBigCurrent)? {disabled:true} : {} } > 비행 구역 설정 @@ -268,6 +347,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele onClick={(e) => { handleModal({target: 'pilot', isOpen: true}) }} + {...(isBigCurrent)? {disabled:true} : {} } > 조종사 조회 @@ -278,7 +358,8 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele index={i} data={item} handleChange={handleChange} - handleDeleteArray ={handleDeleteArray}/>) + handleDeleteArray ={handleDeleteArray} + isBigCurrent={isBigCurrent}/>) : } @@ -290,6 +371,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele onClick={(e) => { handleModal({target: 'arcrft', isOpen: true}); }} + {...(isBigCurrent)? {disabled:true} : {} } > 기체 조회 @@ -300,7 +382,8 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele index={i} data={item} handleChange={handleChange} - handleDeleteArray ={handleDeleteArray}/>) + handleDeleteArray ={handleDeleteArray} + isBigCurrent={isBigCurrent}/>) : } @@ -312,6 +395,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele color='primary' size='sm' onClick={handleSave} + {...(isBigCurrent)? {disabled:true} : {} } > 저장 @@ -319,6 +403,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele color='danger' size='sm' onClick={handleDelete} + {...(isBigCurrent)? {disabled:true} : {} } > 삭제 @@ -517,7 +602,7 @@ const AreaForm = ({data, handleChange, index}) => {
) } -const PilotForm = ({data, handleChange, index, handleDeleteArray}) => { +const PilotForm = ({data, handleChange, index, handleDeleteArray, isBigCurrent}) => { return (
@@ -634,6 +719,7 @@ const PilotForm = ({data, handleChange, index, handleDeleteArray}) => { handleDeleteArray({ type: 'pilot', index }) } outline + {...(isBigCurrent)? {disabled:true} : {} } > 삭제 @@ -650,7 +736,7 @@ const PilotForm = ({data, handleChange, index, handleDeleteArray}) => { } -const ArcrftForm = ({data, handleChange, index, handleDeleteArray}) => { +const ArcrftForm = ({data, handleChange, index, handleDeleteArray, isBigCurrent}) => { return (
@@ -791,6 +877,7 @@ const ArcrftForm = ({data, handleChange, index, handleDeleteArray}) => { handleDeleteArray({ type: 'arcrft', index }) } outline + {...(isBigCurrent)? {disabled:true} : {} } > 삭제 From c671d07a39afa7435bfdc8e476e77398106f82ee Mon Sep 17 00:00:00 2001 From: geun <1416geun@naver.com> Date: Thu, 25 Aug 2022 16:56:53 +0900 Subject: [PATCH 2/7] =?UTF-8?q?=EB=B9=84=ED=96=89=EA=B3=84=ED=9A=8D?= =?UTF-8?q?=EC=8B=A0=EC=B2=AD=EC=84=9C=20=EC=82=AD=EC=A0=9C=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/css/custom.css | 11 +++- .../basis/flight/plan/FlightPlanForm.js | 57 +++++++++---------- 2 files changed, 37 insertions(+), 31 deletions(-) diff --git a/src/assets/css/custom.css b/src/assets/css/custom.css index 7afb0e1..8483445 100644 --- a/src/assets/css/custom.css +++ b/src/assets/css/custom.css @@ -743,4 +743,13 @@ background-size: 75% auto; .layer-content-box .history-btn{border-radius:4px;display:block;width:100%;height:45px;line-height:45px;text-align:center;font-size: 0.875rem;color:#ddd;font-weight:500;} .layer-content-box .history-btn:hover{border-radius:4px;background:#00cfe8;border-color:#00cfe8;transition: 0.3s ease;-webkit-transition: 0.3s ease;} .historyModal .drone-ti span{font-weight:500;margin-top:6px} -.historyModal .drone-name{color:#00cfe8;margin:0 10px 0 0;} \ No newline at end of file +.historyModal .drone-name{color:#00cfe8;margin:0 10px 0 0;} + +.search-info-box-del-btn{display: flex; align-items: center;} +.search-info-box-del-btn button{cursor: pointer;margin-top:10px} +@media (max-width: 992px){ + .search-info-box-del-btn button { + margin-bottom:1rem; + margin-top:0px; + } +} diff --git a/src/components/basis/flight/plan/FlightPlanForm.js b/src/components/basis/flight/plan/FlightPlanForm.js index 33c3d05..7f612e9 100644 --- a/src/components/basis/flight/plan/FlightPlanForm.js +++ b/src/components/basis/flight/plan/FlightPlanForm.js @@ -158,7 +158,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele *비행시작일자 *비행종료일자 {
- + - {data.groupNm? - ( - - - handleDeleteArray({ type: 'pilot', index }) - } - outline - > - - 삭제 - - - ) - : - ( - <> - ) - } + + {data.groupNm? + ( + + handleDeleteArray({ type: 'pilot', index }) + } + > + + + + ) + : + ( + <> + ) + } +
) } @@ -734,7 +733,7 @@ const ArcrftForm = ({data, handleChange, index, handleDeleteArray}) => { /> - + @@ -115,6 +143,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele }) }} placeholder='010-0000-0000' + { ...(isFlightDone ? {readOnly:true} : {}) } /> @@ -140,6 +169,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele }} // innerRef={props.data} placeholder='' + { ...(isFlightDone ? {readOnly:true} : {}) } /> @@ -157,23 +187,43 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele - { - const value = moment(date[0]).format('YYYY-MM-DD HH:mm:ss') || ''; - handleChange({ - type: 'plan', - name: 'schFltStDt', - value - }) - }} - placeholder='비행 시작일자 선택(클릭)'/> + { + (isFlightDone) ? + ( + + ) + : + ( + { + const value = moment(date[0]).format('YYYY-MM-DD HH:mm:ss') || ''; + handleChange({ + type: 'plan', + name: 'schFltStDt', + value + }) + }} + placeholder='비행 시작일자 선택(클릭)' + {...{options:{minDate: "today"}}} + /> + ) + } @@ -182,23 +232,43 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele - { - const value = moment(date[0]).format('YYYY-MM-DD HH:mm:ss') || ''; - handleChange({ - type: 'plan', - name: 'schFltEndDt', - value - }) - }} - placeholder='비행 종료일자 선택(클릭)'/> - + { + (isFlightDone) ? + ( + + ) + : + ( + { + const value = moment(date[0]).format('YYYY-MM-DD HH:mm:ss') || ''; + handleChange({ + type: 'plan', + name: 'schFltEndDt', + value + }) + }} + placeholder='비행 종료일자 선택(클릭)' + {...{options:{minDate: "today"}}} + /> + ) + } @@ -207,7 +277,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele *비행 목적 {/* TODO CDNOT 코드연동 필요 */} - - - - - - - - + { isFlightDone ? + <> + : + <> + + + + + + + + + } + @@ -249,6 +326,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele onClick={(e) => { handleModal({target: 'area', isOpen: true}) }} + {...(isFlightDone)? {disabled:true} : {} } > 비행 구역 설정 @@ -268,6 +346,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele onClick={(e) => { handleModal({target: 'pilot', isOpen: true}) }} + {...(isFlightDone)? {disabled:true} : {} } > 조종사 조회 @@ -278,7 +357,9 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele index={i} data={item} handleChange={handleChange} - handleDeleteArray ={handleDeleteArray}/>) + handleDeleteArray ={handleDeleteArray} + isFlightDone={isFlightDone} + />) : } @@ -290,6 +371,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele onClick={(e) => { handleModal({target: 'arcrft', isOpen: true}); }} + {...(isFlightDone)? {disabled:true} : {} } > 기체 조회 @@ -300,7 +382,9 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele index={i} data={item} handleChange={handleChange} - handleDeleteArray ={handleDeleteArray}/>) + handleDeleteArray ={handleDeleteArray} + isFlightDone={isFlightDone} + />) : } @@ -312,6 +396,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele color='primary' size='sm' onClick={handleSave} + {...(isFlightDone)? {disabled:true} : {} } > 저장 @@ -319,6 +404,7 @@ const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDele color='danger' size='sm' onClick={handleDelete} + {...(isFlightDone)? {disabled:true} : {} } > 삭제 @@ -517,7 +603,7 @@ const AreaForm = ({data, handleChange, index}) => { ) } -const PilotForm = ({data, handleChange, index, handleDeleteArray}) => { +const PilotForm = ({data, handleChange, index, handleDeleteArray, isFlightDone}) => { return (
@@ -633,6 +719,7 @@ const PilotForm = ({data, handleChange, index, handleDeleteArray}) => { onClick={() => handleDeleteArray({ type: 'pilot', index }) } + {...(isFlightDone)? {disabled:true} : {} } > @@ -649,7 +736,7 @@ const PilotForm = ({data, handleChange, index, handleDeleteArray}) => { } -const ArcrftForm = ({data, handleChange, index, handleDeleteArray}) => { +const ArcrftForm = ({data, handleChange, index, handleDeleteArray, isFlightDone}) => { return (
@@ -789,6 +876,7 @@ const ArcrftForm = ({data, handleChange, index, handleDeleteArray}) => { onClick={() => handleDeleteArray({ type: 'arcrft', index }) } + {...(isFlightDone)? {disabled:true} : {} } > From 08471a29e9a038bbe14443086b5c2c22d65104eb Mon Sep 17 00:00:00 2001 From: sanguu Date: Thu, 25 Aug 2022 19:03:52 +0900 Subject: [PATCH 5/7] =?UTF-8?q?=EB=B9=84=ED=96=89=EA=B3=84=ED=9A=8D?= =?UTF-8?q?=EC=84=9C=20=EC=A7=80=EB=8F=84(=EB=B2=84=EA=B7=B8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basis/flight/plan/FlightPlanAreaMap.js | 56 +++++++++++++------ 1 file changed, 39 insertions(+), 17 deletions(-) diff --git a/src/components/basis/flight/plan/FlightPlanAreaMap.js b/src/components/basis/flight/plan/FlightPlanAreaMap.js index 1c9736c..31fd619 100644 --- a/src/components/basis/flight/plan/FlightPlanAreaMap.js +++ b/src/components/basis/flight/plan/FlightPlanAreaMap.js @@ -24,40 +24,62 @@ const FlightPlanAreaMap = (props) => { const [mapAreaCoordList, setMapAreaCoordList] = useState(initFlightBas.initDetail.areaList); useEffect(() => { - NaverMapInit(); + NaverMapInit(); }, []); - + useEffect(() => { setIsMapLoad(true); }, [airArea]); + useEffect(() => { ModeInit(); }, [mapControl.drawType]); useEffect(() => { + // NaverMapInit(); setMapAreaCoordList(areaCoordList) }, [areaCoordList]); const ModeInit = () => { setMode(mapControl.drawType) - } - const NaverMapInit = () => { - const mapOptions = { - // center: new naver.maps.LatLng(36.56793936069445, 127.85101412107547), - center: new naver.maps.LatLng(37.520357, 126.610166), - // zoom: 10, - zoom: 15, - zoomControl: true, - mapTypeId: naver.maps.MapTypeId.NORMAL, - zoomControlOptions: { - position: naver.maps.Position.LEFT_CENTER, - style: naver.maps.ZoomControlStyle.SMALL - } - }; - setMap(new naver.maps.Map('map', mapOptions)); + console.log(areaCoordList); + const NaverMapInit = () => { + const center = {}; + const bufferzoom ={}; + if(areaCoordList) { + center.lat = areaCoordList[0].coordList[0].lat === 0 ? 37.520357 : areaCoordList[0].coordList[0].lat; + center.lon = areaCoordList[0].coordList[0].lon === 0 ? 126.610166 : areaCoordList[0].coordList[0].lon; + if(areaCoordList[0].bufferZone>=0 && areaCoordList[0].bufferZone<2000){ + bufferzoom.bufferzoom =13; + } + else if(areaCoordList[0].bufferZone>=2000 && areaCoordList[0].bufferZone <5000){ + bufferzoom.bufferzoom =12; + } + else if(areaCoordList[0].bufferZone>=5000 && areaCoordList[0].bufferZone <=9000){ + bufferzoom.bufferzoom =11; + } + else{ + bufferzoom.bufferzoom =10; + } + } + console.log("bufferzoom>>",bufferzoom); + console.log(center); + const mapOptions2 = { + // center: new naver.maps.LatLng(36.56793936069445, 127.85101412107547), + center: new naver.maps.LatLng(center.lat, center.lon), + // zoom: 10, + zoom: bufferzoom.bufferzoom, + zoomControl: true, + mapTypeId: naver.maps.MapTypeId.NORMAL, + zoomControlOptions: { + position: naver.maps.Position.LEFT_CENTER, + style: naver.maps.ZoomControlStyle.SMALL + } + }; + setMap(new naver.maps.Map('map', mapOptions2)); } const handlerDrawType = val => { From 24bcaa1eb85098c06f83e992304094b71bb1f3d0 Mon Sep 17 00:00:00 2001 From: junh_eee Date: Thu, 25 Aug 2022 19:10:49 +0900 Subject: [PATCH 6/7] . --- src/components/basis/flight/plan/FlightPlanForm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/basis/flight/plan/FlightPlanForm.js b/src/components/basis/flight/plan/FlightPlanForm.js index a8d3eb6..be3574b 100644 --- a/src/components/basis/flight/plan/FlightPlanForm.js +++ b/src/components/basis/flight/plan/FlightPlanForm.js @@ -18,7 +18,7 @@ import { FlightPlanModal } from './FlightPlanModal'; import FlightPlanArcrftContainer from '../../../../containers/basis/flight/plan/FlightPlanArcrftContainer'; import FlightPlanAreaContainer from '../../../../containers/basis/flight/plan/FlightPlanAreaContainer'; import { X } from 'react-feather'; -import { useDispatch, useSelector } from 'react-redux'; +import { useSelector } from 'react-redux'; const FlightPlanForm = ({data, handleModal, handleChange, handleSave, handleDelete, modal, handleDeleteArray }) => { From 113ea9e4b4c411c85b0d05de919e5a10a69b24d4 Mon Sep 17 00:00:00 2001 From: junh_eee Date: Fri, 26 Aug 2022 09:38:57 +0900 Subject: [PATCH 7/7] . --- src/components/basis/flight/plan/FlightPlanAreaMap.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/basis/flight/plan/FlightPlanAreaMap.js b/src/components/basis/flight/plan/FlightPlanAreaMap.js index a75ed5a..56d9edf 100644 --- a/src/components/basis/flight/plan/FlightPlanAreaMap.js +++ b/src/components/basis/flight/plan/FlightPlanAreaMap.js @@ -44,8 +44,8 @@ const FlightPlanAreaMap = (props) => { const ModeInit = () => { setMode(mapControl.drawType) - } + const NaverMapInit = () => { const center = {}; const bufferzoom ={}; @@ -56,7 +56,7 @@ const FlightPlanAreaMap = (props) => { bufferzoom.bufferzoom =13; } else if(areaCoordList[0].bufferZone>=2000 && areaCoordList[0].bufferZone <5000){ - bufferzoom.bufferzoom =12; + bufferzoom.bufferzoom =12; } else if(areaCoordList[0].bufferZone>=5000 && areaCoordList[0].bufferZone <=9000){ bufferzoom.bufferzoom =11; @@ -77,11 +77,11 @@ const FlightPlanAreaMap = (props) => { zoomControlOptions: { position: naver.maps.Position.LEFT_CENTER, style: naver.maps.ZoomControlStyle.SMALL - } + } }; setMap(new naver.maps.Map('map', mapOptions2)); - } } + const handlerDrawType = val => { dispatch(drawTypeChangeAction(val)); };