From 11889edf7028e7a234d19ec33e7eff84c5863998 Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期一, 03 三月 2025 12:06:57 +0800
Subject: [PATCH] 优化顶部菜单搜索栏为多层级显示
---
src/components/HeaderSearch/index.vue | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/components/HeaderSearch/index.vue b/src/components/HeaderSearch/index.vue
index 7451037..f87ff52 100644
--- a/src/components/HeaderSearch/index.vue
+++ b/src/components/HeaderSearch/index.vue
@@ -30,7 +30,7 @@
const fuse = ref(undefined);
const headerSearchSelectRef = ref(null);
const router = useRouter();
-const routes = computed(() => usePermissionStore().routes);
+const routes = computed(() => usePermissionStore().defaultRoutes);
function click() {
show.value = !show.value
@@ -45,12 +45,17 @@
}
function change(val) {
const path = val.path;
+ const query = val.query;
if (isHttp(path)) {
// http(s):// 璺緞鏂扮獥鍙f墦寮�
const pindex = path.indexOf("http");
window.open(path.substr(pindex, path.length), "_blank");
} else {
- router.push(path)
+ if (query) {
+ router.push({ path: path, query: JSON.parse(query) });
+ } else {
+ router.push(path)
+ }
}
search.value = ''
@@ -98,6 +103,9 @@
res.push(data)
}
}
+ if (r.query) {
+ data.query = r.query
+ }
// recursive child routes
if (r.children) {
--
Gitblit v1.9.3