提交 cd4b5e14 作者: vben

fix(types): fix store types

上级 765064a1
...@@ -33,9 +33,9 @@ ...@@ -33,9 +33,9 @@
}, },
"dependencies": { "dependencies": {
"@iconify/iconify": "^2.0.1", "@iconify/iconify": "^2.0.1",
"@logicflow/core": "^0.4.6", "@logicflow/core": "^0.4.7",
"@logicflow/extension": "^0.4.6", "@logicflow/extension": "^0.4.7",
"@vueuse/core": "^4.11.0", "@vueuse/core": "^4.11.1",
"@zxcvbn-ts/core": "^0.3.0", "@zxcvbn-ts/core": "^0.3.0",
"ant-design-vue": "^2.1.6", "ant-design-vue": "^2.1.6",
"axios": "^0.21.1", "axios": "^0.21.1",
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
"mockjs": "^1.1.0", "mockjs": "^1.1.0",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"path-to-regexp": "^6.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", "print-js": "^1.6.0",
"qrcode": "^1.4.4", "qrcode": "^1.4.4",
"sortablejs": "^1.13.0", "sortablejs": "^1.13.0",
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
"devDependencies": { "devDependencies": {
"@commitlint/cli": "^12.1.4", "@commitlint/cli": "^12.1.4",
"@commitlint/config-conventional": "^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", "@purge-icons/generated": "^0.7.0",
"@types/codemirror": "^5.60.0", "@types/codemirror": "^5.60.0",
"@types/crypto-js": "^4.0.1", "@types/crypto-js": "^4.0.1",
...@@ -75,8 +75,8 @@ ...@@ -75,8 +75,8 @@
"@types/qrcode": "^1.4.0", "@types/qrcode": "^1.4.0",
"@types/qs": "^6.9.6", "@types/qs": "^6.9.6",
"@types/sortablejs": "^1.10.6", "@types/sortablejs": "^1.10.6",
"@typescript-eslint/eslint-plugin": "^4.24.0", "@typescript-eslint/eslint-plugin": "^4.25.0",
"@typescript-eslint/parser": "^4.24.0", "@typescript-eslint/parser": "^4.25.0",
"@vitejs/plugin-legacy": "^1.4.0", "@vitejs/plugin-legacy": "^1.4.0",
"@vitejs/plugin-vue": "^1.2.2", "@vitejs/plugin-vue": "^1.2.2",
"@vitejs/plugin-vue-jsx": "^1.1.4", "@vitejs/plugin-vue-jsx": "^1.1.4",
...@@ -108,21 +108,21 @@ ...@@ -108,21 +108,21 @@
"stylelint-config-prettier": "^8.0.2", "stylelint-config-prettier": "^8.0.2",
"stylelint-config-standard": "^22.0.0", "stylelint-config-standard": "^22.0.0",
"stylelint-order": "^4.1.0", "stylelint-order": "^4.1.0",
"ts-node": "^9.1.1", "ts-node": "^10.0.0",
"typescript": "4.2.4", "typescript": "4.2.4",
"vite": "2.3.3", "vite": "2.3.3",
"vite-plugin-compression": "^0.2.5", "vite-plugin-compression": "^0.2.5",
"vite-plugin-html": "^2.0.7", "vite-plugin-html": "^2.0.7",
"vite-plugin-imagemin": "^0.3.2", "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-purge-icons": "^0.7.0",
"vite-plugin-pwa": "^0.7.3", "vite-plugin-pwa": "^0.7.3",
"vite-plugin-style-import": "^0.10.0", "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-theme": "^0.7.1",
"vite-plugin-windicss": "0.15.10", "vite-plugin-windicss": "0.16.0",
"vue-eslint-parser": "^7.6.0", "vue-eslint-parser": "^7.6.0",
"vue-tsc": "^0.1.3" "vue-tsc": "^0.1.6"
}, },
"resolutions": { "resolutions": {
"//": "Used to install imagemin dependencies, because imagemin may not be installed in China. If it is abroad, you can delete it", "//": "Used to install imagemin dependencies, because imagemin may not be installed in China. If it is abroad, you can delete it",
......
...@@ -30,31 +30,31 @@ export const useAppStore = defineStore({ ...@@ -30,31 +30,31 @@ export const useAppStore = defineStore({
beforeMiniInfo: {}, beforeMiniInfo: {},
}), }),
getters: { getters: {
getPageLoading(_) { getPageLoading() {
return this.pageLoading; return this.pageLoading;
}, },
getDarkMode(_): 'light' | 'dark' | string { getDarkMode(): 'light' | 'dark' | string {
return this.darkMode || localStorage.getItem(APP_DARK_MODE_KEY_) || darkMode; return this.darkMode || localStorage.getItem(APP_DARK_MODE_KEY_) || darkMode;
}, },
getBeforeMiniInfo(_) { getBeforeMiniInfo() {
return this.beforeMiniInfo; return this.beforeMiniInfo;
}, },
getProjectConfig(_): ProjectConfig { getProjectConfig(): ProjectConfig {
return this.projectConfig || ({} as ProjectConfig); return this.projectConfig || ({} as ProjectConfig);
}, },
getHeaderSetting(_) { getHeaderSetting() {
return this.getProjectConfig.headerSetting; return this.getProjectConfig.headerSetting;
}, },
getMenuSetting(_) { getMenuSetting() {
return this.getProjectConfig.menuSetting; return this.getProjectConfig.menuSetting;
}, },
getTransitionSetting(_) { getTransitionSetting() {
return this.getProjectConfig.transitionSetting; return this.getProjectConfig.transitionSetting;
}, },
getMultiTabsSetting(_) { getMultiTabsSetting() {
return this.getProjectConfig.multiTabsSetting; return this.getProjectConfig.multiTabsSetting;
}, },
}, },
......
...@@ -20,10 +20,10 @@ export const useErrorLogStore = defineStore({ ...@@ -20,10 +20,10 @@ export const useErrorLogStore = defineStore({
errorLogListCount: 0, errorLogListCount: 0,
}), }),
getters: { getters: {
getErrorLogInfoList(_) { getErrorLogInfoList() {
return this.errorLogInfoList || []; return this.errorLogInfoList || [];
}, },
getErrorLogListCount(_) { getErrorLogListCount() {
return this.errorLogListCount; return this.errorLogListCount;
}, },
}, },
......
...@@ -21,10 +21,10 @@ export const useLocaleStore = defineStore({ ...@@ -21,10 +21,10 @@ export const useLocaleStore = defineStore({
localInfo: lsLocaleSetting, localInfo: lsLocaleSetting,
}), }),
getters: { getters: {
getShowPicker(_) { getShowPicker() {
return !!this.localInfo?.showPicker; return !!this.localInfo?.showPicker;
}, },
getLocale(_): LocaleType { getLocale(): LocaleType {
return this.localInfo?.locale ?? 'zh_CN'; return this.localInfo?.locale ?? 'zh_CN';
}, },
}, },
......
...@@ -16,7 +16,7 @@ export const useLockStore = defineStore({ ...@@ -16,7 +16,7 @@ export const useLockStore = defineStore({
lockInfo: Persistent.getLocal(LOCK_INFO_KEY), lockInfo: Persistent.getLocal(LOCK_INFO_KEY),
}), }),
getters: { getters: {
getLockInfo(_) { getLockInfo() {
return this.lockInfo; return this.lockInfo;
}, },
}, },
......
...@@ -38,13 +38,13 @@ export const useMultipleTabStore = defineStore({ ...@@ -38,13 +38,13 @@ export const useMultipleTabStore = defineStore({
lastDragEndIndex: 0, lastDragEndIndex: 0,
}), }),
getters: { getters: {
getTabList(_) { getTabList() {
return this.tabList; return this.tabList;
}, },
getCachedTabList(_): string[] { getCachedTabList(): string[] {
return Array.from(this.cacheTabList); return Array.from(this.cacheTabList);
}, },
getLastDragEndIndex(_): number { getLastDragEndIndex(): number {
return this.lastDragEndIndex; return this.lastDragEndIndex;
}, },
}, },
......
...@@ -45,16 +45,16 @@ export const usePermissionStore = defineStore({ ...@@ -45,16 +45,16 @@ export const usePermissionStore = defineStore({
backMenuList: [], backMenuList: [],
}), }),
getters: { getters: {
getPermCodeList(_) { getPermCodeList() {
return this.permCodeList; return this.permCodeList;
}, },
getBackMenuList(_) { getBackMenuList() {
return this.backMenuList; return this.backMenuList;
}, },
getLastBuildMenuTime(_) { getLastBuildMenuTime() {
return this.lastBuildMenuTime; return this.lastBuildMenuTime;
}, },
getIsDynamicAddedRoute(_) { getIsDynamicAddedRoute() {
return this.isDynamicAddedRoute; return this.isDynamicAddedRoute;
}, },
}, },
......
...@@ -38,13 +38,13 @@ export const useUserStore = defineStore({ ...@@ -38,13 +38,13 @@ export const useUserStore = defineStore({
roleList: [], roleList: [],
}), }),
getters: { getters: {
getUserInfo(_): UserInfo { getUserInfo(): UserInfo {
return this.userInfo || getAuthCache<UserInfo>(USER_INFO_KEY) || {}; return this.userInfo || getAuthCache<UserInfo>(USER_INFO_KEY) || {};
}, },
getToken(_): string { getToken(): string {
return this.token || getAuthCache<string>(TOKEN_KEY); return this.token || getAuthCache<string>(TOKEN_KEY);
}, },
getRoleList(_): RoleEnum[] { getRoleList(): RoleEnum[] {
return this.roleList.length > 0 ? this.roleList : getAuthCache<RoleEnum[]>(ROLES_KEY); return this.roleList.length > 0 ? this.roleList : getAuthCache<RoleEnum[]>(ROLES_KEY);
}, },
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论