lrf 1 rok pred
rodič
commit
876b9de26a

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1073 - 3
pnpm-lock.yaml


+ 3 - 3
src/components/Breadcrumb/index.vue

@@ -2,9 +2,9 @@
   <el-breadcrumb class="h-[50px] flex items-center">
     <transition-group name="breadcrumb-transition">
       <el-breadcrumb-item v-for="(item, index) in breadcrumbs" :key="item.path">
-        <span v-if="item.redirect === 'noredirect' || index === breadcrumbs.length - 1" class="text-[var(--el-disabled-text-color)]">{{
-          translateRouteTitle(item.meta.title)
-        }}</span>
+        <span v-if="item.redirect === 'noredirect' || index === breadcrumbs.length - 1" class="text-[var(--el-disabled-text-color)]">
+          {{ translateRouteTitle(item.meta.title) }}
+        </span>
         <a v-else @click.prevent="handleLink(item)">
           {{ translateRouteTitle(item.meta.title) }}
         </a>

+ 9 - 4
src/router/guard.js

@@ -46,7 +46,7 @@ export const registerBeforeRouter = async (router) => {
         next({ ...to, replace: true })
       }
     } else {
-      next('/login')
+      next()
     }
   })
 }
@@ -87,10 +87,15 @@ export const addUserRoutes = async (menus, router) => {
       const c = {
         path,
         name,
-        meta: { title },
-        component: loadComponent[`../views${component}.vue`]
+        component: loadComponent[`../views${component}.vue`],
+        meta: {
+          title,
+          affix: false,
+          keepAlive: true,
+          alwaysShow: false
+        }
       }
-      if (in_admin_frame === '0') router.addRoute('AdminFrame', c)
+      if (in_admin_frame === '0') router.addRoute('system', c)
       else router.addRoute(c)
     }
     resolve()

+ 5 - 34
src/router/index.js

@@ -26,10 +26,12 @@ const router = createRouter({
     {
       path: '/',
       component: Layout,
+      name: 'Layout',
+      meta: { breadcrumb: false },
       children: [
         {
           path: '/',
-          name: 'dashboard',
+          name: 'Dashboard',
           meta: {
             title: 'dashboard',
             affix: true,
@@ -40,39 +42,8 @@ const router = createRouter({
         },
         {
           path: '/system',
-          meta: { title: 'system' },
-          children: [
-            {
-              path: '/system/menus',
-              meta: { title: 'menus' },
-              component: () => import('@/views/system/menus/index.vue')
-            },
-            {
-              path: '/system/role',
-              meta: { title: 'role' },
-              component: () => import('@/views/system/role/index.vue')
-            },
-            {
-              path: '/system/dict',
-              meta: { title: 'dict' },
-              component: () => import('@/views/system/dict/index.vue')
-            },
-            {
-              path: '/system/dictData',
-              meta: { title: 'dictData' },
-              component: () => import('@/views/system/dictData/index.vue')
-            },
-            {
-              path: '/system/config',
-              meta: { title: 'config' },
-              component: () => import('@/views/system/config/index.vue')
-            },
-            {
-              path: '/system/module',
-              meta: { title: 'module' },
-              component: () => import('@/views/system/module/index.vue')
-            }
-          ]
+          name: 'system',
+          meta: { title: 'system' }
         }
       ]
     }

+ 11 - 13
src/views/system/menus/index.vue

@@ -1,17 +1,15 @@
 <template>
-  <div id="index">
-    <el-row>
-      <el-col :span="24" style="text-align: right; padding: 10px">
-        <el-button type="primary" size="small" @click="toAdd()">添加</el-button>
-      </el-col>
-      <el-col :span="24">
-        <menu-table></menu-table>
-      </el-col>
-    </el-row>
-    <el-dialog v-model="dialog" title="菜单信息" :destroy-on-close="false" @close="toClose">
-      <menu-info></menu-info>
-    </el-dialog>
-  </div>
+  <el-row>
+    <el-col :span="24" style="text-align: right; padding: 10px">
+      <el-button type="primary" size="small" @click="toAdd()">添加</el-button>
+    </el-col>
+    <el-col :span="24">
+      <menu-table></menu-table>
+    </el-col>
+  </el-row>
+  <el-dialog v-model="dialog" title="菜单信息" :destroy-on-close="false" @close="toClose">
+    <menu-info></menu-info>
+  </el-dialog>
 </template>
 
 <script setup>