RuoYi
2025-03-03 11889edf7028e7a234d19ec33e7eff84c5863998
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):// 路径新窗口打开
    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) {