From 3922c16601266e78ee3b90936ba49305c6c8b09a Mon Sep 17 00:00:00 2001 From: ahao Date: Wed, 27 Dec 2023 12:12:51 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=20vue=20=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E8=AF=86=E5=88=AB=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/HeaderSearch/index.vue | 4 +- src/components/ImageUpload/index.vue | 4 +- src/components/TopNav/index.vue | 2 +- src/layout/components/AppMain.vue | 3 +- src/layout/components/IframeToggle/index.vue | 1 + src/layout/components/Sidebar/index.vue | 2 +- src/layout/components/TagsView/ScrollPane.vue | 6 +- src/layout/components/TagsView/index.vue | 51 ++++++----- src/plugins/tab.ts | 42 +++++---- src/store/modules/permission.ts | 25 +++++- src/store/modules/tagsView.ts | 86 ++++++++++++------- src/store/modules/user.ts | 4 +- src/types/element.d.ts | 3 +- src/types/router.d.ts | 3 + src/views/system/dict/data.vue | 15 +++- src/views/system/role/authUser.vue | 13 ++- src/views/system/user/authRole.vue | 13 ++- src/views/tool/gen/editTable.vue | 13 ++- src/views/tool/gen/index.vue | 5 +- 19 files changed, 204 insertions(+), 91 deletions(-) diff --git a/src/components/HeaderSearch/index.vue b/src/components/HeaderSearch/index.vue index f6143d0..a785958 100644 --- a/src/components/HeaderSearch/index.vue +++ b/src/components/HeaderSearch/index.vue @@ -36,7 +36,7 @@ const show = ref(false); const fuse = ref(); const headerSearchSelectRef = ref(); const router = useRouter(); -const routes = computed(() => usePermissionStore().routes); +const routes = computed(() => usePermissionStore().getRoutes()); const click = () => { show.value = !show.value; @@ -149,7 +149,7 @@ watch(show, (value) => { } }); -watch(searchPool, (list) => { +watch(searchPool, (list: Router) => { initFuse(list); }); diff --git a/src/components/ImageUpload/index.vue b/src/components/ImageUpload/index.vue index 6b7a39b..ae5cd45 100644 --- a/src/components/ImageUpload/index.vue +++ b/src/components/ImageUpload/index.vue @@ -81,14 +81,14 @@ const imageUploadRef = ref(); watch( () => props.modelValue, - async (val) => { + async (val: string) => { if (val) { // 首先将值转为数组 let list: OssVO[] = []; if (Array.isArray(val)) { list = val as OssVO[]; } else { - const res = await listByIds(val as string); + const res = await listByIds(val); list = res.data; } // 然后将数组转为对象数组 diff --git a/src/components/TopNav/index.vue b/src/components/TopNav/index.vue index 6b416d4..c41177e 100644 --- a/src/components/TopNav/index.vue +++ b/src/components/TopNav/index.vue @@ -43,7 +43,7 @@ const router = useRouter(); // 主题颜色 const theme = computed(() => settingsStore.theme); // 所有的路由信息 -const routers = computed(() => permissionStore.topbarRouters); +const routers = computed(() => permissionStore.getTopbarRoutes()); // 顶部显示菜单 const topMenus = computed(() => { diff --git a/src/layout/components/AppMain.vue b/src/layout/components/AppMain.vue index b7c6ef0..2b38a4e 100644 --- a/src/layout/components/AppMain.vue +++ b/src/layout/components/AppMain.vue @@ -12,8 +12,9 @@