hhjk00 11 months ago
parent
commit
4a4e5116f1
  1. 3
      src/components/laanc/step/LaancStep1.js
  2. 1
      src/components/laanc/step/LaancStep2.js
  3. 43
      src/modules/laanc/sagas/laancSagas.ts

3
src/components/laanc/step/LaancStep1.js

@ -157,10 +157,13 @@ export default function LaancStep1({
// 고도 150 미만 핸들러
const handleBlur = (value, type) => {
const maxElev = 150;
// 관제권안에서 허용고도 초과시 경고문
const controlledAltitudeExceededWarning =
laancArea?.duplicated &&
parseInt(value.replace('/^0+/', 'm', ''), 10) >= laancElev &&
parseInt(value.replace('/^0+/', 'm', ''), 10) < maxElev;
switch (type) {
case 'fltElev':
if (

1
src/components/laanc/step/LaancStep2.js

@ -67,6 +67,7 @@ export default function LaancStep2({
handlerStep(3);
}
}, [laancPdf]);
// 소수점 6자리에서 반올림 하는 함수
const truncateToSixDecimalPlaces = number => {
const decimalPlaces = 6;

43
src/modules/laanc/sagas/laancSagas.ts

@ -1,4 +1,10 @@
import { call, put, select, takeEvery } from '@redux-saga/core/effects';
import {
call,
put,
takeLatest,
takeEvery,
debounce
} from '@redux-saga/core/effects';
import * as Actions from '../actions/laancActions';
import { ActionType } from 'typesafe-actions';
import * as MessageActions from '../../comn/message/actions/comnMessageAction';
@ -7,7 +13,7 @@ import { ERROR_MESSAGE, SAVE_MESSAGE } from '../../../configs/constants';
// pdf 연결
// laanc 승인 여부
function* postApprovalsata(
function* postApprovalSaga(
action: ActionType<typeof Actions.LAANC_FLIGHT_Approval.request>
) {
try {
@ -15,16 +21,6 @@ function* postApprovalsata(
const res = yield call(Apis.laancApi.postApproval, detail);
// const { data } = res;
// yield put(
// MessageActions.IS_MESSAGE({
// messageCode: SAVE_MESSAGE.code,
// message: SAVE_MESSAGE.message,
// isHistoryBack: true,
// isRefresh: false
// })
// );
yield put(Actions.LAANC_FLIGHT_Approval.success(res.data));
} catch (error) {
yield put(
@ -35,29 +31,16 @@ function* postApprovalsata(
isRefresh: false
})
);
// yield put(Actions.FLIGHT_PLAN_CREATE.failure(error));
}
}
// laanc 생성
function* postCreatesata(
export function* postCreateSaga(
action: ActionType<typeof Actions.LAANC_FLIGHT_CREATE.request>
) {
try {
const detail = action.payload;
const res = yield call(Apis.laancApi.postCreate, detail);
// const { data } = res;
// localStorage.setItem('pdfUrl', res.data.pdfUrl);
// yield put(
// MessageActions.IS_MESSAGE({
// messageCode: SAVE_MESSAGE.code,
// message: SAVE_MESSAGE.message,
// isHistoryBack: true,
// isRefresh: false
// })
// );
yield put(Actions.LAANC_FLIGHT_CREATE.success(res.data));
} catch (error) {
yield put(
@ -68,9 +51,9 @@ function* postCreatesata(
isRefresh: false
})
);
// yield put(Actions.FLIGHT_PLAN_CREATE.failure(error));
}
}
// laanc 일물 일출
function* getSunDataSaga(
action: ActionType<typeof Actions.LAANC_SUN_DATA.request>
@ -170,10 +153,10 @@ function* postValidAreaSaga(
}
}
export function* laancSaga() {
yield takeEvery(Actions.LAANC_FLIGHT_Approval.request, postApprovalsata);
yield takeEvery(Actions.LAANC_FLIGHT_CREATE.request, postCreatesata);
yield takeEvery(Actions.LAANC_FLIGHT_Approval.request, postApprovalSaga);
yield debounce(500, Actions.LAANC_FLIGHT_CREATE.request, postCreateSaga);
yield takeEvery(Actions.LAANC_SUN_DATA.request, getSunDataSaga);
yield takeEvery(Actions.LAANC_APRV_LIST.request, getAprvListSaga);
yield debounce(500, Actions.LAANC_APRV_LIST.request, getAprvListSaga);
yield takeEvery(Actions.LAANC_DETAIL.request, getDetailSaga);
yield takeEvery(Actions.LAANC_ALTITUDE.request, postValidElevSaga);
yield takeEvery(Actions.LAANC_VALID_AREA.request, postValidAreaSaga);

Loading…
Cancel
Save