添加新的需求
This commit is contained in:
190
pc-cattle-transportation/src/router/index.ts
Normal file
190
pc-cattle-transportation/src/router/index.ts
Normal file
@@ -0,0 +1,190 @@
|
||||
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router';
|
||||
import LayoutIndex from '@/components/layout/index.vue';
|
||||
|
||||
export const constantRoutes: Array<RouteRecordRaw> = [
|
||||
{
|
||||
path: '',
|
||||
redirect: '/login',
|
||||
component: LayoutIndex,
|
||||
meta: {
|
||||
title: '登录',
|
||||
keepAlive: true,
|
||||
requireAuth: false,
|
||||
component: () => import('~/views/login.vue'),
|
||||
},
|
||||
children: [
|
||||
|
||||
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/login',
|
||||
name: 'Login',
|
||||
meta: {
|
||||
title: '登录',
|
||||
keepAlive: true,
|
||||
requireAuth: false,
|
||||
},
|
||||
component: () => import('~/views/login.vue'),
|
||||
},
|
||||
{
|
||||
path: '/entry',
|
||||
component: LayoutIndex,
|
||||
meta: {
|
||||
title: '入境检疫',
|
||||
keepAlive: true,
|
||||
requireAuth: true,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '/entry/details',
|
||||
name: 'details',
|
||||
meta: {
|
||||
title: '详情',
|
||||
keepAlive: true,
|
||||
requireAuth: false,
|
||||
},
|
||||
component: () => import('~/views/entry/details.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
// 添加对/system/post路径的处理
|
||||
{
|
||||
path: '/system',
|
||||
component: LayoutIndex,
|
||||
meta: {
|
||||
title: '系统管理',
|
||||
keepAlive: true,
|
||||
requireAuth: true,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'post',
|
||||
name: 'Post',
|
||||
meta: {
|
||||
title: '岗位管理',
|
||||
keepAlive: true,
|
||||
requireAuth: true,
|
||||
},
|
||||
component: () => import('~/views/system/post.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
// 权限管理路由
|
||||
{
|
||||
path: '/permission',
|
||||
component: LayoutIndex,
|
||||
meta: {
|
||||
title: '权限管理',
|
||||
keepAlive: true,
|
||||
requireAuth: true,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'menu',
|
||||
name: 'MenuPermission',
|
||||
meta: {
|
||||
title: '菜单权限管理',
|
||||
keepAlive: true,
|
||||
requireAuth: true,
|
||||
},
|
||||
component: () => import('~/views/permission/menuPermission.vue'),
|
||||
},
|
||||
{
|
||||
path: 'operation',
|
||||
name: 'OperationPermission',
|
||||
meta: {
|
||||
title: '操作权限管理',
|
||||
keepAlive: true,
|
||||
requireAuth: true,
|
||||
},
|
||||
component: () => import('~/views/permission/operationPermission.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
// 智能硬件路由
|
||||
{
|
||||
path: '/hardware',
|
||||
component: LayoutIndex,
|
||||
meta: {
|
||||
title: '智能硬件',
|
||||
keepAlive: true,
|
||||
requireAuth: true,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'collar',
|
||||
name: 'Collar',
|
||||
meta: {
|
||||
title: '智能项圈',
|
||||
keepAlive: true,
|
||||
requireAuth: true,
|
||||
},
|
||||
component: () => import('~/views/hardware/collar.vue'),
|
||||
},
|
||||
{
|
||||
path: 'eartag',
|
||||
name: 'Eartag',
|
||||
meta: {
|
||||
title: '智能耳标',
|
||||
keepAlive: true,
|
||||
requireAuth: true,
|
||||
},
|
||||
component: () => import('~/views/hardware/eartag.vue'),
|
||||
},
|
||||
{
|
||||
path: 'host',
|
||||
name: 'Host',
|
||||
meta: {
|
||||
title: '智能主机',
|
||||
keepAlive: true,
|
||||
requireAuth: true,
|
||||
},
|
||||
component: () => import('~/views/hardware/host.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
// 运送清单路由
|
||||
{
|
||||
path: '/shipping',
|
||||
component: LayoutIndex,
|
||||
meta: {
|
||||
title: '运送清单',
|
||||
keepAlive: true,
|
||||
requireAuth: true,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'loadingOrder',
|
||||
name: 'LoadingOrder',
|
||||
meta: {
|
||||
title: '装车订单',
|
||||
keepAlive: true,
|
||||
requireAuth: true,
|
||||
},
|
||||
component: () => import('~/views/shipping/loadingOrder.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export const dynamicRoutes = [
|
||||
{
|
||||
path: '/menu',
|
||||
name: 'Menu',
|
||||
meta: {
|
||||
title: '首页',
|
||||
keepAlive: true,
|
||||
requireAuth: false,
|
||||
},
|
||||
component: () => import('~/views/system/menu.vue'),
|
||||
},
|
||||
];
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: constantRoutes,
|
||||
scrollBehavior: () => ({ behavior: 'auto', left: 0, top: 0 }),
|
||||
});
|
||||
|
||||
export default router;
|
||||
Reference in New Issue
Block a user