diff --git a/package.json b/package.json index e1044d8b2e8e7c08c56429f00a9113b781ba865a..139559054a7787fbf999571fdb60cdbd69bf2e23 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,8 @@ "@unocss/preset-attributify": "^0.58.0", "@unocss/preset-icons": "^0.58.0", "@unocss/preset-uno": "^0.58.0", - "@vue/compiler-sfc": "3.3.9", + "@vue/compiler-sfc": "3.3.11", + "@vue/runtime-core": "3.3.11", "@vitejs/plugin-vue": "4.5.2", "autoprefixer": "10.4.14", "eslint": "8.55.0", diff --git a/src/layout/components/Settings/index.vue b/src/layout/components/Settings/index.vue index 89b1f4c8b986820024f3a60f3a0ac043663f2ee4..3082bebd46e24e7ae00960bf952ff83cea20158e 100644 --- a/src/layout/components/Settings/index.vue +++ b/src/layout/components/Settings/index.vue @@ -126,7 +126,7 @@ const toggleDark = () => useToggle(isDark); const topNavChange = (val: any) => { if (!val) { appStore.toggleSideBarHide(false); - permissionStore.setSidebarRouters(permissionStore.defaultRoutes); + permissionStore.setSidebarRouters(permissionStore.defaultRoutes as any); } }; diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue index a905c70a107f4902be630c8b6a1e045c04a1c06d..f42473abaab543596976ba9c7e7ee441f632d980 100644 --- a/src/layout/components/Sidebar/index.vue +++ b/src/layout/components/Sidebar/index.vue @@ -13,7 +13,7 @@ :collapse-transition="false" mode="vertical" > - + @@ -29,7 +29,7 @@ import useSettingsStore from '@/store/modules/settings'; import usePermissionStore from '@/store/modules/permission'; import { RouteRecordRaw } from 'vue-router'; -const { proxy } = getCurrentInstance(); +const { proxy } = getCurrentInstance() as ComponentInternalInstance; const route = useRoute(); const appStore = useAppStore(); diff --git a/src/layout/components/TopBar/search.vue b/src/layout/components/TopBar/search.vue index 62322a487a367ed11d2d8fc39f8a41d0f111b465..440b88d872e2a42799d9ddf9274559068796d5fa 100644 --- a/src/layout/components/TopBar/search.vue +++ b/src/layout/components/TopBar/search.vue @@ -54,7 +54,7 @@ const state = reactive({ const openSearch = () => { state.menuQuery = ''; state.isShowSearch = true; - state.menuList = generateRoutes(routes.value); + state.menuList = generateRoutes(routes.value as any); nextTick(() => { setTimeout(() => { layoutMenuAutocompleteRef.value.focus(); diff --git a/src/permission.ts b/src/permission.ts index 69795f849d55b2ea0d3639510b05813c4717abc6..ef9976aaa3e46f1fbd470ac8612e6105f025ec32 100644 --- a/src/permission.ts +++ b/src/permission.ts @@ -40,8 +40,6 @@ router.beforeEach(async (to, from, next) => { router.addRoute(route); // 动态添加可访问路由表 } }); - const n = { ...to, replace: true }; - console.log(n); next({ path: to.path, replace: true, params: to.params, query: to.query, hash: to.hash, name: to.name as string }); // hack方法 确保addRoutes已完成 } } else { diff --git a/src/types/axios.d.ts b/src/types/axios.d.ts index 2451f2afe8e2b1bf0f2f65fd8bce66f675a4c4df..9f2c6d2e9f36aa4e88f05b793b9e9ab66afbbd1f 100644 --- a/src/types/axios.d.ts +++ b/src/types/axios.d.ts @@ -1,5 +1,4 @@ -import axios from 'axios'; - +export {}; declare module 'axios' { interface AxiosResponse { code: number; diff --git a/src/types/element.d.ts b/src/types/element.d.ts index 6a7bdefabbff3ca66b4c434f916f13feb0b83f0a..208777392ac28ac0b3ccd7cf69bd144b911c9eca 100644 --- a/src/types/element.d.ts +++ b/src/types/element.d.ts @@ -5,30 +5,32 @@ declare global { declare type ElTableInstance = ep.TableInstance; declare type ElUploadInstance = ep.UploadInstance; declare type ElScrollbarInstance = ep.ScrollbarInstance; + declare type ElInputInstance = ep.InputInstance; + declare type ElInputNumberInstance = ep.InputNumberInstance; + declare type ElRadioInstance = ep.RadioInstance; + declare type ElRadioGroupInstance = ep.RadioGroupInstance; + declare type ElRadioButtonInstance = ep.RadioButtonInstance; + declare type ElCheckboxInstance = ep.CheckboxInstance; + declare type ElSwitchInstance = ep.SwitchInstance; + declare type ElCascaderInstance = ep.CascaderInstance; + declare type ElColorPickerInstance = ep.ColorPickerInstance; + declare type ElRateInstance = ep.RateInstance; + declare type ElSliderInstance = ep.SliderInstance; + declare type ElTreeInstance = InstanceType; declare type ElTreeSelectInstance = InstanceType; declare type ElSelectInstance = InstanceType; declare type ElCardInstance = InstanceType; declare type ElDialogInstance = InstanceType; - declare type ElInputInstance = InstanceType; - declare type ElInputNumberInstance = InstanceType; - declare type ElRadioInstance = InstanceType; - declare type ElRadioGroupInstance = InstanceType; - declare type ElRadioButtonInstance = InstanceType; - declare type ElCheckboxInstance = InstanceType; declare type ElCheckboxGroupInstance = InstanceType; - declare type ElSwitchInstance = InstanceType; declare type ElDatePickerInstance = InstanceType; declare type ElTimePickerInstance = InstanceType; declare type ElTimeSelectInstance = InstanceType; - declare type ElCascaderInstance = InstanceType; - declare type ElColorPickerInstance = InstanceType; - declare type ElRateInstance = InstanceType; - declare type ElSliderInstance = InstanceType; declare type TransferKey = ep.TransferKey; declare type CheckboxValueType = ep.CheckboxValueType; declare type ElFormRules = ep.FormRules; declare type DateModelType = ep.DateModelType; - declare type UploadFile = typeof ep.UploadFile; + declare type UploadFile = ep.UploadFile; + } diff --git a/src/types/global.d.ts b/src/types/global.d.ts index 10cc438a2983bd64aed82447d83abbe3ebf84d28..17476a39be7ccbb201e1379f0c8cba6d88b019bc 100644 --- a/src/types/global.d.ts +++ b/src/types/global.d.ts @@ -1,5 +1,4 @@ -import type { ComponentInternalInstance as ComponentInstance } from 'vue/runtime-core'; -import type { PropType as VuePropType } from 'vue'; +import type { PropType as VuePropType, ComponentInternalInstance as ComponentInstance } from 'vue'; import { LanguageEnum } from '@/enums/LanguageEnum'; declare global { diff --git a/src/types/module.d.ts b/src/types/module.d.ts index 16b1116257bb4a41b3482911fdba94991e610b7c..bc2f16b350a6a9b5c42f0e44afcebd7c05b60576 100644 --- a/src/types/module.d.ts +++ b/src/types/module.d.ts @@ -5,10 +5,12 @@ import auth from '@/plugins/auth'; import cache from '@/plugins/cache'; import animate from '@/animate'; import { useDict } from '@/utils/dict'; -import handleTree, { addDateRange, selectDictLabel, selectDictLabels, parseTime } from '@/utils/ruoyi'; +import { handleTree, addDateRange, selectDictLabel, selectDictLabels, parseTime } from '@/utils/ruoyi'; import { getConfigKey, updateConfigByKey } from '@/api/system/config'; import { download as rd } from '@/utils/request'; +export {}; + declare module '@vue/runtime-core' { interface ComponentCustomProperties { // 全局方法声明 diff --git a/src/views/monitor/cache/index.vue b/src/views/monitor/cache/index.vue index c58f89c96b7cecdb492e040fa940860059066bac..81bbf2de30f45a51542c091d6dd40708a55598cd 100644 --- a/src/views/monitor/cache/index.vue +++ b/src/views/monitor/cache/index.vue @@ -126,8 +126,9 @@