diff --git a/.vscode/settings.json b/.vscode/settings.json index 704663b1f054c86fee5cc02a33b66d10f40e8317..90adb1646acf31196f5b5879d55cb842ec920c1f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -118,5 +118,15 @@ "i18n-ally.enabledParsers": ["ts"], "i18n-ally.sourceLanguage": "en", "i18n-ally.enabledFrameworks": ["vue", "react"], - "cSpell.words": ["vben", "windi", "browserslist", "esnext", "antv", "tinymce", "qrcode", "sider"] + "cSpell.words": [ + "vben", + "windi", + "browserslist", + "esnext", + "antv", + "tinymce", + "qrcode", + "sider", + "pinia" + ] } diff --git a/CHANGELOG.zh_CN.md b/CHANGELOG.zh_CN.md index af4620fa40d91248e4388d279f8c5c29e08f6d48..e236c906022dffb4c57d0ce9832abbe8d1042661 100644 --- a/CHANGELOG.zh_CN.md +++ b/CHANGELOG.zh_CN.md @@ -30,6 +30,7 @@ - 修复后台模式下,Iframe 路由错误 - **PageWrapper** 修复 footer 与全局页脚同时开启时的高度计算问题 - **Menu** 修复菜单折叠动画抖动问题 +- **Store**修复 pinia 版本升级之后类型错误 ## 2.4.2(2021-06-10) diff --git a/package.json b/package.json index 3be00ad7a782eaa0ad004d040f673931d731c474..d67c814d705a33794ff0d5815084bd9dfbfec804 100644 --- a/package.json +++ b/package.json @@ -35,8 +35,8 @@ }, "dependencies": { "@iconify/iconify": "^2.0.2", - "@logicflow/core": "^0.4.15", - "@logicflow/extension": "^0.4.15", + "@logicflow/core": "^0.5.0", + "@logicflow/extension": "^0.5.0", "@vueuse/core": "^5.0.3", "@zxcvbn-ts/core": "^0.3.0", "ant-design-vue": "2.1.6", @@ -45,12 +45,12 @@ "cropperjs": "^1.5.12", "crypto-js": "^4.0.0", "echarts": "^5.1.2", - "intro.js": "^4.0.0", + "intro.js": "^4.1.0", "lodash-es": "^4.17.21", "mockjs": "^1.1.0", "nprogress": "^0.2.0", "path-to-regexp": "^6.2.0", - "pinia": "2.0.0-alpha.13", + "pinia": "2.0.0-beta.3", "print-js": "^1.6.0", "qrcode": "^1.4.4", "sortablejs": "^1.13.0", @@ -66,17 +66,17 @@ "devDependencies": { "@commitlint/cli": "^12.1.4", "@commitlint/config-conventional": "^12.1.4", - "@iconify/json": "^1.1.357", + "@iconify/json": "^1.1.358", "@purge-icons/generated": "^0.7.0", "@types/codemirror": "^5.60.0", "@types/crypto-js": "^4.0.1", "@types/fs-extra": "^9.0.11", - "@types/inquirer": "^7.3.1", + "@types/inquirer": "^7.3.2", "@types/intro.js": "^3.0.1", "@types/jest": "^26.0.23", "@types/lodash-es": "^4.17.4", "@types/mockjs": "^1.0.3", - "@types/node": "^15.12.2", + "@types/node": "^15.12.4", "@types/nprogress": "^0.2.0", "@types/qrcode": "^1.4.0", "@types/qs": "^6.9.6", @@ -94,7 +94,7 @@ "conventional-changelog-cli": "^2.1.1", "cross-env": "^7.0.3", "dotenv": "^10.0.0", - "eslint": "^7.28.0", + "eslint": "^7.29.0", "eslint-config-prettier": "^8.3.0", "eslint-define-config": "^1.0.8", "eslint-plugin-jest": "^24.3.6", diff --git a/src/store/modules/app.ts b/src/store/modules/app.ts index 5db45c51aeb38007d37057248cda9d5d3f57ba98..cb759c3bf6cc0a5f003f8663bfff4b5af36ada3b 100644 --- a/src/store/modules/app.ts +++ b/src/store/modules/app.ts @@ -1,4 +1,10 @@ -import type { ProjectConfig } from '/#/config'; +import type { + ProjectConfig, + HeaderSetting, + MenuSetting, + TransitionSetting, + MultiTabsSetting, +} from '/#/config'; import type { BeforeMiniState } from '/#/store'; import { defineStore } from 'pinia'; @@ -30,14 +36,14 @@ export const useAppStore = defineStore({ beforeMiniInfo: {}, }), getters: { - getPageLoading() { + getPageLoading(): boolean { return this.pageLoading; }, getDarkMode(): 'light' | 'dark' | string { return this.darkMode || localStorage.getItem(APP_DARK_MODE_KEY_) || darkMode; }, - getBeforeMiniInfo() { + getBeforeMiniInfo(): BeforeMiniState { return this.beforeMiniInfo; }, @@ -45,16 +51,16 @@ export const useAppStore = defineStore({ return this.projectConfig || ({} as ProjectConfig); }, - getHeaderSetting() { + getHeaderSetting(): HeaderSetting { return this.getProjectConfig.headerSetting; }, - getMenuSetting() { + getMenuSetting(): MenuSetting { return this.getProjectConfig.menuSetting; }, - getTransitionSetting() { + getTransitionSetting(): TransitionSetting { return this.getProjectConfig.transitionSetting; }, - getMultiTabsSetting() { + getMultiTabsSetting(): MultiTabsSetting { return this.getProjectConfig.multiTabsSetting; }, }, diff --git a/src/store/modules/errorLog.ts b/src/store/modules/errorLog.ts index 6adde785b6ce4df4164c5b1bfd7b3c3fed7c2387..a4b0b8c513bb8c488c879a6c07f4e85fd8e83c36 100644 --- a/src/store/modules/errorLog.ts +++ b/src/store/modules/errorLog.ts @@ -20,10 +20,10 @@ export const useErrorLogStore = defineStore({ errorLogListCount: 0, }), getters: { - getErrorLogInfoList() { + getErrorLogInfoList(): ErrorLogInfo[] { return this.errorLogInfoList || []; }, - getErrorLogListCount() { + getErrorLogListCount(): number { return this.errorLogListCount; }, }, diff --git a/src/store/modules/locale.ts b/src/store/modules/locale.ts index a244c6f179ca48c1a13ccb4369f88ca4923dcad9..8d72ffc79cc0ab40e6b34519b52dc2dca1753426 100644 --- a/src/store/modules/locale.ts +++ b/src/store/modules/locale.ts @@ -21,7 +21,7 @@ export const useLocaleStore = defineStore({ localInfo: lsLocaleSetting, }), getters: { - getShowPicker() { + getShowPicker(): boolean { return !!this.localInfo?.showPicker; }, getLocale(): LocaleType { diff --git a/src/store/modules/lock.ts b/src/store/modules/lock.ts index 8d19f9d656a9c7792e2e8cc2f01956cdd7a46a0b..f76dffedd5ef143ddbee539fd65e076e2ad2ba00 100644 --- a/src/store/modules/lock.ts +++ b/src/store/modules/lock.ts @@ -16,7 +16,7 @@ export const useLockStore = defineStore({ lockInfo: Persistent.getLocal(LOCK_INFO_KEY), }), getters: { - getLockInfo() { + getLockInfo(): Nullable { return this.lockInfo; }, }, diff --git a/src/store/modules/multipleTab.ts b/src/store/modules/multipleTab.ts index b540b8c5c8614b1164a357481c741c4df77439fa..3dcb188a7bcad7ee101ec39cec2e8598d69176af 100644 --- a/src/store/modules/multipleTab.ts +++ b/src/store/modules/multipleTab.ts @@ -38,7 +38,7 @@ export const useMultipleTabStore = defineStore({ lastDragEndIndex: 0, }), getters: { - getTabList() { + getTabList(): RouteLocationNormalized[] { return this.tabList; }, getCachedTabList(): string[] { diff --git a/src/store/modules/permission.ts b/src/store/modules/permission.ts index 14c7a46331baeddf2f72efd39617e9f6f32ff379..380f035608928a66cbc3b7e5d7f22c9212e09fbc 100644 --- a/src/store/modules/permission.ts +++ b/src/store/modules/permission.ts @@ -25,7 +25,7 @@ import { useMessage } from '/@/hooks/web/useMessage'; interface PermissionState { // Permission code list - permCodeList: string[]; + permCodeList: string[] | number[]; // Whether the route has been dynamically added isDynamicAddedRoute: boolean; // To trigger a menu update @@ -45,16 +45,16 @@ export const usePermissionStore = defineStore({ backMenuList: [], }), getters: { - getPermCodeList() { + getPermCodeList(): string[] | number[] { return this.permCodeList; }, - getBackMenuList() { + getBackMenuList(): Menu[] { return this.backMenuList; }, - getLastBuildMenuTime() { + getLastBuildMenuTime(): number { return this.lastBuildMenuTime; }, - getIsDynamicAddedRoute() { + getIsDynamicAddedRoute(): boolean { return this.isDynamicAddedRoute; }, }, diff --git a/yarn.lock b/yarn.lock index 3d26c8b9a36079b7b139b7e8eab74bc198174995..4596fa1a80cfdbea9a2a9d5b4696dc7f0cb2df69 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1431,10 +1431,10 @@ dependencies: cross-fetch "^3.0.6" -"@iconify/json@^1.1.357": - version "1.1.357" - resolved "https://registry.npmjs.org/@iconify/json/-/json-1.1.357.tgz#63dd3b358b80a3774e24ce0a136488b819a20dbd" - integrity sha512-X4tXnyCKCAKRopGtvQjp3LmPX3TaUUfi2DwD41SQItBp9PbsZXg9+tYJbWjl0+gFFv7ikdzAp+yGIaXuZT/k5g== +"@iconify/json@^1.1.358": + version "1.1.358" + resolved "https://registry.yarnpkg.com/@iconify/json/-/json-1.1.358.tgz#173610937bca36f2ad194ed4adf2797a445e4852" + integrity sha512-FHNwGJiLHkYMxzxzdOAue1y3rizXkvlAqZesEo1gErJbad7Xri9uN2N2grT/GfHSKyhg5EiCMgV2E3VFV2wJMA== "@intlify/core-base@9.1.6": version "9.1.6" @@ -1688,21 +1688,21 @@ "@types/yargs" "^16.0.0" chalk "^4.0.0" -"@logicflow/core@^0.4.15": - version "0.4.15" - resolved "https://registry.npmjs.org/@logicflow/core/-/core-0.4.15.tgz#0e13d51b64403416eed6a3229b2d232869ca8dd5" - integrity sha512-JtgRL/ZM+FjjibrOkswkuKzeX3XMnozmq/h0YC/HBRpv0ZHynrlCQGqI1SQsD3tDIkaN4wBnHM9DIqIIwf7ZBQ== +"@logicflow/core@^0.5.0": + version "0.5.0" + resolved "https://registry.yarnpkg.com/@logicflow/core/-/core-0.5.0.tgz#c7068ce179400ae54927d71199288a304d2c9b9b" + integrity sha512-PG+7vsfQcUXyDIAtF7sU7eNk3++6BcXcknr50RlWdTcCvo+vPIRqM5d6eq291Srry7S4RAv7nsspAEjd8G0gkA== dependencies: "@types/mousetrap" "^1.6.4" mousetrap "^1.6.5" preact "^10.4.8" -"@logicflow/extension@^0.4.15": - version "0.4.15" - resolved "https://registry.npmjs.org/@logicflow/extension/-/extension-0.4.15.tgz#d68e8824aca89b8966d71ec1a68ce95bebe3169a" - integrity sha512-J6BRp5ZpOY/kyQmT8eCiLM+y+OWKClNDpWmiVSYdp0Rr8fGH1U4A8ITYvcte45nXorHLcg659PdHZaYqZtzJog== +"@logicflow/extension@^0.5.0": + version "0.5.0" + resolved "https://registry.yarnpkg.com/@logicflow/extension/-/extension-0.5.0.tgz#f512ba706a97deab8923b0e4efb1e545a35bb1a3" + integrity sha512-wAzQsidlFFOYxaFn6E6G1/BQu8rrjuoCNPz6lkQufJoRJ6pGrtL4tl0ERGP4ut+xyns/P6sOWDA2dsvZGtg6Vw== dependencies: - "@logicflow/core" "^0.4.15" + "@logicflow/core" "^0.5.0" ids "^1.0.0" preact "^10.4.8" @@ -2133,10 +2133,10 @@ dependencies: "@types/node" "*" -"@types/inquirer@^7.3.1": - version "7.3.1" - resolved "https://registry.npmjs.org/@types/inquirer/-/inquirer-7.3.1.tgz#1f231224e7df11ccfaf4cf9acbcc3b935fea292d" - integrity sha512-osD38QVIfcdgsPCT0V3lD7eH0OFurX71Jft18bZrsVQWVRt6TuxRzlr0GJLrxoHZR2V5ph7/qP8se/dcnI7o0g== +"@types/inquirer@^7.3.2": + version "7.3.2" + resolved "https://registry.yarnpkg.com/@types/inquirer/-/inquirer-7.3.2.tgz#35d2ef4d98dd42feeb4e1256cdeb9f13f457d420" + integrity sha512-EkeX/hU0SWinA2c7Qu/+6+7KbepFPYJcjankUgtA/VSY6BlVHybL0Cgyey9PDbXwhNXnNGBLU3t+MORp23RgAw== dependencies: "@types/through" "*" rxjs "^6.4.0" @@ -2227,10 +2227,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-14.17.1.tgz#5e07e0cb2ff793aa7a1b41deae76221e6166049f" integrity sha512-/tpUyFD7meeooTRwl3sYlihx2BrJE7q9XF71EguPFIySj9B7qgnRtHsHTho+0AUm4m1SvWGm6uSncrR94q6Vtw== -"@types/node@^15.12.2": - version "15.12.2" - resolved "https://registry.npmjs.org/@types/node/-/node-15.12.2.tgz#1f2b42c4be7156ff4a6f914b2fb03d05fa84e38d" - integrity sha512-zjQ69G564OCIWIOHSXyQEEDpdpGl+G348RAKY0XXy9Z5kU9Vzv1GMNnkar/ZJ8dzXB3COzD9Mo9NtRZ4xfgUww== +"@types/node@^15.12.4": + version "15.12.4" + resolved "https://registry.yarnpkg.com/@types/node/-/node-15.12.4.tgz#e1cf817d70a1e118e81922c4ff6683ce9d422e26" + integrity sha512-zrNj1+yqYF4WskCMOHwN+w9iuD12+dGm0rQ35HLl9/Ouuq52cEtd0CH9qMgrdNmi5ejC1/V7vKEXYubB+65DkA== "@types/normalize-package-data@^2.4.0": version "2.4.0" @@ -5148,10 +5148,10 @@ eslint-visitor-keys@^2.0.0: resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz#21fdc8fbcd9c795cc0321f0563702095751511a8" integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== -eslint@^7.28.0: - version "7.28.0" - resolved "https://registry.npmjs.org/eslint/-/eslint-7.28.0.tgz#435aa17a0b82c13bb2be9d51408b617e49c1e820" - integrity sha512-UMfH0VSjP0G4p3EWirscJEQ/cHqnT/iuH6oNZOB94nBjWbMnhGEPxsZm1eyIW0C/9jLI0Fow4W5DXLjEI7mn1g== +eslint@^7.29.0: + version "7.29.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.29.0.tgz#ee2a7648f2e729485e4d0bd6383ec1deabc8b3c0" + integrity sha512-82G/JToB9qIy/ArBzIWG9xvvwL3R86AlCjtGw+A29OMZDqhTybz/MByORSukGxeI+YPCR4coYyITKk8BFH9nDA== dependencies: "@babel/code-frame" "7.12.11" "@eslint/eslintrc" "^0.4.2" @@ -6760,10 +6760,10 @@ into-stream@^3.1.0: from2 "^2.1.1" p-is-promise "^1.1.0" -intro.js@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/intro.js/-/intro.js-4.0.0.tgz#6897f0dc6bb9997f73613ae3c7cd26e16b05a5eb" - integrity sha512-IS8+p4rpnWUq2Vd8YRgjR8w9lbyLvT0ptscBqA4iudO68oven39CvxHfxopfwlNUGgmgcyX17DOETof+D90AXA== +intro.js@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/intro.js/-/intro.js-4.1.0.tgz#7e4ae5877df0c452b23d1fd96f2666eb87796b22" + integrity sha512-+Y+UsP+yvqqlEOjFExMBXKopn3nzwc91PaUl0SrvqiVs6ztko1DzfkoXR2AnfirZVZZhr5Aej6wlXRlvIkuMcA== is-accessor-descriptor@^0.1.6: version "0.1.6" @@ -9411,10 +9411,12 @@ pify@^4.0.1: resolved "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== -pinia@2.0.0-alpha.13: - version "2.0.0-alpha.13" - resolved "https://registry.npmjs.com/pinia/-/pinia-2.0.0-alpha.13.tgz#d48e6efec11d38201e20770bc02b168e2157a9f7" - integrity sha512-3r9fpUi5Uai48vjeTXzcHAvlDjYvx/9mNtWiO5QyWy4zqfn7YjvOiBCHXH9r1jwo4LakZzG/ppr5i6sr/63fYQ== +pinia@2.0.0-beta.3: + version "2.0.0-beta.3" + resolved "https://registry.yarnpkg.com/pinia/-/pinia-2.0.0-beta.3.tgz#c6f0d07da54dc5aa237f4cc9281898e927b33d16" + integrity sha512-4ygKhe9FrYD69tJ7nSdgHm9Ldb0aM/Nzyb8Qz/RZuzOyOr85jWHNmCAhCytWy0l9C4/ypGJYCEJ3vuZfyWjcZA== + dependencies: + "@vue/devtools-api" "^6.0.0-beta.14" pinkie-promise@^2.0.0: version "2.0.1"