sanguu516(박상현)
1 year ago
9 changed files with 349 additions and 34 deletions
@ -0,0 +1,34 @@ |
|||||||
|
import { AxiosError } from 'axios'; |
||||||
|
import { create } from 'sortablejs'; |
||||||
|
import { ActionType, createAction, createAsyncAction } from 'typesafe-actions'; |
||||||
|
import { LaancFlightData, LaancApproval } from '../models/laancModels'; |
||||||
|
|
||||||
|
// laanc 공문 pdf 다운로드
|
||||||
|
const LAANC_PDF_REQUEST = 'laanc/pdf/REQUEST'; |
||||||
|
const LAANC_PDF_SUCCESS = 'laanc/pdf/SUCCESS'; |
||||||
|
const LAANC_PDF_FAILURE = 'laanc/pdf/FAILURE'; |
||||||
|
|
||||||
|
// laanc 비행계획서 승인
|
||||||
|
const LAANC_FLIGHT_APPROVAL_REQUEST = 'laanc/approval/REQUEST'; |
||||||
|
const LAANC_FLIGHT_APPROVAL_SUCCESS = 'laanc/approval/SUCCESS'; |
||||||
|
const LAANC_FLIGHT_APPROVAL_FAILURE = 'laanc/approval/FAILURE'; |
||||||
|
|
||||||
|
// laanc 공문 pdf 다운로드
|
||||||
|
export const laancPdfAction = createAsyncAction( |
||||||
|
LAANC_PDF_REQUEST, |
||||||
|
LAANC_PDF_SUCCESS, |
||||||
|
LAANC_PDF_FAILURE |
||||||
|
)<string, string, AxiosError>(); |
||||||
|
|
||||||
|
// laanc 비행계획서 승인
|
||||||
|
export const laancFlightApproval = createAsyncAction( |
||||||
|
LAANC_FLIGHT_APPROVAL_REQUEST, |
||||||
|
LAANC_FLIGHT_APPROVAL_SUCCESS, |
||||||
|
LAANC_FLIGHT_APPROVAL_FAILURE |
||||||
|
)<LaancApproval, LaancApproval, AxiosError>(); |
||||||
|
|
||||||
|
const actions = { |
||||||
|
laancPdfAction, |
||||||
|
laancFlightApproval |
||||||
|
}; |
||||||
|
export type LaancAction = ActionType<typeof actions>; |
@ -0,0 +1,13 @@ |
|||||||
|
import axios from '../../utils/customAxiosUtil'; |
||||||
|
import {} from '../models/laancModels'; |
||||||
|
|
||||||
|
// laanc 승인
|
||||||
|
// export const laancApprovalApi = {
|
||||||
|
// postApproval: async (rq:) => {
|
||||||
|
// const { data }: ResponseApprovalData = await axios.post(
|
||||||
|
// `api/ctr/cntrl/history/list/${id}`
|
||||||
|
// );
|
||||||
|
|
||||||
|
// return data;
|
||||||
|
// },
|
||||||
|
// }
|
@ -0,0 +1,221 @@ |
|||||||
|
import moment from 'moment'; |
||||||
|
|
||||||
|
export interface laancState { |
||||||
|
laancApproval: LaancApproval | undefined; |
||||||
|
} |
||||||
|
|
||||||
|
// laanc계획서 초기값
|
||||||
|
export const LaancFlightData = { |
||||||
|
page: 1, |
||||||
|
total: 0, |
||||||
|
plan: { |
||||||
|
planSno: 0, |
||||||
|
groupId: '', |
||||||
|
cstmrSno: 0, |
||||||
|
memberName: '', |
||||||
|
email: '', |
||||||
|
hpno: '', |
||||||
|
clncd: '+82', |
||||||
|
addr: '', |
||||||
|
addrDtlCn: '', |
||||||
|
zip: '', |
||||||
|
schFltStDt: moment().format('YYYY-MM-DD HH:mm:ss'), |
||||||
|
schFltEndDt: moment().format('YYYY-MM-DD HH:mm:ss'), |
||||||
|
fltPurpose: '', |
||||||
|
aprvlYn: '', |
||||||
|
delYn: '', |
||||||
|
createUserId: '', |
||||||
|
createDt: '', |
||||||
|
updateUserId: '', |
||||||
|
updateDt: '', |
||||||
|
areaList: undefined, |
||||||
|
pilotList: undefined, |
||||||
|
arcrftList: undefined |
||||||
|
}, |
||||||
|
pilot: { |
||||||
|
planPilotSno: 0, |
||||||
|
planSno: 0, |
||||||
|
cstmrSno: 0, |
||||||
|
groupNm: '', |
||||||
|
memberName: '', |
||||||
|
email: '', |
||||||
|
hpno: '', |
||||||
|
clncd: '+82', |
||||||
|
addr: '', |
||||||
|
addrDtlCn: '', |
||||||
|
zip: '', |
||||||
|
qlfcNo: '', |
||||||
|
carrer: '', |
||||||
|
createUserId: '', |
||||||
|
createDt: '', |
||||||
|
updateUserId: '', |
||||||
|
updateDt: '' |
||||||
|
}, |
||||||
|
arcrft: { |
||||||
|
planArcrftSno: 0, |
||||||
|
planSno: 0, |
||||||
|
arcrftSno: 0, |
||||||
|
idntfNum: '', |
||||||
|
groupNm: '', |
||||||
|
prdctNum: '', |
||||||
|
arcrftTypeCd: '', |
||||||
|
arcrftModelNm: '', |
||||||
|
prdctCmpnNm: '', |
||||||
|
prdctDate: '', |
||||||
|
arcrftLngth: 0, |
||||||
|
arcrftWdth: 0, |
||||||
|
arcrftHght: 0, |
||||||
|
arcrftWght: 0, |
||||||
|
wghtTypeCd: '', |
||||||
|
imageUrl: '', |
||||||
|
takeoffWght: 0, |
||||||
|
useYn: '', |
||||||
|
cameraYn: '', |
||||||
|
insrncYn: '', |
||||||
|
ownerNm: '', |
||||||
|
createUserId: '', |
||||||
|
createDt: '', |
||||||
|
updateUserId: '', |
||||||
|
updateDt: '' |
||||||
|
}, |
||||||
|
area: { |
||||||
|
planAreaSno: 0, |
||||||
|
planSno: 0, |
||||||
|
areaType: '', |
||||||
|
fltMethod: '', |
||||||
|
bufferZone: 0, |
||||||
|
fltElev: '', |
||||||
|
createUserId: '', |
||||||
|
createDt: '', |
||||||
|
updateUserId: '', |
||||||
|
updateDt: '', |
||||||
|
coordList: undefined |
||||||
|
}, |
||||||
|
coord: { |
||||||
|
planAreaCoordSno: 0, |
||||||
|
planAreaSno: 0, |
||||||
|
lat: 0, |
||||||
|
lon: 0, |
||||||
|
createUserId: '', |
||||||
|
createDt: '' |
||||||
|
}, |
||||||
|
initDetail: { |
||||||
|
planSno: 0, |
||||||
|
groupId: '', |
||||||
|
cstmrSno: 0, |
||||||
|
memberName: '', |
||||||
|
email: '', |
||||||
|
hpno: '', |
||||||
|
clncd: '+82', |
||||||
|
addr: '', |
||||||
|
addrDtlCn: '', |
||||||
|
zip: '', |
||||||
|
schFltStDt: moment().format('YYYY-MM-DD HH:mm:ss'), |
||||||
|
schFltEndDt: moment().format('YYYY-MM-DD HH:mm:ss'), |
||||||
|
fltPurpose: '', |
||||||
|
aprvlYn: '', |
||||||
|
delYn: '', |
||||||
|
createUserId: '', |
||||||
|
createDt: '', |
||||||
|
updateUserId: '', |
||||||
|
updateDt: '', |
||||||
|
areaList: [ |
||||||
|
{ |
||||||
|
planAreaSno: 0, |
||||||
|
planSno: 0, |
||||||
|
areaType: '', |
||||||
|
fltMethod: '', |
||||||
|
bufferZone: 0, |
||||||
|
fltElev: '', |
||||||
|
createUserId: '', |
||||||
|
createDt: '', |
||||||
|
updateUserId: '', |
||||||
|
updateDt: '', |
||||||
|
coordList: [ |
||||||
|
{ |
||||||
|
planAreaCoordSno: 0, |
||||||
|
planAreaSno: 0, |
||||||
|
lat: 0, |
||||||
|
lon: 0, |
||||||
|
createUserId: '', |
||||||
|
createDt: '' |
||||||
|
} |
||||||
|
], |
||||||
|
bufferCoordList: [ |
||||||
|
{ |
||||||
|
planAreaCoordSno: 0, |
||||||
|
planAreaSno: 0, |
||||||
|
lat: 0, |
||||||
|
lon: 0, |
||||||
|
createUserId: '', |
||||||
|
createDt: '' |
||||||
|
} |
||||||
|
] |
||||||
|
} |
||||||
|
], |
||||||
|
pilotList: [ |
||||||
|
{ |
||||||
|
planPilotSno: 0, |
||||||
|
planSno: 0, |
||||||
|
cstmrSno: 0, |
||||||
|
groupNm: '', |
||||||
|
memberName: '', |
||||||
|
email: '', |
||||||
|
hpno: '', |
||||||
|
clncd: '+82', |
||||||
|
addr: '', |
||||||
|
addrDtlCn: '', |
||||||
|
zip: '', |
||||||
|
qlfcNo: '', |
||||||
|
carrer: '', |
||||||
|
createUserId: '', |
||||||
|
createDt: '', |
||||||
|
updateUserId: '', |
||||||
|
updateDt: '' |
||||||
|
} |
||||||
|
], |
||||||
|
arcrftList: [ |
||||||
|
{ |
||||||
|
planArcrftSno: 0, |
||||||
|
planSno: 0, |
||||||
|
arcrftSno: 0, |
||||||
|
idntfNum: '', |
||||||
|
groupNm: '', |
||||||
|
prdctNum: '', |
||||||
|
arcrftTypeCd: '', |
||||||
|
arcrftModelNm: '', |
||||||
|
prdctCmpnNm: '', |
||||||
|
prdctDate: '', |
||||||
|
arcrftLngth: 0, |
||||||
|
arcrftWdth: 0, |
||||||
|
arcrftHght: 0, |
||||||
|
arcrftWght: 0, |
||||||
|
wghtTypeCd: '', |
||||||
|
imageUrl: '', |
||||||
|
takeoffWght: 0, |
||||||
|
useYn: '', |
||||||
|
cameraYn: '', |
||||||
|
insrncYn: '', |
||||||
|
ownerNm: '', |
||||||
|
createUserId: '', |
||||||
|
createDt: '', |
||||||
|
updateUserId: '', |
||||||
|
updateDt: '' |
||||||
|
} |
||||||
|
] |
||||||
|
} |
||||||
|
}; |
||||||
|
|
||||||
|
// laanc 승인 model
|
||||||
|
export interface LaancApproval { |
||||||
|
pilotQlfcYn: string; // 자격여부
|
||||||
|
acrftInsuranceYn: string; // 항공기보험여부
|
||||||
|
acrftDuplicatedYn: string; // 기체 중복여부
|
||||||
|
planAreaDuplicatdYn: string; // 비행계획서비행구역 중복여부
|
||||||
|
evaluatedTargetAreaYn: string; // 평가대상지역여부 - 공역과 겹칠때만
|
||||||
|
flightAreaYn: string; // LAANC 기준 비행가능여부
|
||||||
|
} |
||||||
|
|
||||||
|
export const laancControlData = { |
||||||
|
laancApproval: undefined |
||||||
|
}; |
@ -0,0 +1,26 @@ |
|||||||
|
// base
|
||||||
|
import produce from 'immer'; |
||||||
|
|
||||||
|
import { createReducer } from 'typesafe-actions'; |
||||||
|
|
||||||
|
import * as Actions from '../actions/laancActions'; |
||||||
|
// action
|
||||||
|
import { laancPdfAction } from '../actions/laancActions'; |
||||||
|
|
||||||
|
import { |
||||||
|
LaancFlightData, |
||||||
|
laancState, |
||||||
|
laancControlData |
||||||
|
} from '../models/laancModels'; |
||||||
|
|
||||||
|
export const laancReducer = createReducer<laancState, Actions.LaancAction>( |
||||||
|
laancControlData |
||||||
|
).handleAction(Actions.laancFlightApproval.success, (state, action) => |
||||||
|
produce(state, draft => { |
||||||
|
// laanc 승인 처리
|
||||||
|
const data = action.payload; |
||||||
|
draft.laancApproval = data; |
||||||
|
}) |
||||||
|
); |
||||||
|
|
||||||
|
export default laancReducer; |
@ -0,0 +1,18 @@ |
|||||||
|
import { call, put, select, takeEvery } from '@redux-saga/core/effects'; |
||||||
|
import * as Actions from '../actions/laancActions'; |
||||||
|
import { ActionType } from 'typesafe-actions'; |
||||||
|
|
||||||
|
// pdf 연결
|
||||||
|
function* getLaancPdfsaga( |
||||||
|
action: ActionType<typeof Actions.laancPdfAction.request> |
||||||
|
) {} |
||||||
|
|
||||||
|
// laanc 승인 여부
|
||||||
|
function* postApprovalsata( |
||||||
|
action: ActionType<typeof Actions.laancFlightApproval.request> |
||||||
|
) {} |
||||||
|
|
||||||
|
export function* laancSaga() { |
||||||
|
yield takeEvery(Actions.laancPdfAction.request, getLaancPdfsaga); |
||||||
|
yield takeEvery(Actions.laancFlightApproval.request, postApprovalsata); |
||||||
|
} |
Loading…
Reference in new issue