refactor: state类型声明移动至types目录下

This commit is contained in:
郝先瑞
2022-03-20 23:46:03 +08:00
parent c77e8878fa
commit 518104e269
19 changed files with 78 additions and 78 deletions

View File

@@ -1,5 +1,5 @@
/**
* 登录请求参数类型声明
* 登录表单类型声明
*/
export interface LoginFormData {
username: string,

View File

@@ -19,7 +19,6 @@ export interface UserQueryParam extends PageQueryParam {
deptId: number | undefined
}
/**
* 用户分页列表项声明
*/

View File

@@ -1 +0,0 @@
export * from './member'

View File

@@ -11,12 +11,15 @@ export * from './api/system/client'
export * from './api/pms/goods'
export * from './api/pms/brand'
export * from './api/sms/advert'
export * from './api/oms/order'
export * from './api/ums/member'
export * from './store/user'
export * from './store/app'
export * from './store/permission'
export * from './store/setting'
export * from './store/tagsView'
export * from './common'

12
src/types/store/app.d.ts vendored Normal file
View File

@@ -0,0 +1,12 @@
/**
* 用户状态类型声明
*/
export interface AppState {
device: string,
sidebar: {
opened: boolean,
withoutAnimation: boolean
},
language:string,
size:string
}

9
src/types/store/permission.d.ts vendored Normal file
View File

@@ -0,0 +1,9 @@
import {RouteRecordRaw} from "vue-router";
/**
* 权限类型声明
*/
export interface PermissionState{
routes:RouteRecordRaw[]
addRoutes: RouteRecordRaw[]
}

10
src/types/store/setting.d.ts vendored Normal file
View File

@@ -0,0 +1,10 @@
/**
* 设置状态类型声明
*/
export interface SettingState {
theme: string,
tagsView: boolean,
fixedHeader: boolean,
showSettings: boolean,
sidebarLogo: boolean
}

12
src/types/store/tagsView.d.ts vendored Normal file
View File

@@ -0,0 +1,12 @@
import {RouteLocationNormalized} from "vue-router";
/**
* 用户状态类型声明
*/
export interface TagView extends Partial<RouteLocationNormalized> {
title?: string
}
export interface TagsViewState{
visitedViews: TagView[],
cachedViews: (string)[]
}

10
src/types/store/user.d.ts vendored Normal file
View File

@@ -0,0 +1,10 @@
/**
* 用户状态类型声明
*/
export interface UserState {
token: string,
nickname: string,
avatar: string,
roles: string[],
perms: string[]
}