|
|
|
@ -3,20 +3,32 @@ import qs from 'qs';
|
|
|
|
|
import { createAsyncThunk } from '@reduxjs/toolkit'; |
|
|
|
|
import { openModal } from '../../comn/message/messageSlice'; |
|
|
|
|
import { QS_OPTION } from '@src/configs/constants'; |
|
|
|
|
import { IAnalysisSimulatorListRq } from './simulationState'; |
|
|
|
|
import { |
|
|
|
|
IAnalysisSimulatorListRq, |
|
|
|
|
IAnalysisSimulatorLogRs, |
|
|
|
|
IAnalysisSimulatorRs, |
|
|
|
|
IAnalysisSimulatorStcsRs |
|
|
|
|
} from './simulationState'; |
|
|
|
|
import { MODAL_BODY, MODAL_HEADER } from '@src/configs/msgConst'; |
|
|
|
|
|
|
|
|
|
// 비행 현황 목록
|
|
|
|
|
export const getSmltList = createAsyncThunk( |
|
|
|
|
'analysis/getSmltList', |
|
|
|
|
async (data: IAnalysisSimulatorListRq, thunkAPI) => { |
|
|
|
|
async (rq: IAnalysisSimulatorListRq, thunkAPI) => { |
|
|
|
|
try { |
|
|
|
|
const queryString = qs.stringify(data.searchParams, QS_OPTION); |
|
|
|
|
const res: any = await axios.get( |
|
|
|
|
`/api/anls/smlt/list${queryString}&page=${data.page}` |
|
|
|
|
); |
|
|
|
|
const queryString = qs.stringify(rq.searchParams, QS_OPTION); |
|
|
|
|
const { |
|
|
|
|
data |
|
|
|
|
}: { |
|
|
|
|
data: { |
|
|
|
|
items: IAnalysisSimulatorRs[]; |
|
|
|
|
count: number; |
|
|
|
|
total: number; |
|
|
|
|
page: number; |
|
|
|
|
}; |
|
|
|
|
} = await axios.get(`/api/anls/smlt/list${queryString}&page=${rq.page}`); |
|
|
|
|
|
|
|
|
|
return res.data; |
|
|
|
|
return data; |
|
|
|
|
} catch (error) { |
|
|
|
|
thunkAPI.dispatch( |
|
|
|
|
openModal({ |
|
|
|
@ -33,8 +45,10 @@ export const getSmltLog = createAsyncThunk(
|
|
|
|
|
'analysis/getSmltLog', |
|
|
|
|
async (id: string, thunkAPI) => { |
|
|
|
|
try { |
|
|
|
|
const res: any = await axios.get(`/api/anls/smlt/hist/${id}`); |
|
|
|
|
return res.data; |
|
|
|
|
const { data }: { data: IAnalysisSimulatorLogRs[] } = await axios.get( |
|
|
|
|
`/api/anls/smlt/hist/${id}` |
|
|
|
|
); |
|
|
|
|
return data; |
|
|
|
|
} catch (error) { |
|
|
|
|
thunkAPI.dispatch( |
|
|
|
|
openModal({ |
|
|
|
@ -51,8 +65,10 @@ export const getSmltDetail = createAsyncThunk(
|
|
|
|
|
'analysis/getSmltDetail', |
|
|
|
|
async (id: string, thunkAPI) => { |
|
|
|
|
try { |
|
|
|
|
const res: any = await axios.get(`/api/anls/smlt/detail/${id}`); |
|
|
|
|
return res.data; |
|
|
|
|
const { data }: { data: IAnalysisSimulatorRs } = await axios.get( |
|
|
|
|
`/api/anls/smlt/detail/${id}` |
|
|
|
|
); |
|
|
|
|
return data; |
|
|
|
|
} catch (error) { |
|
|
|
|
thunkAPI.dispatch( |
|
|
|
|
openModal({ |
|
|
|
@ -69,8 +85,10 @@ export const getSmltStcs = createAsyncThunk(
|
|
|
|
|
'analysis/getSmltStcs', |
|
|
|
|
async (id: string, thunkAPI) => { |
|
|
|
|
try { |
|
|
|
|
const res: any = await axios.get(`/api/anls/smlt/stcs/${id}`); |
|
|
|
|
return res.data; |
|
|
|
|
const { data }: { data: IAnalysisSimulatorStcsRs[] } = await axios.get( |
|
|
|
|
`/api/anls/smlt/stcs/${id}` |
|
|
|
|
); |
|
|
|
|
return data; |
|
|
|
|
} catch (error) { |
|
|
|
|
thunkAPI.dispatch( |
|
|
|
|
openModal({ |
|
|
|
|