Преглед на файлове

routerHelper文件修改

wuhongbo преди 1 година
родител
ревизия
8dd7367ed2
променени са 3 файла, в които са добавени 20 реда и са изтрити 5 реда
  1. 11 3
      client/src/utils/routerHelper.ts
  2. 9 0
      client/src/views/OaSystem/oaLayout/index.vue
  3. 0 2
      client/src/views/OaSystem/olanTool/index.vue

+ 11 - 3
client/src/utils/routerHelper.ts

@@ -19,7 +19,8 @@ export const registerComponent = (componentPath: string) => {
 }
 /* Layout */
 export const Layout = () => import('@/layout/Layout.vue')
-
+/* oaLayout */
+export const OaLayout = () => import('@/views/OaSystem/oaLayout/index.vue')
 export const getParentLayout = () => {
   return () =>
     new Promise((resolve) => {
@@ -63,6 +64,8 @@ export const getRawRoute = (route: RouteLocationNormalized): RouteLocationNormal
 export const generateRoute = (routes: AppCustomRouteRecordRaw[]): AppRouteRecordRaw[] => {
   const res: AppRouteRecordRaw[] = []
   const modulesRoutesKeys = Object.keys(modules)
+  console.log(routes)
+
   for (const route of routes) {
     const meta = {
       title: route.name,
@@ -108,8 +111,13 @@ export const generateRoute = (routes: AppCustomRouteRecordRaw[]): AppRouteRecord
     } else {
       // 目录
       if (route.children) {
-        data.component = Layout
-        data.redirect = getRedirect(route.path, route.children)
+        if (route.path == '/oaSystem') {
+          data.component = OaLayout
+          data.redirect = getRedirect(route.path, route.children)
+        } else {
+          data.component = Layout
+          data.redirect = getRedirect(route.path, route.children)
+        }
         // 外链
       } else if (isUrl(route.path)) {
         data = {

+ 9 - 0
client/src/views/OaSystem/oaLayout/index.vue

@@ -0,0 +1,9 @@
+<template>
+  <div class="_layout"> layout </div>
+</template>
+<script setup lang="ts">
+defineOptions({ name: 'Layout' })
+
+/** 初始化 **/
+onMounted(() => {})
+</script>

+ 0 - 2
client/src/views/OaSystem/olanTool/index.vue

@@ -2,8 +2,6 @@
   <div class="_OlanTool"> 规划工具 </div>
 </template>
 <script setup lang="ts">
-import type { Column } from 'element-plus'
-
 defineOptions({ name: 'OlanTool' })
 
 /** 初始化 **/