From cb80de3742d66cfee20bc3136c735e5ca5a7d45c Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期三, 29 十一月 2023 12:44:42 +0800
Subject: [PATCH] 优化字典标签支持自定义分隔符
---
src/components/HeaderSearch/index.vue | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/components/HeaderSearch/index.vue b/src/components/HeaderSearch/index.vue
index 317df49..e4c06a0 100644
--- a/src/components/HeaderSearch/index.vue
+++ b/src/components/HeaderSearch/index.vue
@@ -21,6 +21,7 @@
import Fuse from 'fuse.js'
import { getNormalPath } from '@/utils/ruoyi'
import { isHttp } from '@/utils/validate'
+import usePermissionStore from '@/store/modules/permission'
const search = ref('');
const options = ref([]);
@@ -28,9 +29,8 @@
const show = ref(false);
const fuse = ref(undefined);
const headerSearchSelectRef = ref(null);
-const store = useStore();
const router = useRouter();
-const routes = computed(() => store.getters.permission_routes);
+const routes = computed(() => usePermissionStore().routes);
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 = ''
@@ -65,7 +70,6 @@
threshold: 0.4,
location: 0,
distance: 100,
- maxPatternLength: 32,
minMatchCharLength: 1,
keys: [{
name: 'title',
@@ -99,6 +103,9 @@
res.push(data)
}
}
+ if (r.query) {
+ data.query = r.query
+ }
// recursive child routes
if (r.children) {
--
Gitblit v1.9.3