Skip to content

Commit

Permalink
fix(types): fix store types
Browse files Browse the repository at this point in the history
  • Loading branch information
anncwb committed May 24, 2021
1 parent 765064a commit cd4b5e1
Show file tree
Hide file tree
Showing 9 changed files with 227 additions and 215 deletions.
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
},
"dependencies": {
"@iconify/iconify": "^2.0.1",
"@logicflow/core": "^0.4.6",
"@logicflow/extension": "^0.4.6",
"@vueuse/core": "^4.11.0",
"@logicflow/core": "^0.4.7",
"@logicflow/extension": "^0.4.7",
"@vueuse/core": "^4.11.1",
"@zxcvbn-ts/core": "^0.3.0",
"ant-design-vue": "^2.1.6",
"axios": "^0.21.1",
Expand All @@ -47,7 +47,7 @@
"mockjs": "^1.1.0",
"nprogress": "^0.2.0",
"path-to-regexp": "^6.2.0",
"pinia": "2.0.0-alpha.19",
"pinia": "2.0.0-alpha.13",
"print-js": "^1.6.0",
"qrcode": "^1.4.4",
"sortablejs": "^1.13.0",
Expand All @@ -63,7 +63,7 @@
"devDependencies": {
"@commitlint/cli": "^12.1.4",
"@commitlint/config-conventional": "^12.1.4",
"@iconify/json": "^1.1.347",
"@iconify/json": "^1.1.348",
"@purge-icons/generated": "^0.7.0",
"@types/codemirror": "^5.60.0",
"@types/crypto-js": "^4.0.1",
Expand All @@ -75,8 +75,8 @@
"@types/qrcode": "^1.4.0",
"@types/qs": "^6.9.6",
"@types/sortablejs": "^1.10.6",
"@typescript-eslint/eslint-plugin": "^4.24.0",
"@typescript-eslint/parser": "^4.24.0",
"@typescript-eslint/eslint-plugin": "^4.25.0",
"@typescript-eslint/parser": "^4.25.0",
"@vitejs/plugin-legacy": "^1.4.0",
"@vitejs/plugin-vue": "^1.2.2",
"@vitejs/plugin-vue-jsx": "^1.1.4",
Expand Down Expand Up @@ -108,21 +108,21 @@
"stylelint-config-prettier": "^8.0.2",
"stylelint-config-standard": "^22.0.0",
"stylelint-order": "^4.1.0",
"ts-node": "^9.1.1",
"ts-node": "^10.0.0",
"typescript": "4.2.4",
"vite": "2.3.3",
"vite-plugin-compression": "^0.2.5",
"vite-plugin-html": "^2.0.7",
"vite-plugin-imagemin": "^0.3.2",
"vite-plugin-mock": "^2.5.0",
"vite-plugin-mock": "^2.5.2",
"vite-plugin-purge-icons": "^0.7.0",
"vite-plugin-pwa": "^0.7.3",
"vite-plugin-style-import": "^0.10.0",
"vite-plugin-svg-icons": "^0.5.0",
"vite-plugin-svg-icons": "^0.6.0",
"vite-plugin-theme": "^0.7.1",
"vite-plugin-windicss": "0.15.10",
"vite-plugin-windicss": "0.16.0",
"vue-eslint-parser": "^7.6.0",
"vue-tsc": "^0.1.3"
"vue-tsc": "^0.1.6"
},
"resolutions": {
"//": "Used to install imagemin dependencies, because imagemin may not be installed in China. If it is abroad, you can delete it",
Expand Down
16 changes: 8 additions & 8 deletions src/store/modules/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,31 @@ export const useAppStore = defineStore({
beforeMiniInfo: {},
}),
getters: {
getPageLoading(_) {
getPageLoading() {
return this.pageLoading;
},
getDarkMode(_): 'light' | 'dark' | string {
getDarkMode(): 'light' | 'dark' | string {
return this.darkMode || localStorage.getItem(APP_DARK_MODE_KEY_) || darkMode;
},

getBeforeMiniInfo(_) {
getBeforeMiniInfo() {
return this.beforeMiniInfo;
},

getProjectConfig(_): ProjectConfig {
getProjectConfig(): ProjectConfig {
return this.projectConfig || ({} as ProjectConfig);
},

getHeaderSetting(_) {
getHeaderSetting() {
return this.getProjectConfig.headerSetting;
},
getMenuSetting(_) {
getMenuSetting() {
return this.getProjectConfig.menuSetting;
},
getTransitionSetting(_) {
getTransitionSetting() {
return this.getProjectConfig.transitionSetting;
},
getMultiTabsSetting(_) {
getMultiTabsSetting() {
return this.getProjectConfig.multiTabsSetting;
},
},
Expand Down
4 changes: 2 additions & 2 deletions src/store/modules/errorLog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ export const useErrorLogStore = defineStore({
errorLogListCount: 0,
}),
getters: {
getErrorLogInfoList(_) {
getErrorLogInfoList() {
return this.errorLogInfoList || [];
},
getErrorLogListCount(_) {
getErrorLogListCount() {
return this.errorLogListCount;
},
},
Expand Down
4 changes: 2 additions & 2 deletions src/store/modules/locale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ export const useLocaleStore = defineStore({
localInfo: lsLocaleSetting,
}),
getters: {
getShowPicker(_) {
getShowPicker() {
return !!this.localInfo?.showPicker;
},
getLocale(_): LocaleType {
getLocale(): LocaleType {
return this.localInfo?.locale ?? 'zh_CN';
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/lock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const useLockStore = defineStore({
lockInfo: Persistent.getLocal(LOCK_INFO_KEY),
}),
getters: {
getLockInfo(_) {
getLockInfo() {
return this.lockInfo;
},
},
Expand Down
6 changes: 3 additions & 3 deletions src/store/modules/multipleTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ export const useMultipleTabStore = defineStore({
lastDragEndIndex: 0,
}),
getters: {
getTabList(_) {
getTabList() {
return this.tabList;
},
getCachedTabList(_): string[] {
getCachedTabList(): string[] {
return Array.from(this.cacheTabList);
},
getLastDragEndIndex(_): number {
getLastDragEndIndex(): number {
return this.lastDragEndIndex;
},
},
Expand Down
8 changes: 4 additions & 4 deletions src/store/modules/permission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@ export const usePermissionStore = defineStore({
backMenuList: [],
}),
getters: {
getPermCodeList(_) {
getPermCodeList() {
return this.permCodeList;
},
getBackMenuList(_) {
getBackMenuList() {
return this.backMenuList;
},
getLastBuildMenuTime(_) {
getLastBuildMenuTime() {
return this.lastBuildMenuTime;
},
getIsDynamicAddedRoute(_) {
getIsDynamicAddedRoute() {
return this.isDynamicAddedRoute;
},
},
Expand Down
6 changes: 3 additions & 3 deletions src/store/modules/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ export const useUserStore = defineStore({
roleList: [],
}),
getters: {
getUserInfo(_): UserInfo {
getUserInfo(): UserInfo {
return this.userInfo || getAuthCache<UserInfo>(USER_INFO_KEY) || {};
},
getToken(_): string {
getToken(): string {
return this.token || getAuthCache<string>(TOKEN_KEY);
},
getRoleList(_): RoleEnum[] {
getRoleList(): RoleEnum[] {
return this.roleList.length > 0 ? this.roleList : getAuthCache<RoleEnum[]>(ROLES_KEY);
},
},
Expand Down
Loading

0 comments on commit cd4b5e1

Please sign in to comment.