From 3ba751accbb728273f8f7ad4773528e56efebd2d Mon Sep 17 00:00:00 2001 From: hxr <1490493387@qq.com> Date: Thu, 18 Jan 2024 11:52:59 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20:recycle:=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E9=87=8D=E6=9E=84=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/Settings/index.vue | 179 ++++++++++++--------- src/layout/components/Sidebar/LeftMenu.vue | 2 +- src/layout/main.vue | 39 +++-- src/typings/auto-imports.d.ts | 106 +++++++++++- src/views/login/index.vue | 2 - vite.config.ts | 8 +- 6 files changed, 231 insertions(+), 105 deletions(-) diff --git a/src/layout/components/Settings/index.vue b/src/layout/components/Settings/index.vue index 6caa9965..e8882105 100644 --- a/src/layout/components/Settings/index.vue +++ b/src/layout/components/Settings/index.vue @@ -1,8 +1,97 @@ + + - - diff --git a/src/typings/auto-imports.d.ts b/src/typings/auto-imports.d.ts index b191a3fd..94c3f682 100644 --- a/src/typings/auto-imports.d.ts +++ b/src/typings/auto-imports.d.ts @@ -7,9 +7,9 @@ declare global { const EffectScope: typeof import("vue")["EffectScope"]; const ElForm: typeof import("element-plus/es")["ElForm"]; const ElMessage: typeof import("element-plus/es")["ElMessage"]; - const ElNotification: typeof import("element-plus/es")["ElNotification"]; const ElMessageBox: typeof import("element-plus/es")["ElMessageBox"]; const ElTree: typeof import("element-plus/es")["ElTree"]; + const acceptHMRUpdate: typeof import("pinia")["acceptHMRUpdate"]; const asyncComputed: typeof import("@vueuse/core")["asyncComputed"]; const autoResetRef: typeof import("@vueuse/core")["autoResetRef"]; const computed: typeof import("vue")["computed"]; @@ -23,6 +23,7 @@ declare global { const createEventHook: typeof import("@vueuse/core")["createEventHook"]; const createGlobalState: typeof import("@vueuse/core")["createGlobalState"]; const createInjectionState: typeof import("@vueuse/core")["createInjectionState"]; + const createPinia: typeof import("pinia")["createPinia"]; const createReactiveFn: typeof import("@vueuse/core")["createReactiveFn"]; const createReusableTemplate: typeof import("@vueuse/core")["createReusableTemplate"]; const createSharedComposable: typeof import("@vueuse/core")["createSharedComposable"]; @@ -33,24 +34,34 @@ declare global { const debouncedWatch: typeof import("@vueuse/core")["debouncedWatch"]; const defineAsyncComponent: typeof import("vue")["defineAsyncComponent"]; const defineComponent: typeof import("vue")["defineComponent"]; + const defineStore: typeof import("pinia")["defineStore"]; const eagerComputed: typeof import("@vueuse/core")["eagerComputed"]; const effectScope: typeof import("vue")["effectScope"]; const extendRef: typeof import("@vueuse/core")["extendRef"]; + const getActivePinia: typeof import("pinia")["getActivePinia"]; const getCurrentInstance: typeof import("vue")["getCurrentInstance"]; const getCurrentScope: typeof import("vue")["getCurrentScope"]; const h: typeof import("vue")["h"]; const ignorableWatch: typeof import("@vueuse/core")["ignorableWatch"]; const inject: typeof import("vue")["inject"]; + const injectLocal: typeof import("@vueuse/core")["injectLocal"]; const isDefined: typeof import("@vueuse/core")["isDefined"]; const isProxy: typeof import("vue")["isProxy"]; const isReactive: typeof import("vue")["isReactive"]; const isReadonly: typeof import("vue")["isReadonly"]; const isRef: typeof import("vue")["isRef"]; const makeDestructurable: typeof import("@vueuse/core")["makeDestructurable"]; + const mapActions: typeof import("pinia")["mapActions"]; + const mapGetters: typeof import("pinia")["mapGetters"]; + const mapState: typeof import("pinia")["mapState"]; + const mapStores: typeof import("pinia")["mapStores"]; + const mapWritableState: typeof import("pinia")["mapWritableState"]; const markRaw: typeof import("vue")["markRaw"]; const nextTick: typeof import("vue")["nextTick"]; const onActivated: typeof import("vue")["onActivated"]; const onBeforeMount: typeof import("vue")["onBeforeMount"]; + const onBeforeRouteLeave: typeof import("vue-router")["onBeforeRouteLeave"]; + const onBeforeRouteUpdate: typeof import("vue-router")["onBeforeRouteUpdate"]; const onBeforeUnmount: typeof import("vue")["onBeforeUnmount"]; const onBeforeUpdate: typeof import("vue")["onBeforeUpdate"]; const onClickOutside: typeof import("@vueuse/core")["onClickOutside"]; @@ -68,6 +79,7 @@ declare global { const onUpdated: typeof import("vue")["onUpdated"]; const pausableWatch: typeof import("@vueuse/core")["pausableWatch"]; const provide: typeof import("vue")["provide"]; + const provideLocal: typeof import("@vueuse/core")["provideLocal"]; const reactify: typeof import("@vueuse/core")["reactify"]; const reactifyObject: typeof import("@vueuse/core")["reactifyObject"]; const reactive: typeof import("vue")["reactive"]; @@ -84,9 +96,12 @@ declare global { const resolveComponent: typeof import("vue")["resolveComponent"]; const resolveRef: typeof import("@vueuse/core")["resolveRef"]; const resolveUnref: typeof import("@vueuse/core")["resolveUnref"]; + const setActivePinia: typeof import("pinia")["setActivePinia"]; + const setMapStoreSuffix: typeof import("pinia")["setMapStoreSuffix"]; const shallowReactive: typeof import("vue")["shallowReactive"]; const shallowReadonly: typeof import("vue")["shallowReadonly"]; const shallowRef: typeof import("vue")["shallowRef"]; + const storeToRefs: typeof import("pinia")["storeToRefs"]; const syncRef: typeof import("@vueuse/core")["syncRef"]; const syncRefs: typeof import("@vueuse/core")["syncRefs"]; const templateRef: typeof import("@vueuse/core")["templateRef"]; @@ -131,6 +146,7 @@ declare global { const useBrowserLocation: typeof import("@vueuse/core")["useBrowserLocation"]; const useCached: typeof import("@vueuse/core")["useCached"]; const useClipboard: typeof import("@vueuse/core")["useClipboard"]; + const useClipboardItems: typeof import("@vueuse/core")["useClipboardItems"]; const useCloned: typeof import("@vueuse/core")["useCloned"]; const useColorMode: typeof import("@vueuse/core")["useColorMode"]; const useConfirmDialog: typeof import("@vueuse/core")["useConfirmDialog"]; @@ -180,6 +196,7 @@ declare global { const useIntervalFn: typeof import("@vueuse/core")["useIntervalFn"]; const useKeyModifier: typeof import("@vueuse/core")["useKeyModifier"]; const useLastChanged: typeof import("@vueuse/core")["useLastChanged"]; + const useLink: typeof import("vue-router")["useLink"]; const useLocalStorage: typeof import("@vueuse/core")["useLocalStorage"]; const useMagicKeys: typeof import("@vueuse/core")["useMagicKeys"]; const useManualRefHistory: typeof import("@vueuse/core")["useManualRefHistory"]; @@ -215,6 +232,8 @@ declare global { const useRafFn: typeof import("@vueuse/core")["useRafFn"]; const useRefHistory: typeof import("@vueuse/core")["useRefHistory"]; const useResizeObserver: typeof import("@vueuse/core")["useResizeObserver"]; + const useRoute: typeof import("vue-router")["useRoute"]; + const useRouter: typeof import("vue-router")["useRouter"]; const useScreenOrientation: typeof import("@vueuse/core")["useScreenOrientation"]; const useScreenSafeArea: typeof import("@vueuse/core")["useScreenSafeArea"]; const useScriptTag: typeof import("@vueuse/core")["useScriptTag"]; @@ -287,11 +306,16 @@ declare global { Component, ComponentPublicInstance, ComputedRef, + ExtractDefaultPropTypes, + ExtractPropTypes, + ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, + WritableComputedRef, } from "vue"; + import("vue"); } // for vue template auto import import { UnwrapRef } from "vue"; @@ -306,6 +330,9 @@ declare module "vue" { typeof import("element-plus/es")["ElMessageBox"] >; readonly ElTree: UnwrapRef; + readonly acceptHMRUpdate: UnwrapRef< + typeof import("pinia")["acceptHMRUpdate"] + >; readonly asyncComputed: UnwrapRef< typeof import("@vueuse/core")["asyncComputed"] >; @@ -341,6 +368,7 @@ declare module "vue" { readonly createInjectionState: UnwrapRef< typeof import("@vueuse/core")["createInjectionState"] >; + readonly createPinia: UnwrapRef; readonly createReactiveFn: UnwrapRef< typeof import("@vueuse/core")["createReactiveFn"] >; @@ -369,11 +397,15 @@ declare module "vue" { readonly defineComponent: UnwrapRef< typeof import("vue")["defineComponent"] >; + readonly defineStore: UnwrapRef; readonly eagerComputed: UnwrapRef< typeof import("@vueuse/core")["eagerComputed"] >; readonly effectScope: UnwrapRef; readonly extendRef: UnwrapRef; + readonly getActivePinia: UnwrapRef< + typeof import("pinia")["getActivePinia"] + >; readonly getCurrentInstance: UnwrapRef< typeof import("vue")["getCurrentInstance"] >; @@ -385,6 +417,9 @@ declare module "vue" { typeof import("@vueuse/core")["ignorableWatch"] >; readonly inject: UnwrapRef; + readonly injectLocal: UnwrapRef< + typeof import("@vueuse/core")["injectLocal"] + >; readonly isDefined: UnwrapRef; readonly isProxy: UnwrapRef; readonly isReactive: UnwrapRef; @@ -393,10 +428,23 @@ declare module "vue" { readonly makeDestructurable: UnwrapRef< typeof import("@vueuse/core")["makeDestructurable"] >; + readonly mapActions: UnwrapRef; + readonly mapGetters: UnwrapRef; + readonly mapState: UnwrapRef; + readonly mapStores: UnwrapRef; + readonly mapWritableState: UnwrapRef< + typeof import("pinia")["mapWritableState"] + >; readonly markRaw: UnwrapRef; readonly nextTick: UnwrapRef; readonly onActivated: UnwrapRef; readonly onBeforeMount: UnwrapRef; + readonly onBeforeRouteLeave: UnwrapRef< + typeof import("vue-router")["onBeforeRouteLeave"] + >; + readonly onBeforeRouteUpdate: UnwrapRef< + typeof import("vue-router")["onBeforeRouteUpdate"] + >; readonly onBeforeUnmount: UnwrapRef< typeof import("vue")["onBeforeUnmount"] >; @@ -434,6 +482,9 @@ declare module "vue" { typeof import("@vueuse/core")["pausableWatch"] >; readonly provide: UnwrapRef; + readonly provideLocal: UnwrapRef< + typeof import("@vueuse/core")["provideLocal"] + >; readonly reactify: UnwrapRef; readonly reactifyObject: UnwrapRef< typeof import("@vueuse/core")["reactifyObject"] @@ -470,6 +521,12 @@ declare module "vue" { readonly resolveUnref: UnwrapRef< typeof import("@vueuse/core")["resolveUnref"] >; + readonly setActivePinia: UnwrapRef< + typeof import("pinia")["setActivePinia"] + >; + readonly setMapStoreSuffix: UnwrapRef< + typeof import("pinia")["setMapStoreSuffix"] + >; readonly shallowReactive: UnwrapRef< typeof import("vue")["shallowReactive"] >; @@ -477,6 +534,7 @@ declare module "vue" { typeof import("vue")["shallowReadonly"] >; readonly shallowRef: UnwrapRef; + readonly storeToRefs: UnwrapRef; readonly syncRef: UnwrapRef; readonly syncRefs: UnwrapRef; readonly templateRef: UnwrapRef< @@ -579,6 +637,9 @@ declare module "vue" { readonly useClipboard: UnwrapRef< typeof import("@vueuse/core")["useClipboard"] >; + readonly useClipboardItems: UnwrapRef< + typeof import("@vueuse/core")["useClipboardItems"] + >; readonly useCloned: UnwrapRef; readonly useColorMode: UnwrapRef< typeof import("@vueuse/core")["useColorMode"] @@ -700,6 +761,7 @@ declare module "vue" { readonly useLastChanged: UnwrapRef< typeof import("@vueuse/core")["useLastChanged"] >; + readonly useLink: UnwrapRef; readonly useLocalStorage: UnwrapRef< typeof import("@vueuse/core")["useLocalStorage"] >; @@ -787,6 +849,8 @@ declare module "vue" { readonly useResizeObserver: UnwrapRef< typeof import("@vueuse/core")["useResizeObserver"] >; + readonly useRoute: UnwrapRef; + readonly useRouter: UnwrapRef; readonly useScreenOrientation: UnwrapRef< typeof import("@vueuse/core")["useScreenOrientation"] >; @@ -952,6 +1016,9 @@ declare module "@vue/runtime-core" { typeof import("element-plus/es")["ElMessageBox"] >; readonly ElTree: UnwrapRef; + readonly acceptHMRUpdate: UnwrapRef< + typeof import("pinia")["acceptHMRUpdate"] + >; readonly asyncComputed: UnwrapRef< typeof import("@vueuse/core")["asyncComputed"] >; @@ -987,6 +1054,7 @@ declare module "@vue/runtime-core" { readonly createInjectionState: UnwrapRef< typeof import("@vueuse/core")["createInjectionState"] >; + readonly createPinia: UnwrapRef; readonly createReactiveFn: UnwrapRef< typeof import("@vueuse/core")["createReactiveFn"] >; @@ -1015,11 +1083,15 @@ declare module "@vue/runtime-core" { readonly defineComponent: UnwrapRef< typeof import("vue")["defineComponent"] >; + readonly defineStore: UnwrapRef; readonly eagerComputed: UnwrapRef< typeof import("@vueuse/core")["eagerComputed"] >; readonly effectScope: UnwrapRef; readonly extendRef: UnwrapRef; + readonly getActivePinia: UnwrapRef< + typeof import("pinia")["getActivePinia"] + >; readonly getCurrentInstance: UnwrapRef< typeof import("vue")["getCurrentInstance"] >; @@ -1031,6 +1103,9 @@ declare module "@vue/runtime-core" { typeof import("@vueuse/core")["ignorableWatch"] >; readonly inject: UnwrapRef; + readonly injectLocal: UnwrapRef< + typeof import("@vueuse/core")["injectLocal"] + >; readonly isDefined: UnwrapRef; readonly isProxy: UnwrapRef; readonly isReactive: UnwrapRef; @@ -1039,10 +1114,23 @@ declare module "@vue/runtime-core" { readonly makeDestructurable: UnwrapRef< typeof import("@vueuse/core")["makeDestructurable"] >; + readonly mapActions: UnwrapRef; + readonly mapGetters: UnwrapRef; + readonly mapState: UnwrapRef; + readonly mapStores: UnwrapRef; + readonly mapWritableState: UnwrapRef< + typeof import("pinia")["mapWritableState"] + >; readonly markRaw: UnwrapRef; readonly nextTick: UnwrapRef; readonly onActivated: UnwrapRef; readonly onBeforeMount: UnwrapRef; + readonly onBeforeRouteLeave: UnwrapRef< + typeof import("vue-router")["onBeforeRouteLeave"] + >; + readonly onBeforeRouteUpdate: UnwrapRef< + typeof import("vue-router")["onBeforeRouteUpdate"] + >; readonly onBeforeUnmount: UnwrapRef< typeof import("vue")["onBeforeUnmount"] >; @@ -1080,6 +1168,9 @@ declare module "@vue/runtime-core" { typeof import("@vueuse/core")["pausableWatch"] >; readonly provide: UnwrapRef; + readonly provideLocal: UnwrapRef< + typeof import("@vueuse/core")["provideLocal"] + >; readonly reactify: UnwrapRef; readonly reactifyObject: UnwrapRef< typeof import("@vueuse/core")["reactifyObject"] @@ -1116,6 +1207,12 @@ declare module "@vue/runtime-core" { readonly resolveUnref: UnwrapRef< typeof import("@vueuse/core")["resolveUnref"] >; + readonly setActivePinia: UnwrapRef< + typeof import("pinia")["setActivePinia"] + >; + readonly setMapStoreSuffix: UnwrapRef< + typeof import("pinia")["setMapStoreSuffix"] + >; readonly shallowReactive: UnwrapRef< typeof import("vue")["shallowReactive"] >; @@ -1123,6 +1220,7 @@ declare module "@vue/runtime-core" { typeof import("vue")["shallowReadonly"] >; readonly shallowRef: UnwrapRef; + readonly storeToRefs: UnwrapRef; readonly syncRef: UnwrapRef; readonly syncRefs: UnwrapRef; readonly templateRef: UnwrapRef< @@ -1225,6 +1323,9 @@ declare module "@vue/runtime-core" { readonly useClipboard: UnwrapRef< typeof import("@vueuse/core")["useClipboard"] >; + readonly useClipboardItems: UnwrapRef< + typeof import("@vueuse/core")["useClipboardItems"] + >; readonly useCloned: UnwrapRef; readonly useColorMode: UnwrapRef< typeof import("@vueuse/core")["useColorMode"] @@ -1346,6 +1447,7 @@ declare module "@vue/runtime-core" { readonly useLastChanged: UnwrapRef< typeof import("@vueuse/core")["useLastChanged"] >; + readonly useLink: UnwrapRef; readonly useLocalStorage: UnwrapRef< typeof import("@vueuse/core")["useLocalStorage"] >; @@ -1433,6 +1535,8 @@ declare module "@vue/runtime-core" { readonly useResizeObserver: UnwrapRef< typeof import("@vueuse/core")["useResizeObserver"] >; + readonly useRoute: UnwrapRef; + readonly useRouter: UnwrapRef; readonly useScreenOrientation: UnwrapRef< typeof import("@vueuse/core")["useScreenOrientation"] >; diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 7561775b..179df49c 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -132,8 +132,6 @@