|
@@ -12,6 +12,7 @@ type State = {
|
|
|
routes: RouteConfig[];
|
|
|
addRoutes: RouteConfig[];
|
|
|
user: Partial<IUser>;
|
|
|
+ officials: SelectOptions<number>;
|
|
|
};
|
|
|
|
|
|
// mutation 定义
|
|
@@ -19,12 +20,14 @@ enum MutationType {
|
|
|
setRoles = "setRoles",
|
|
|
setRoutes = "setRoutes",
|
|
|
setUser = "setUser",
|
|
|
+ setOfficial = "setOfficial",
|
|
|
}
|
|
|
|
|
|
type Mutations<S = State> = {
|
|
|
[MutationType.setRoles](state: S, roles: string[]): void;
|
|
|
[MutationType.setRoutes](state: S, routes: RouteConfig[]): void;
|
|
|
[MutationType.setUser](state: S, user: Partial<IUser>): void;
|
|
|
+ [MutationType.setOfficial](state: S, officials: SelectOptions<number>): void;
|
|
|
};
|
|
|
|
|
|
// action 定义
|
|
@@ -32,6 +35,7 @@ enum ActionType {
|
|
|
generatorRoutes = "generatorRoutes",
|
|
|
getUserRoles = "getUserRoles",
|
|
|
doLogin = "doLogin",
|
|
|
+ doSaveOfficial = "doSaveOfficial",
|
|
|
}
|
|
|
|
|
|
type Actions = {
|
|
@@ -43,6 +47,7 @@ type Actions = {
|
|
|
commit,
|
|
|
}: AugmentedActionContext): Promise<string[]>;
|
|
|
[ActionType.doLogin]({ commit }: AugmentedActionContext, user: unknown): void;
|
|
|
+ [ActionType.doSaveOfficial]({ commit }: AugmentedActionContext): void;
|
|
|
};
|
|
|
|
|
|
// getter 定义
|
|
@@ -51,6 +56,7 @@ type Getters = {
|
|
|
userRoles(state: State): string[];
|
|
|
user(state: State): Partial<IUser>;
|
|
|
pageTitle(state: State): string;
|
|
|
+ officials(state: State): SelectOptions<number>;
|
|
|
};
|
|
|
|
|
|
export { State, Mutations, MutationType, Actions, ActionType, Getters };
|