|
@@ -13,6 +13,7 @@ type State = {
|
|
|
addRoutes: RouteConfig[];
|
|
|
user: Partial<IUser>;
|
|
|
officials: SelectOptions<number>;
|
|
|
+ platforms: SelectOptions<string>;
|
|
|
};
|
|
|
|
|
|
// mutation 定义
|
|
@@ -21,6 +22,7 @@ enum MutationType {
|
|
|
setRoutes = "setRoutes",
|
|
|
setUser = "setUser",
|
|
|
setOfficial = "setOfficial",
|
|
|
+ setPlatforms = "setPlatforms",
|
|
|
}
|
|
|
|
|
|
type Mutations<S = State> = {
|
|
@@ -28,6 +30,7 @@ type Mutations<S = State> = {
|
|
|
[MutationType.setRoutes](state: S, routes: RouteConfig[]): void;
|
|
|
[MutationType.setUser](state: S, user: Partial<IUser>): void;
|
|
|
[MutationType.setOfficial](state: S, officials: SelectOptions<number>): void;
|
|
|
+ [MutationType.setPlatforms](state: S, platforms: SelectOptions<string>): void;
|
|
|
};
|
|
|
|
|
|
// action 定义
|
|
@@ -36,6 +39,7 @@ enum ActionType {
|
|
|
getUserRoles = "getUserRoles",
|
|
|
doLogin = "doLogin",
|
|
|
doSaveOfficial = "doSaveOfficial",
|
|
|
+ doSavePlatforms = "doSavePlatforms",
|
|
|
}
|
|
|
|
|
|
type Actions = {
|
|
@@ -48,6 +52,7 @@ type Actions = {
|
|
|
}: AugmentedActionContext): Promise<string[]>;
|
|
|
[ActionType.doLogin]({ commit }: AugmentedActionContext, user: unknown): void;
|
|
|
[ActionType.doSaveOfficial]({ commit }: AugmentedActionContext): void;
|
|
|
+ [ActionType.doSavePlatforms]({ commit }: AugmentedActionContext): void;
|
|
|
};
|
|
|
|
|
|
// getter 定义
|
|
@@ -57,6 +62,7 @@ type Getters = {
|
|
|
user(state: State): Partial<IUser>;
|
|
|
pageTitle(state: State): string;
|
|
|
officials(state: State): SelectOptions<number>;
|
|
|
+ platforms(state: State): SelectOptions<string>;
|
|
|
};
|
|
|
|
|
|
export { State, Mutations, MutationType, Actions, ActionType, Getters };
|