Add feature support for qrart (#34)
This commit is contained in:
1 parent
091fa4d18a
commit
2fe1cb4e1d
110 files changed
+5767
-334
No files matched your search
@@ -0,0 +1,59 @@
|
||||
import { IApplication, ICredential, IQrartConfig, IQrartTask, IService } from '@/models';
|
||||
import { IQrartState } from './models';
|
||||
|
||||
export const resetAll = (state: IQrartState): void => {
|
||||
state.application = undefined;
|
||||
state.config = {};
|
||||
state.tasks = undefined;
|
||||
};
|
||||
|
||||
export const setService = (state: IQrartState, payload: IService): void => {
|
||||
state.service = payload;
|
||||
};
|
||||
|
||||
export const setCredential = (state: IQrartState, payload: ICredential): void => {
|
||||
state.credential = payload;
|
||||
};
|
||||
|
||||
export const setApplication = (state: IQrartState, payload: IApplication): void => {
|
||||
state.application = payload;
|
||||
};
|
||||
|
||||
export const setConfig = (state: IQrartState, payload: IQrartConfig): void => {
|
||||
state.config = payload;
|
||||
};
|
||||
|
||||
export const setTasksItems = (state: IQrartState, payload: IQrartTask[]): void => {
|
||||
const newPayload = {
|
||||
...state.tasks,
|
||||
items: payload
|
||||
} as typeof state.tasks;
|
||||
state.tasks = newPayload;
|
||||
};
|
||||
|
||||
export const setTasksTotal = (state: IQrartState, payload: number): void => {
|
||||
const newPayload = {
|
||||
...state.tasks,
|
||||
total: payload
|
||||
} as typeof state.tasks;
|
||||
state.tasks = newPayload;
|
||||
};
|
||||
|
||||
export const setTasksActive = (state: IQrartState, payload: IQrartTask): void => {
|
||||
const newPayload = {
|
||||
...state.tasks,
|
||||
active: payload
|
||||
} as typeof state.tasks;
|
||||
state.tasks = newPayload;
|
||||
};
|
||||
|
||||
export default {
|
||||
setApplication,
|
||||
setConfig,
|
||||
setCredential,
|
||||
setService,
|
||||
setTasksActive,
|
||||
setTasksItems,
|
||||
setTasksTotal,
|
||||
resetAll
|
||||
};
|
||||
Reference in new issue
Block a user