mirror of
				https://github.com/pure-admin/vue-pure-admin.git
				synced 2025-11-03 13:44:47 +08:00 
			
		
		
		
	fix: menu search (#214)
* fix: menu search * fix: i18 * perf: delete route name
This commit is contained in:
		
							parent
							
								
									494ce8f41b
								
							
						
					
					
						commit
						51d08e4b82
					
				@ -4,7 +4,6 @@ import { MockMethod } from "vite-plugin-mock";
 | 
				
			|||||||
// http://mockjs.com/examples.html#Object
 | 
					// http://mockjs.com/examples.html#Object
 | 
				
			||||||
const systemRouter = {
 | 
					const systemRouter = {
 | 
				
			||||||
  path: "/system",
 | 
					  path: "/system",
 | 
				
			||||||
  name: "system",
 | 
					 | 
				
			||||||
  redirect: "/system/user/index",
 | 
					  redirect: "/system/user/index",
 | 
				
			||||||
  meta: {
 | 
					  meta: {
 | 
				
			||||||
    icon: "setting",
 | 
					    icon: "setting",
 | 
				
			||||||
@ -35,7 +34,6 @@ const systemRouter = {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
const permissionRouter = {
 | 
					const permissionRouter = {
 | 
				
			||||||
  path: "/permission",
 | 
					  path: "/permission",
 | 
				
			||||||
  name: "permission",
 | 
					 | 
				
			||||||
  redirect: "/permission/page/index",
 | 
					  redirect: "/permission/page/index",
 | 
				
			||||||
  meta: {
 | 
					  meta: {
 | 
				
			||||||
    title: "menus.permission",
 | 
					    title: "menus.permission",
 | 
				
			||||||
@ -66,7 +64,6 @@ const permissionRouter = {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
const frameRouter = {
 | 
					const frameRouter = {
 | 
				
			||||||
  path: "/iframe",
 | 
					  path: "/iframe",
 | 
				
			||||||
  name: "reFrame",
 | 
					 | 
				
			||||||
  redirect: "/iframe/pure",
 | 
					  redirect: "/iframe/pure",
 | 
				
			||||||
  meta: {
 | 
					  meta: {
 | 
				
			||||||
    icon: "monitor",
 | 
					    icon: "monitor",
 | 
				
			||||||
@ -106,7 +103,6 @@ const frameRouter = {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
const tabsRouter = {
 | 
					const tabsRouter = {
 | 
				
			||||||
  path: "/tabs",
 | 
					  path: "/tabs",
 | 
				
			||||||
  name: "reTabs",
 | 
					 | 
				
			||||||
  redirect: "/tabs/index",
 | 
					  redirect: "/tabs/index",
 | 
				
			||||||
  meta: {
 | 
					  meta: {
 | 
				
			||||||
    icon: "IF-team-icontabs",
 | 
					    icon: "IF-team-icontabs",
 | 
				
			||||||
 | 
				
			|||||||
@ -1 +0,0 @@
 | 
				
			|||||||
export type RouteList = AuthRoute.Route;
 | 
					 | 
				
			||||||
@ -50,10 +50,9 @@ export function transformI18n(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  // 处理存储动态路由的title,格式 {zh:"",en:""}
 | 
					  // 处理存储动态路由的title,格式 {zh:"",en:""}
 | 
				
			||||||
  if (typeof message === "object") {
 | 
					  if (typeof message === "object") {
 | 
				
			||||||
    debugger;
 | 
					 | 
				
			||||||
    const locale: string | WritableComputedRef<string> | any =
 | 
					    const locale: string | WritableComputedRef<string> | any =
 | 
				
			||||||
      i18n.global.locale;
 | 
					      i18n.global.locale;
 | 
				
			||||||
    return message[locale];
 | 
					    return message[locale?.value];
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (isI18n) {
 | 
					  if (isI18n) {
 | 
				
			||||||
 | 
				
			|||||||
@ -3,9 +3,8 @@ const Layout = () => import("/@/layout/index.vue");
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
const ableRouter = {
 | 
					const ableRouter = {
 | 
				
			||||||
  path: "/able",
 | 
					  path: "/able",
 | 
				
			||||||
  name: "components",
 | 
					 | 
				
			||||||
  component: Layout,
 | 
					  component: Layout,
 | 
				
			||||||
  redirect: "/able/menuTree",
 | 
					  redirect: "/able/watermark",
 | 
				
			||||||
  meta: {
 | 
					  meta: {
 | 
				
			||||||
    icon: "ubuntu-fill",
 | 
					    icon: "ubuntu-fill",
 | 
				
			||||||
    title: $t("menus.hsAble"),
 | 
					    title: $t("menus.hsAble"),
 | 
				
			||||||
 | 
				
			|||||||
@ -3,9 +3,8 @@ const Layout = () => import("/@/layout/index.vue");
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
const aboutRouter = {
 | 
					const aboutRouter = {
 | 
				
			||||||
  path: "/about",
 | 
					  path: "/about",
 | 
				
			||||||
  name: "reAbout",
 | 
					 | 
				
			||||||
  component: Layout,
 | 
					  component: Layout,
 | 
				
			||||||
  redirect: "/about",
 | 
					  redirect: "/about/index",
 | 
				
			||||||
  meta: {
 | 
					  meta: {
 | 
				
			||||||
    icon: "question-line",
 | 
					    icon: "question-line",
 | 
				
			||||||
    title: $t("menus.hsAbout"),
 | 
					    title: $t("menus.hsAbout"),
 | 
				
			||||||
@ -14,9 +13,9 @@ const aboutRouter = {
 | 
				
			|||||||
  },
 | 
					  },
 | 
				
			||||||
  children: [
 | 
					  children: [
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      path: "/about",
 | 
					      path: "/about/index",
 | 
				
			||||||
      name: "reAbout",
 | 
					      name: "reAbout",
 | 
				
			||||||
      component: () => import("/@/views/about.vue"),
 | 
					      component: () => import("/@/views/about/index.vue"),
 | 
				
			||||||
      meta: {
 | 
					      meta: {
 | 
				
			||||||
        title: $t("menus.hsAbout"),
 | 
					        title: $t("menus.hsAbout"),
 | 
				
			||||||
        i18n: true
 | 
					        i18n: true
 | 
				
			||||||
 | 
				
			|||||||
@ -3,7 +3,6 @@ const Layout = () => import("/@/layout/index.vue");
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
const componentsRouter = {
 | 
					const componentsRouter = {
 | 
				
			||||||
  path: "/components",
 | 
					  path: "/components",
 | 
				
			||||||
  name: "components",
 | 
					 | 
				
			||||||
  component: Layout,
 | 
					  component: Layout,
 | 
				
			||||||
  redirect: "/components/video",
 | 
					  redirect: "/components/video",
 | 
				
			||||||
  meta: {
 | 
					  meta: {
 | 
				
			||||||
 | 
				
			|||||||
@ -3,7 +3,6 @@ const Layout = () => import("/@/layout/index.vue");
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
const editorRouter = {
 | 
					const editorRouter = {
 | 
				
			||||||
  path: "/editor",
 | 
					  path: "/editor",
 | 
				
			||||||
  name: "reEditor",
 | 
					 | 
				
			||||||
  component: Layout,
 | 
					  component: Layout,
 | 
				
			||||||
  redirect: "/editor/index",
 | 
					  redirect: "/editor/index",
 | 
				
			||||||
  meta: {
 | 
					  meta: {
 | 
				
			||||||
 | 
				
			|||||||
@ -3,7 +3,6 @@ const Layout = () => import("/@/layout/index.vue");
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
const errorRouter = {
 | 
					const errorRouter = {
 | 
				
			||||||
  path: "/error",
 | 
					  path: "/error",
 | 
				
			||||||
  name: "error",
 | 
					 | 
				
			||||||
  component: Layout,
 | 
					  component: Layout,
 | 
				
			||||||
  redirect: "/error/403",
 | 
					  redirect: "/error/403",
 | 
				
			||||||
  meta: {
 | 
					  meta: {
 | 
				
			||||||
 | 
				
			|||||||
@ -3,7 +3,6 @@ const Layout = () => import("/@/layout/index.vue");
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
const flowChartRouter = {
 | 
					const flowChartRouter = {
 | 
				
			||||||
  path: "/flowChart",
 | 
					  path: "/flowChart",
 | 
				
			||||||
  name: "flowChart",
 | 
					 | 
				
			||||||
  component: Layout,
 | 
					  component: Layout,
 | 
				
			||||||
  redirect: "/flowChart/index",
 | 
					  redirect: "/flowChart/index",
 | 
				
			||||||
  meta: {
 | 
					  meta: {
 | 
				
			||||||
 | 
				
			|||||||
@ -3,7 +3,6 @@ const Layout = () => import("/@/layout/index.vue");
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
const guideRouter = {
 | 
					const guideRouter = {
 | 
				
			||||||
  path: "/guide",
 | 
					  path: "/guide",
 | 
				
			||||||
  name: "reGuide",
 | 
					 | 
				
			||||||
  component: Layout,
 | 
					  component: Layout,
 | 
				
			||||||
  redirect: "/guide/index",
 | 
					  redirect: "/guide/index",
 | 
				
			||||||
  meta: {
 | 
					  meta: {
 | 
				
			||||||
 | 
				
			|||||||
@ -5,7 +5,6 @@ const nestedRouter = {
 | 
				
			|||||||
  path: "/nested",
 | 
					  path: "/nested",
 | 
				
			||||||
  component: Layout,
 | 
					  component: Layout,
 | 
				
			||||||
  redirect: "/nested/menu1/menu1-1",
 | 
					  redirect: "/nested/menu1/menu1-1",
 | 
				
			||||||
  name: "Nested",
 | 
					 | 
				
			||||||
  meta: {
 | 
					  meta: {
 | 
				
			||||||
    title: $t("menus.hsmenus"),
 | 
					    title: $t("menus.hsmenus"),
 | 
				
			||||||
    icon: "histogram",
 | 
					    icon: "histogram",
 | 
				
			||||||
@ -15,7 +14,6 @@ const nestedRouter = {
 | 
				
			|||||||
  children: [
 | 
					  children: [
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      path: "/nested/menu1",
 | 
					      path: "/nested/menu1",
 | 
				
			||||||
      name: "Menu1",
 | 
					 | 
				
			||||||
      meta: {
 | 
					      meta: {
 | 
				
			||||||
        title: $t("menus.hsmenu1"),
 | 
					        title: $t("menus.hsmenu1"),
 | 
				
			||||||
        i18n: true,
 | 
					        i18n: true,
 | 
				
			||||||
@ -35,7 +33,6 @@ const nestedRouter = {
 | 
				
			|||||||
        },
 | 
					        },
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
          path: "/nested/menu1/menu1-2",
 | 
					          path: "/nested/menu1/menu1-2",
 | 
				
			||||||
          name: "Menu1-2",
 | 
					 | 
				
			||||||
          redirect: "/nested/menu1/menu1-2/menu1-2-1",
 | 
					          redirect: "/nested/menu1/menu1-2/menu1-2-1",
 | 
				
			||||||
          meta: {
 | 
					          meta: {
 | 
				
			||||||
            title: $t("menus.hsmenu1-2"),
 | 
					            title: $t("menus.hsmenu1-2"),
 | 
				
			||||||
 | 
				
			|||||||
@ -15,7 +15,6 @@ const remainingRouter = [
 | 
				
			|||||||
  },
 | 
					  },
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    path: "/redirect",
 | 
					    path: "/redirect",
 | 
				
			||||||
    name: "redirect",
 | 
					 | 
				
			||||||
    component: Layout,
 | 
					    component: Layout,
 | 
				
			||||||
    meta: {
 | 
					    meta: {
 | 
				
			||||||
      icon: "home-filled",
 | 
					      icon: "home-filled",
 | 
				
			||||||
 | 
				
			|||||||
@ -3,7 +3,6 @@ const Layout = () => import("/@/layout/index.vue");
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
const resultRouter = {
 | 
					const resultRouter = {
 | 
				
			||||||
  path: "/result",
 | 
					  path: "/result",
 | 
				
			||||||
  name: "reResult",
 | 
					 | 
				
			||||||
  component: Layout,
 | 
					  component: Layout,
 | 
				
			||||||
  redirect: "/result/success",
 | 
					  redirect: "/result/success",
 | 
				
			||||||
  meta: {
 | 
					  meta: {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user