|
|
|
@ -1,10 +1,9 @@
|
|
|
|
|
import { createSlice } from '@reduxjs/toolkit'; |
|
|
|
|
import { |
|
|
|
|
initiaControlGp, |
|
|
|
|
IControlGpArcrftWarnListRs, |
|
|
|
|
IControlGpRq, |
|
|
|
|
IControlGroupAuthData, |
|
|
|
|
IControlGpCountData, |
|
|
|
|
IControlDetailRs |
|
|
|
|
IControlGpState, |
|
|
|
|
IControlGroupAuthData |
|
|
|
|
} from './gpState'; |
|
|
|
|
import { |
|
|
|
|
getHistory, |
|
|
|
@ -19,7 +18,12 @@ import {
|
|
|
|
|
controlDt |
|
|
|
|
} from './gpThunk'; |
|
|
|
|
|
|
|
|
|
interface Iasd { |
|
|
|
|
export const initiaControlGp: IControlGpState = { |
|
|
|
|
controlGpList: [], |
|
|
|
|
controlGroupAuthInfo: [] |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
interface IControlGpPayload { |
|
|
|
|
controlGpList: IControlGpRq[]; |
|
|
|
|
controlGroupAuthInfo: IControlGroupAuthData[]; |
|
|
|
|
} |
|
|
|
@ -30,107 +34,109 @@ const controlGpSlice = createSlice({
|
|
|
|
|
reducers: {}, |
|
|
|
|
extraReducers: builder => { |
|
|
|
|
builder.addCase(getControlGp.fulfilled, (state, action) => { |
|
|
|
|
// const { controlGpList, controlGroupAuthInfo } = action.payload;
|
|
|
|
|
// state.controlGpList = controlGpList as IControlGpRq[];
|
|
|
|
|
// state.controlGroupAuthInfo = controlGroupAuthInfo;
|
|
|
|
|
const { controlGpList, controlGroupAuthInfo } = |
|
|
|
|
action.payload as IControlGpPayload; |
|
|
|
|
|
|
|
|
|
state.controlGpList = controlGpList; |
|
|
|
|
state.controlGroupAuthInfo = controlGroupAuthInfo; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
const controlGpFlightPlanSlice = createSlice({ |
|
|
|
|
name: 'controlGpFlightPlanSlice', |
|
|
|
|
initialState: initiaControlGp, |
|
|
|
|
reducers: { |
|
|
|
|
ClientcontrolGpFlightPlanInit: (state, action) => { |
|
|
|
|
state.controlGpFltPlanList = undefined; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
extraReducers: builder => { |
|
|
|
|
builder.addCase(checkPlanContains.fulfilled, (state, action) => { |
|
|
|
|
const data = action.payload; |
|
|
|
|
state.controlGpContains = data; |
|
|
|
|
}); |
|
|
|
|
// const controlGpFlightPlanSlice = createSlice({
|
|
|
|
|
// name: 'controlGpFlightPlanSlice',
|
|
|
|
|
// initialState: initiaControlGp,
|
|
|
|
|
// reducers: {
|
|
|
|
|
// ClientcontrolGpFlightPlanInit: (state, action) => {
|
|
|
|
|
// state.controlGpFltPlanList = undefined;
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// extraReducers: builder => {
|
|
|
|
|
// builder.addCase(checkPlanContains.fulfilled, (state, action) => {
|
|
|
|
|
// const data = action.payload;
|
|
|
|
|
// state.controlGpContains = data;
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
builder.addCase(getFlightPlan.fulfilled, (state, action) => { |
|
|
|
|
const list = action.payload; |
|
|
|
|
state.controlGpFltPlanList = list; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
// builder.addCase(getFlightPlan.fulfilled, (state, action) => {
|
|
|
|
|
// const list = action.payload;
|
|
|
|
|
// state.controlGpFltPlanList = list;
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
const controlGpLogSlice = createSlice({ |
|
|
|
|
name: 'controlGpLogSlice', |
|
|
|
|
initialState: initiaControlGp, |
|
|
|
|
reducers: {}, |
|
|
|
|
extraReducers: builder => { |
|
|
|
|
builder.addCase(getWarnLog.fulfilled, (state, action) => { |
|
|
|
|
const data = action.payload; |
|
|
|
|
state.controlGpWarnLog = data; |
|
|
|
|
}); |
|
|
|
|
builder.addCase(getArcrftWarn.fulfilled, (state, action) => { |
|
|
|
|
const list = action.payload; |
|
|
|
|
state.controlGpArcrftWarnList = list; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
// const controlGpLogSlice = createSlice({
|
|
|
|
|
// name: 'controlGpLogSlice',
|
|
|
|
|
// initialState: initiaControlGp,
|
|
|
|
|
// reducers: {},
|
|
|
|
|
// extraReducers: builder => {
|
|
|
|
|
// builder.addCase(getWarnLog.fulfilled, (state, action) => {
|
|
|
|
|
// const data = action.payload;
|
|
|
|
|
// state.controlGpWarnLog = data;
|
|
|
|
|
// });
|
|
|
|
|
// builder.addCase(getArcrftWarn.fulfilled, (state, action) => {
|
|
|
|
|
// const list = action.payload;
|
|
|
|
|
// state.controlGpArcrftWarnList = list;
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
const controlGpHisSlice = createSlice({ |
|
|
|
|
name: 'controlGpHisSlice', |
|
|
|
|
initialState: initiaControlGp, |
|
|
|
|
reducers: {}, |
|
|
|
|
extraReducers: builder => { |
|
|
|
|
builder.addCase(getHistory.fulfilled, (state, action) => { |
|
|
|
|
const { controlGpHistory } = action.payload; |
|
|
|
|
state.controlGpHistory = controlGpHistory; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
// const controlGpHisSlice = createSlice({
|
|
|
|
|
// name: 'controlGpHisSlice',
|
|
|
|
|
// initialState: initiaControlGp,
|
|
|
|
|
// reducers: {},
|
|
|
|
|
// extraReducers: builder => {
|
|
|
|
|
// builder.addCase(getHistory.fulfilled, (state, action) => {
|
|
|
|
|
// const { controlGpHistory } = action.payload;
|
|
|
|
|
// state.controlGpHistory = controlGpHistory;
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
const controlGpDtlSlice = createSlice({ |
|
|
|
|
name: 'controlGpDtlSlice', |
|
|
|
|
initialState: initiaControlGp, |
|
|
|
|
reducers: {}, |
|
|
|
|
extraReducers: builder => { |
|
|
|
|
builder.addCase(getDetail.fulfilled, (state, action) => { |
|
|
|
|
const { controlGpDetail } = action.payload; |
|
|
|
|
state.controlGpDetail = controlGpDetail; |
|
|
|
|
}); |
|
|
|
|
builder.addCase(apiweather.fulfilled, (state, action) => { |
|
|
|
|
state.controlWheather = action.payload; |
|
|
|
|
}); |
|
|
|
|
builder.addCase(controlDt.fulfilled, (state, action) => { |
|
|
|
|
const data: any = action.payload; |
|
|
|
|
state.controlDetail = data; |
|
|
|
|
// state.controlDetail = action.payload;
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
// const controlGpDtlSlice = createSlice({
|
|
|
|
|
// name: 'controlGpDtlSlice',
|
|
|
|
|
// initialState: initiaControlGp,
|
|
|
|
|
// reducers: {},
|
|
|
|
|
// extraReducers: builder => {
|
|
|
|
|
// builder.addCase(getDetail.fulfilled, (state, action) => {
|
|
|
|
|
// const { controlGpDetail } = action.payload;
|
|
|
|
|
// state.controlGpDetail = controlGpDetail;
|
|
|
|
|
// });
|
|
|
|
|
// builder.addCase(apiweather.fulfilled, (state, action) => {
|
|
|
|
|
// state.controlWheather = action.payload;
|
|
|
|
|
// });
|
|
|
|
|
// builder.addCase(controlDt.fulfilled, (state, action) => {
|
|
|
|
|
// const data: any = action.payload;
|
|
|
|
|
// state.controlDetail = data;
|
|
|
|
|
// // state.controlDetail = action.payload;
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
export const controlGpCountSlice = createSlice({ |
|
|
|
|
name: 'controlGpCountSlice', |
|
|
|
|
initialState: initiaControlGp, |
|
|
|
|
reducers: { |
|
|
|
|
ClientcontrolGpCountInit: (state, action) => { |
|
|
|
|
const drone = action.payload.count.drone; |
|
|
|
|
const flight = action.payload.count.flight; |
|
|
|
|
// export const controlGpCountSlice = createSlice({
|
|
|
|
|
// name: 'controlGpCountSlice',
|
|
|
|
|
// initialState: initiaControlGp,
|
|
|
|
|
// reducers: {
|
|
|
|
|
// ClientcontrolGpCountInit: (state, action) => {
|
|
|
|
|
// const drone = action.payload.count.drone;
|
|
|
|
|
// const flight = action.payload.count.flight;
|
|
|
|
|
|
|
|
|
|
state.controlGpCountDrone = drone; |
|
|
|
|
state.controlGpCountFlight = flight; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
// state.controlGpCountDrone = drone;
|
|
|
|
|
// state.controlGpCountFlight = flight;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
export const { ClientcontrolGpFlightPlanInit } = |
|
|
|
|
controlGpFlightPlanSlice.actions; |
|
|
|
|
export const controlGpLogAction = controlGpLogSlice.actions; |
|
|
|
|
export const controlGpHisAction = controlGpHisSlice.actions; |
|
|
|
|
export const controlGpRtDtlAction = controlGpDtlSlice.actions; |
|
|
|
|
export const { ClientcontrolGpCountInit } = controlGpCountSlice.actions; |
|
|
|
|
export const controlGpDtlAction = controlGpDtlSlice.actions; |
|
|
|
|
// export const { ClientcontrolGpFlightPlanInit } =
|
|
|
|
|
// controlGpFlightPlanSlice.actions;
|
|
|
|
|
// export const controlGpLogAction = controlGpLogSlice.actions;
|
|
|
|
|
// export const controlGpHisAction = controlGpHisSlice.actions;
|
|
|
|
|
// export const controlGpRtDtlAction = controlGpDtlSlice.actions;
|
|
|
|
|
// export const { ClientcontrolGpCountInit } = controlGpCountSlice.actions;
|
|
|
|
|
// export const controlGpDtlAction = controlGpDtlSlice.actions;
|
|
|
|
|
|
|
|
|
|
export const controlGpReducer = controlGpSlice.reducer; |
|
|
|
|
export const controlGpLogReducer = controlGpLogSlice.reducer; |
|
|
|
|
export const controlGpHisReducer = controlGpHisSlice.reducer; |
|
|
|
|
export const controlGpDtlReducer = controlGpDtlSlice.reducer; |
|
|
|
|
export const controlGpFltPlanReducer = controlGpFlightPlanSlice.reducer; |
|
|
|
|
export const controlGpCountReducer = controlGpCountSlice.reducer; |
|
|
|
|
// export const controlGpLogReducer = controlGpLogSlice.reducer;
|
|
|
|
|
// export const controlGpHisReducer = controlGpHisSlice.reducer;
|
|
|
|
|
// export const controlGpDtlReducer = controlGpDtlSlice.reducer;
|
|
|
|
|
// export const controlGpFltPlanReducer = controlGpFlightPlanSlice.reducer;
|
|
|
|
|
// export const controlGpCountReducer = controlGpCountSlice.reducer;
|
|
|
|
|