Explorar el Código

路由文件路径修改,头部导航层级调整

zhangyu hace 4 años
padre
commit
25b5b2c5b1
Se han modificado 5 ficheros con 193 adiciones y 160 borrados
  1. 1 0
      src/layout/components/Navbar/index.vue
  2. 1 1
      src/main.ts
  3. 1 1
      src/permission.ts
  4. 0 158
      src/router.ts
  5. 190 0
      src/router/index.ts

+ 1 - 0
src/layout/components/Navbar/index.vue

@@ -74,6 +74,7 @@ export default class extends Vue {
   position: relative;
   background-color: #2b3643;
   box-shadow: 0 1px 4px rgba(0, 21, 41, .08);
+  z-index: 1002;
 
   .title {
     float: left;

+ 1 - 1
src/main.ts

@@ -9,7 +9,7 @@ import '@/styles/index.scss'
 
 import App from '@/App.vue'
 import store from '@/store'
-import router from '@/router'
+import router from '@/router/index'
 import '@/icons/components'
 import '@/permission'
 

+ 1 - 1
src/permission.ts

@@ -1,4 +1,4 @@
-import router from './router'
+import router from './router/index'
 import NProgress from 'nprogress'
 import 'nprogress/nprogress.css'
 import { Message } from 'element-ui'

+ 0 - 158
src/router.ts

@@ -1,158 +0,0 @@
-import Vue from 'vue'
-import Router from 'vue-router'
-import Layout from '@/layout/index.vue'
-
-Vue.use(Router)
-
-/*
-  redirect:                     如果设置为“noredirect”,则单击面包屑时不会触发重定向操作
-  meta: {
-    title: 'title'               子菜单和面包屑中显示的名称(推荐)
-    icon: 'svg-name'             侧边栏中显示的图标
-    breadcrumb: false            如果为false,则项目将隐藏在breadcrumb中(默认值为true)
-    hidden: true                 如果为true,此路由将不会显示在侧边栏中(默认为false)
-  }
-*/
-
-export default new Router({
-  mode: 'history',
-  scrollBehavior: (to, from, savedPosition) => {
-    if (savedPosition) {
-      return savedPosition
-    } else {
-      return {x: 0, y: 0}
-    }
-  },
-  base: process.env.BASE_URL,
-  routes: [
-    {
-      path: '/login',
-      component: () => import(/* webpackChunkName: "login" */ '@/views/login/index.vue'),
-      meta: {hidden: true}
-    },
-    {
-      path: '/404',
-      component: () => import(/* webpackChunkName: "404" */ '@/views/404.vue'),
-      meta: {hidden: true}
-    },
-    {
-      path: '/',
-      redirect: '/project/index',
-      component: Layout,
-      children: [
-        {
-          path: 'project/index',
-          component: () => import(/* webpackChunkName: "project" */ '@/views/project/index.vue'),
-          meta: {
-            title: '项目管理',
-            icon: 'form'
-          }
-        }
-      ]
-    },
-    {
-      path: '/manage',
-      component: Layout,
-      meta: {
-        title: '文件管理',
-        icon: 'example'
-      },
-      children: [
-        {
-          path: 'build',
-          component: () => import(/* webpackChunkName: "build" */ '@/views/manage/build/index.vue'),
-          meta: {
-            title: '建筑楼层管理',
-            icon: 'tree'
-          }
-        },
-        {
-          path: 'model',
-          component: () => import(/* webpackChunkName: "model" */ '@/views/manage/model/index.vue'),
-          meta: {
-            title: '模型修改任务',
-            icon: 'table'
-          }
-        }
-      ]
-    }, {
-      path: '/maintain',
-      component: Layout,
-      redirect: '/maintain/device',
-      meta: {
-        title: '数据维护',
-        icon: 'nested'
-      },
-      children: [
-        {
-          path: 'device',
-          component: () => import(/* webpackChunkName: "device" */ '@/views/maintain/device/index.vue'),
-          meta: {title: '设备'},
-        },
-        {
-          path: 'space',
-          component: () => import(/* webpackChunkName: "space" */ '@/views/maintain/space/index.vue'),
-          meta: {title: '空间'}
-        },
-        {
-          path: 'system',
-          component: () => import(/* webpackChunkName: "system" */ '@/views/maintain/system/index.vue'),
-          meta: {title: '系统'}
-        },
-        {
-          path: 'relationship',
-          component: () => import(/* webpackChunkName: "relationship" */ '@/views/maintain/relationship/index.vue'),
-          meta: {title: '关系'}
-        }
-      ]
-    },
-
-    {
-      path: '/scene',
-      component: Layout,
-      redirect: '/scene/tiepoint',
-      meta: {
-        title: '现场实施',
-        icon: 'nested'
-      },
-      children: [
-        {
-          path: 'tiepoint',
-          component: () => import(/* webpackChunkName: "tiepoint" */ '@/views/scene/tiepoint/index.vue'),
-          meta: {title: '绑点'},
-        },
-        {
-          path: 'system',
-          component: () => import(/* webpackChunkName: "system" */ '@/views/scene/system/index.vue'),
-          meta: {title: '系统图'}
-        },
-        {
-          path: 'plane',
-          component: () => import(/* webpackChunkName: "plane" */ '@/views/scene/plane/index.vue'),
-          meta: {title: '平面图'}
-        }
-      ]
-    },
-    {
-      path: '/tools',
-      component: Layout,
-      meta: {
-        title: '一致性检查工具',
-        icon: 'nested'
-      },
-    },
-    {
-      path: '/model-tool',
-      component: Layout,
-      meta: {
-        title: '模型检查工具',
-        icon: 'nested'
-      },
-    },
-    {
-      path: '*',
-      redirect: '/404',
-      meta: {hidden: true}
-    }
-  ]
-})

+ 190 - 0
src/router/index.ts

@@ -0,0 +1,190 @@
+import Vue from "vue";
+import Router from "vue-router";
+import Layout from "@/layout/index.vue";
+
+Vue.use(Router);
+
+/*
+  redirect:                     如果设置为“noredirect”,则单击面包屑时不会触发重定向操作
+  meta: {
+    title: 'title'               子菜单和面包屑中显示的名称(推荐)
+    icon: 'svg-name'             侧边栏中显示的图标
+    breadcrumb: false            如果为false,则项目将隐藏在breadcrumb中(默认值为true)
+    hidden: true                 如果为true,此路由将不会显示在侧边栏中(默认为false)
+  }
+*/
+
+export default new Router({
+  mode: "history",
+  scrollBehavior: (to, from, savedPosition) => {
+    if (savedPosition) {
+      return savedPosition;
+    } else {
+      return { x: 0, y: 0 };
+    }
+  },
+  base: process.env.BASE_URL,
+  routes: [
+    {
+      path: "/login",
+      component: () =>
+        import(/* webpackChunkName: "login" */ "@/views/login/index.vue"),
+      meta: { hidden: true }
+    },
+    {
+      path: "/404",
+      component: () => import(/* webpackChunkName: "404" */ "@/views/404.vue"),
+      meta: { hidden: true }
+    },
+    {
+      path: "/",
+      redirect: "/project/index",
+      component: Layout,
+      children: [
+        {
+          path: "project/index",
+          component: () =>
+            import(
+              /* webpackChunkName: "project" */ "@/views/project/index.vue"
+            ),
+          meta: {
+            title: "项目管理",
+            icon: "form"
+          }
+        }
+      ]
+    },
+    {
+      path: "/manage",
+      component: Layout,
+      meta: {
+        title: "文件管理",
+        icon: "example"
+      },
+      children: [
+        {
+          path: "build",
+          component: () =>
+            import(
+              /* webpackChunkName: "build" */ "@/views/manage/build/index.vue"
+            ),
+          meta: {
+            title: "建筑楼层管理",
+            icon: "tree"
+          }
+        },
+        {
+          path: "model",
+          component: () =>
+            import(
+              /* webpackChunkName: "model" */ "@/views/manage/model/index.vue"
+            ),
+          meta: {
+            title: "模型修改任务",
+            icon: "table"
+          }
+        }
+      ]
+    },
+    {
+      path: "/maintain",
+      component: Layout,
+      redirect: "/maintain/device",
+      meta: {
+        title: "数据维护",
+        icon: "nested"
+      },
+      children: [
+        {
+          path: "device",
+          component: () =>
+            import(
+              /* webpackChunkName: "device" */ "@/views/maintain/device/index.vue"
+            ),
+          meta: { title: "设备" }
+        },
+        {
+          path: "space",
+          component: () =>
+            import(
+              /* webpackChunkName: "space" */ "@/views/maintain/space/index.vue"
+            ),
+          meta: { title: "空间" }
+        },
+        {
+          path: "system",
+          component: () =>
+            import(
+              /* webpackChunkName: "system" */ "@/views/maintain/system/index.vue"
+            ),
+          meta: { title: "系统" }
+        },
+        {
+          path: "relationship",
+          component: () =>
+            import(
+              /* webpackChunkName: "relationship" */ "@/views/maintain/relationship/index.vue"
+            ),
+          meta: { title: "关系" }
+        }
+      ]
+    },
+
+    {
+      path: "/scene",
+      component: Layout,
+      redirect: "/scene/tiepoint",
+      meta: {
+        title: "现场实施",
+        icon: "nested"
+      },
+      children: [
+        {
+          path: "tiepoint",
+          component: () =>
+            import(
+              /* webpackChunkName: "tiepoint" */ "@/views/scene/tiepoint/index.vue"
+            ),
+          meta: { title: "绑点" }
+        },
+        {
+          path: "system",
+          component: () =>
+            import(
+              /* webpackChunkName: "system" */ "@/views/scene/system/index.vue"
+            ),
+          meta: { title: "系统图" }
+        },
+        {
+          path: "plane",
+          component: () =>
+            import(
+              /* webpackChunkName: "plane" */ "@/views/scene/plane/index.vue"
+            ),
+          meta: { title: "平面图" }
+        }
+      ]
+    },
+    {
+      path: "/tools",
+      component: Layout,
+      meta: {
+        title: "一致性检查工具",
+        icon: "nested"
+      }
+    },
+    {
+      path: "/model-tool",
+      component: Layout,
+      meta: {
+        title: "模型检查工具",
+        icon: "nested"
+      }
+    },
+    {
+      path: "*",
+      redirect: "/404",
+      meta: { hidden: true }
+    }
+  ]
+});