- import('../map/FlightArea'));
+const LaancMap = lazy(() => import('../map/LaancMap'));
-export default function LaancStep2({
- data,
- handlerStep,
- centeredModal,
- setCenteredModal,
- handlerLaancClose
-}) {
+export default function LaancStep2({ data, handlerStep, handlerLaancClose }) {
const obj = {
fltType: {
COMMERCIAL: '사업',
@@ -57,13 +51,6 @@ export default function LaancStep2({
// 약관 동의 데이터
useEffect(() => {
- // dispatch(
- // TermsActions.getTermsList.request({
- // langDivCd: 'KOR',
- // siteCd: 'SANDBOX',
- // termsCtgryCd: 'AGREE_LAANC'
- // })
- // );
dispatch(
getTermsList({
langDivCd: 'KOR',
@@ -149,11 +136,7 @@ export default function LaancStep2({
diff --git a/src/components/laanc/step/LaancStep3.js b/src/components/laanc/step/LaancStep3.js
index 0032d35c..1f63ef23 100644
--- a/src/components/laanc/step/LaancStep3.js
+++ b/src/components/laanc/step/LaancStep3.js
@@ -18,14 +18,12 @@ import { CheckCircle } from 'react-feather';
import { HOST } from '../../../configs/constants';
pdfjs.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfjs.version}/pdf.worker.js`;
-const FlightArea = lazy(() => import('../map/FlightArea'));
+const LaancMap = lazy(() => import('../map/LaancMap'));
export default function LaancStep3({
disabledAnimation,
data,
setDisabledAnimation,
- handlerLaancClose,
- centeredModal,
- setCenteredModal
+ handlerLaancClose
}) {
const obj = {
fltType: {
@@ -85,12 +83,7 @@ export default function LaancStep3({
diff --git a/src/containers/basis/flight/plan/WeatherContainer.js b/src/containers/basis/flight/plan/WeatherContainer.js
index f2149d8c..847a7a81 100644
--- a/src/containers/basis/flight/plan/WeatherContainer.js
+++ b/src/containers/basis/flight/plan/WeatherContainer.js
@@ -22,9 +22,9 @@ export default function WeatherContainer({ mapAreaCoordList }) {
let plus_day2 = dayjs().add(2, 'day').format('YYYYMMDD');
useEffect(() => {
- if (weather.baseDate != '') {
+ if (weather?.baseDate != '') {
let wheatherobj = {};
- const weatherData = weather.response.body.items?.item;
+ const weatherData = weather?.response.body.items?.item;
//오늘 날씨 필터링
const todayres = weatherData.filter(
weatherData => weatherData.fcstDate == date
diff --git a/src/containers/laanc/LaancContainer.js b/src/containers/laanc/LaancContainer.js
index 8c4ff864..d5ad5289 100644
--- a/src/containers/laanc/LaancContainer.js
+++ b/src/containers/laanc/LaancContainer.js
@@ -7,7 +7,7 @@ import {
clientInitLaanc,
clientInitAreaDetailInitial
} from '@src/redux/features/laanc/laancSlice';
-import { clientDrawTypeChange } from '@src/redux/features/control/map/mapSlice';
+import { clientChangeDrawType } from '@src/redux/features/laanc/laancSlice';
import { Link } from 'react-router-dom';
const LaancPlanContainer = lazy(() => import('./LaancPlanContainer'));
const LaancSearch = lazy(() =>
@@ -32,7 +32,7 @@ export default function LaancContainer() {
// URL 쿼리 파라미터 중 'map' 값을 가져옵니다.
useEffect(() => {
// Redux Store 초기화
- dispatch(clientDrawTypeChange(''));
+ dispatch(clientChangeDrawType(''));
dispatch(clientInitLaanc());
dispatch(clientInitAreaDetailInitial());
setDisabledAnimation(mapParam != 'true' ? false : true);
@@ -47,7 +47,7 @@ export default function LaancContainer() {
// LAANC 신청하기 버튼 클릭 헨들러
const handleApply = () => {
- dispatch(clientDrawTypeChange(''));
+ dispatch(clientChangeDrawType(''));
dispatch(clientInitLaanc());
dispatch(clientInitAreaDetailInitial());
setDisabledAnimation(true);
diff --git a/src/containers/laanc/LaancPlanContainer.js b/src/containers/laanc/LaancPlanContainer.js
index 4935bcd8..d5f1b6bb 100644
--- a/src/containers/laanc/LaancPlanContainer.js
+++ b/src/containers/laanc/LaancPlanContainer.js
@@ -2,8 +2,10 @@ import { lazy, useEffect, useState, Suspense } from 'react';
import { initFlightBasState } from '@src/redux/features/laanc/laancState';
import { Modal } from '@component/ui';
import { useDispatch, useSelector } from '@src/redux/store';
-import { clientDrawTypeChange } from '@src/redux/features/control/map/mapSlice';
-import { clientInitAreaDetailInitial } from '@src/redux/features/laanc/laancSlice';
+import {
+ clientInitAreaDetailInitial,
+ clientChangeDrawType
+} from '@src/redux/features/laanc/laancSlice';
const LaancStep1 = lazy(() => import('../../components/laanc/step/LaancStep1'));
const LaancStep2 = lazy(() => import('../../components/laanc/step/LaancStep2'));
@@ -22,8 +24,6 @@ export default function LaancPlanContainer({
const [step, setStep] = useState(1);
// laanc 초기값
const [detailData, setDetailData] = useState(initFlightBasState.initDetail);
- // 비행 구역 보달
- const [centeredModal, setCenteredModal] = useState(false);
// 로그인 회원 정보 세팅
useEffect(() => {
@@ -35,7 +35,7 @@ export default function LaancPlanContainer({
});
}
return () => {
- dispatch(clientDrawTypeChange(''));
+ dispatch(clientChangeDrawType(''));
};
}, []);
@@ -67,8 +67,6 @@ export default function LaancPlanContainer({
)}
@@ -93,8 +89,6 @@ export default function LaancPlanContainer({
disabledAnimation={disabledAnimation}
setDisabledAnimation={setDisabledAnimation}
handlerLaancClose={handlerLaancClose}
- centeredModal={centeredModal}
- setCenteredModal={setCenteredModal}
/>
)}
diff --git a/src/redux/features/control/map/mapSlice.ts b/src/redux/features/control/map/mapSlice.ts
index cc3ac622..c3aa1e32 100644
--- a/src/redux/features/control/map/mapSlice.ts
+++ b/src/redux/features/control/map/mapSlice.ts
@@ -13,7 +13,6 @@ const initMap: IMapState = {
area0005: true,
area0006: true,
areaType: 'linear',
- drawType: '',
flightAreaMarker: undefined
};
@@ -77,10 +76,6 @@ const mapSlice = createSlice({
state = { ...state, ...initArea };
}
},
- clientDrawTypeChange: (state, action) => {
- const value = action.payload;
- state.drawType = value;
- },
clientFlightAreaClick: (state, action) => {
const value = action.payload;
state.flightAreaMarker = value;
@@ -91,7 +86,6 @@ const mapSlice = createSlice({
export const {
clientAreaClick,
- clientDrawTypeChange,
clientFlightAreaClick,
clientMapInit,
clientMapTypeChange,
diff --git a/src/redux/features/control/map/mapState.ts b/src/redux/features/control/map/mapState.ts
index 45ed8299..86adf32d 100644
--- a/src/redux/features/control/map/mapState.ts
+++ b/src/redux/features/control/map/mapState.ts
@@ -10,6 +10,5 @@ export interface IMapState {
area0005: boolean;
area0006: boolean;
areaType: string;
- drawType: string;
flightAreaMarker: any;
}
diff --git a/src/redux/features/laanc/laancSlice.ts b/src/redux/features/laanc/laancSlice.ts
index 1aa39e14..88ac7834 100644
--- a/src/redux/features/laanc/laancSlice.ts
+++ b/src/redux/features/laanc/laancSlice.ts
@@ -295,7 +295,10 @@ export const initLaanc: laancState = {
planAreaDuplicatd: false, // 비행 구역 중복 여부 시간 중복 == 비행구역내에 타 사용자 비행구역 정보
flight: false // 무조건 날 수 있음
}
- }
+ },
+
+ drawType: '',
+ isOpenModal: false
};
const laancSlice = createSlice({
@@ -329,6 +332,14 @@ const laancSlice = createSlice({
clientSaveAreaDetailList: (state, action) => {
state.areaList = action.payload as IFlightPlanAreaDataRq[];
state.areaCoordList = action.payload as IFlightPlanAreaDataRq[];
+ },
+ // 비행계획서 그리기 타입 지정
+ clientChangeDrawType: (state, action) => {
+ state.drawType = action.payload as string;
+ },
+ // Laanc 계획서 모달
+ clientControlLaancModal: (state, action) => {
+ state.isOpenModal = action.payload as boolean;
}
},
extraReducers: builder => {
@@ -378,7 +389,9 @@ export const {
clientInitAreaDetailInitial,
clientAltitudeData,
clientRoupSelect,
- clientSaveAreaDetailList
+ clientSaveAreaDetailList,
+ clientChangeDrawType,
+ clientControlLaancModal
} = laancSlice.actions;
export const laancReducer = laancSlice.reducer;
diff --git a/src/redux/features/laanc/laancState.ts b/src/redux/features/laanc/laancState.ts
index 46c22e4f..9eb309d8 100644
--- a/src/redux/features/laanc/laancState.ts
+++ b/src/redux/features/laanc/laancState.ts
@@ -15,6 +15,9 @@ export interface laancState {
laancQrData: ILaancTsQrRs;
scheduleList: IBasFlightScheduleListRs[] | [];
selectGroup: ISelectGroupRs;
+
+ drawType: string;
+ isOpenModal: boolean;
}
export interface IweatherRs {