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/FlightPlanAreaMap.js b/src/components/basis/flight/plan/FlightPlanAreaMap.js
index 1c9736c..56d9edf 100644
--- a/src/components/basis/flight/plan/FlightPlanAreaMap.js
+++ b/src/components/basis/flight/plan/FlightPlanAreaMap.js
@@ -24,41 +24,63 @@ 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));
- }
+
+ 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 => {
dispatch(drawTypeChangeAction(val));
diff --git a/src/components/basis/flight/plan/FlightPlanForm.js b/src/components/basis/flight/plan/FlightPlanForm.js
index 33c3d05..be3574b 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,
@@ -18,12 +18,39 @@ 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 }) => {
const {areaList, pilotList, arcrftList} = data;
+ const { detail } = useSelector(state => state.flightState);
+
+ const [date ,setDate] = useState();
+ const [isFlightDone, setIsFlightDone] = 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) {
+ setIsFlightDone(true);
+ } else {
+ setIsFlightDone(false);
+ }
+ }
+ }, [date])
+
return (