init
This commit is contained in:
407
front/src/router/index.js
Normal file
407
front/src/router/index.js
Normal file
@@ -0,0 +1,407 @@
|
||||
import Vue from "vue";
|
||||
import Router from "vue-router";
|
||||
|
||||
Vue.use(Router);
|
||||
|
||||
/* Layout */
|
||||
import Layout from "@/views/layout/Layout";
|
||||
|
||||
/** note: Submenu only appear when children.length>=1
|
||||
* detail see https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
|
||||
**/
|
||||
|
||||
/**
|
||||
* hidden: true if `hidden:true` will not show in the sidebar(default is false)
|
||||
* alwaysShow: true if set true, will always show the root menu, whatever its child routes length
|
||||
* if not set alwaysShow, only more than one route under the children
|
||||
* it will becomes nested mode, otherwise not show the root menu
|
||||
* redirect: noredirect if `redirect:noredirect` will no redirect in the breadcrumb
|
||||
* name:'router-name' the name is used by <keep-alive> (must set!!!)
|
||||
* meta : {
|
||||
roles: ['admin','editor'] will control the page roles (you can set multiple roles)
|
||||
title: 'title' the name show in submenu and breadcrumb (recommend set)
|
||||
icon: 'svg-name' the icon show in the sidebar,
|
||||
noCache: true if true ,the page will no be cached(default is false)
|
||||
}
|
||||
**/
|
||||
export const constantRouterMap = [
|
||||
{
|
||||
path: "/redirect",
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: "/redirect/:path*",
|
||||
component: () => import("@/views/assets-mgr/assetslist")
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: "/login",
|
||||
component: () => import("@/views/login/index"),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: "/auth-redirect",
|
||||
component: () => import("@/views/login/authredirect"),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: "/404",
|
||||
component: () => import("@/views/errorPage/404"),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: "/401",
|
||||
component: () => import("@/views/errorPage/401"),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: "/",
|
||||
component: Layout,
|
||||
meta: {
|
||||
title: "系统首页",
|
||||
icon: "camera"
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: "/dashboard",
|
||||
component: () => import("@/views/dashboard/index"),
|
||||
name: "系统首页",
|
||||
meta: { title: "系统首页", icon: "component", noCache: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: "/workbench",
|
||||
component: Layout,
|
||||
meta: {
|
||||
title: "我的工作台",
|
||||
icon: "camera"
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: "/workbench",
|
||||
component: () => import("@/views/workbench/index"),
|
||||
name: "我的工作台",
|
||||
meta: { title: "我的工作台", icon: "component", noCache: true }
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
//需要权限的路由表
|
||||
export const asyncRouterMap = [
|
||||
{
|
||||
path: "/assets-mgr",
|
||||
component: Layout,
|
||||
name: "资产管理",
|
||||
meta: {
|
||||
title: "资产管理",
|
||||
icon: "tree"
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: "assetslist",
|
||||
component: () => import("@/views/assets-mgr/assetslist"),
|
||||
name: "资产清单",
|
||||
meta: { title: "资产清单", icon: "component", noCache: true }
|
||||
},
|
||||
{
|
||||
path: "applylist",
|
||||
component: () => import("@/views/assets-mgr/applylist"),
|
||||
name: "申领记录",
|
||||
meta: { title: "申领记录", icon: "component", noCache: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: "/customer-mgr",
|
||||
component: Layout,
|
||||
name: "客户管理",
|
||||
meta: {
|
||||
title: "客户管理",
|
||||
icon: "tree"
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: "customerlist",
|
||||
component: () => import("@/views/customer-mgr/customerlist"),
|
||||
name: "客户清单",
|
||||
meta: { title: "客户清单", icon: "component", noCache: true }
|
||||
},
|
||||
{
|
||||
path: "customersearch",
|
||||
component: () => import("@/views/customer-mgr/customersearch"),
|
||||
name: "客户检索",
|
||||
meta: { title: "客户检索", icon: "component", noCache: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: "/supplier-mgr",
|
||||
component: Layout,
|
||||
name: "供应商管理",
|
||||
meta: {
|
||||
title: "供应商管理",
|
||||
icon: "tree"
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: "supplierlist",
|
||||
component: () => import("@/views/supplier-mgr/supplierlist"),
|
||||
name: "供应商清单",
|
||||
meta: { title: "供应商清单", icon: "component", noCache: true }
|
||||
},
|
||||
{
|
||||
path: "suppliersearch",
|
||||
component: () => import("@/views/supplier-mgr/suppliersearch"),
|
||||
name: "供应商检索",
|
||||
meta: { title: "供应商检索", icon: "component", noCache: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: "/develop-mgr",
|
||||
component: Layout,
|
||||
name: "研发管理",
|
||||
meta: {
|
||||
title: "研发管理",
|
||||
icon: "tree"
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: "developlist1",
|
||||
component: () => import("@/views/develop-mgr/developlist"),
|
||||
props: { project_type: 3 },
|
||||
name: "developlist1",
|
||||
meta: { title: "研发的项目", icon: "component", noCache: true }
|
||||
},
|
||||
{
|
||||
path: "developlist2",
|
||||
component: () => import("@/views/develop-mgr/developlist"),
|
||||
props: { project_type: 4 },
|
||||
name: "developlist2",
|
||||
meta: { title: "发布的项目", icon: "component", noCache: true }
|
||||
}
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
path: "/customer-prj",
|
||||
component: Layout,
|
||||
name: "项目管理",
|
||||
meta: {
|
||||
title: "项目管理",
|
||||
icon: "tree"
|
||||
},
|
||||
children: [
|
||||
/*{
|
||||
path: '/projectreport',
|
||||
component: () => import('@/views/customer-prj/projectreport'),
|
||||
name: 'projectreport',
|
||||
meta: { title: '项目概述', icon: 'component', noCache: true }
|
||||
},*/
|
||||
{
|
||||
path: "/projectlist1",
|
||||
component: () => import("@/views/customer-prj/projectlist"),
|
||||
props: { project_type: 1 },
|
||||
name: "projectlist1",
|
||||
meta: { title: "未启动项目", icon: "component", noCache: true }
|
||||
},
|
||||
{
|
||||
path: "/projectlist2",
|
||||
component: () => import("@/views/customer-prj/projectlist"),
|
||||
props: { project_type: 2 },
|
||||
name: "projectlist2",
|
||||
meta: { title: "执行中项目", icon: "component", noCache: true }
|
||||
},
|
||||
{
|
||||
path: "/projectlist3",
|
||||
component: () => import("@/views/customer-prj/projectlist"),
|
||||
props: { project_type: 3 },
|
||||
name: "projectlist3",
|
||||
meta: { title: "质保期项目", icon: "component", noCache: true }
|
||||
},
|
||||
{
|
||||
path: "projectlist4",
|
||||
component: () => import("@/views/customer-prj/projectlist"),
|
||||
props: { project_type: 4 },
|
||||
name: "projectlist4",
|
||||
meta: { title: "已关闭项目", icon: "component", noCache: true }
|
||||
} /*,
|
||||
{
|
||||
path: 'projecttask',
|
||||
component: () => import('@/views/customer-prj/projecttask'),
|
||||
name: '项目任务',
|
||||
meta: { title: '项目任务', icon: 'component', noCache: true }
|
||||
},
|
||||
{
|
||||
path: 'projectsearch',
|
||||
component: () => import('@/views/customer-prj/projectsearch'),
|
||||
name: '项目检索',
|
||||
meta: { title: '项目检索', icon: 'component', noCache: true }
|
||||
}*/
|
||||
]
|
||||
},
|
||||
/*{
|
||||
path: "/develop-prj",
|
||||
component: Layout,
|
||||
name: "研发项目",
|
||||
meta: {
|
||||
title: "研发项目",
|
||||
icon: "tree"
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: "/projectlist5",
|
||||
component: () => import("@/views/develop-prj/projectlist"),
|
||||
props: { project_type: 3 },
|
||||
name: "projectlist5",
|
||||
meta: { title: "研发中的项目", icon: "component", noCache: true }
|
||||
},
|
||||
{
|
||||
path: "/projectlist6",
|
||||
component: () => import("@/views/develop-prj/projectlist"),
|
||||
props: { project_type: 4 },
|
||||
name: "projectlist6",
|
||||
meta: { title: "发布中的项目", icon: "component", noCache: true }
|
||||
}
|
||||
]
|
||||
},*/
|
||||
{
|
||||
path: "/hr-mgr",
|
||||
component: Layout,
|
||||
name: "人事管理",
|
||||
meta: {
|
||||
title: "人事管理",
|
||||
icon: "tree"
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: "deptlist",
|
||||
component: () => import("@/views/hr-mgr/deptlist"),
|
||||
name: "组织结构",
|
||||
meta: { title: "组织结构", icon: "component", noCache: true }
|
||||
},
|
||||
{
|
||||
path: "stafflist",
|
||||
component: () => import("@/views/hr-mgr/stafflist"),
|
||||
name: "员工名录",
|
||||
meta: { title: "员工名录", icon: "component", noCache: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: "/contract-mgr",
|
||||
component: Layout,
|
||||
name: "合同管理",
|
||||
meta: {
|
||||
title: "合同管理",
|
||||
icon: "tree"
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: "projectcontract",
|
||||
component: () => import("@/views/contract-mgr/projectcontract"),
|
||||
name: "项目合同",
|
||||
meta: { title: "项目合同", icon: "component", noCache: true }
|
||||
},
|
||||
{
|
||||
path: "developcontract",
|
||||
component: () => import("@/views/contract-mgr/developcontract"),
|
||||
name: "研发合同",
|
||||
meta: { title: "研发合同", icon: "component", noCache: true }
|
||||
},
|
||||
{
|
||||
path: "operationcontract",
|
||||
component: () => import("@/views/contract-mgr/operationcontract"),
|
||||
name: "运营合同",
|
||||
meta: { title: "运营合同", icon: "component", noCache: true }
|
||||
},
|
||||
{
|
||||
path: "contractsearch",
|
||||
component: () => import("@/views/contract-mgr/contractsearch"),
|
||||
name: "合同检索",
|
||||
meta: { title: "合同检索", icon: "component", noCache: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: "/operation-mgr",
|
||||
component: Layout,
|
||||
name: "运营管理",
|
||||
meta: {
|
||||
title: "运营管理",
|
||||
icon: "tree"
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: "companynotice",
|
||||
component: () => import("@/views/operation-mgr/companynotice"),
|
||||
name: "公司公告",
|
||||
meta: { title: "公司公告", icon: "component", noCache: true }
|
||||
},
|
||||
/*{
|
||||
path: "weeklyreport",
|
||||
component: () => import("@/views/operation-mgr/weeklyreport"),
|
||||
name: "工作周报",
|
||||
meta: { title: "工作周报", icon: "component", noCache: true }
|
||||
},*/
|
||||
{
|
||||
path: "operationwork",
|
||||
component: () => import("@/views/operation-mgr/operationwork"),
|
||||
name: "运营工作",
|
||||
meta: { title: "运营工作", icon: "component", noCache: true }
|
||||
},
|
||||
{
|
||||
path: "employeestatistics",
|
||||
component: () => import("@/views/operation-mgr/employeestatistics"),
|
||||
name: "运营统计",
|
||||
meta: { title: "运营统计", icon: "component", noCache: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: "/system-mgr",
|
||||
component: Layout,
|
||||
meta: {
|
||||
title: "系统管理",
|
||||
icon: "model",
|
||||
level: 3,
|
||||
roles: ["admin"]
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: "imglist",
|
||||
component: () => import("@/views/system-mgr/imglist"),
|
||||
name: "配置管理",
|
||||
meta: { title: "配置管理" }
|
||||
},
|
||||
{
|
||||
path: "userlist",
|
||||
component: () => import("@/views/system-mgr/userlist"),
|
||||
name: "用户管理",
|
||||
meta: { title: "用户管理" }
|
||||
},
|
||||
{
|
||||
path: "functionlist",
|
||||
component: () => import("@/views/system-mgr/functionlist"),
|
||||
name: "权限分配",
|
||||
meta: { title: "权限分配" }
|
||||
}
|
||||
/*{
|
||||
path: 'smsmsgpush',
|
||||
component: () => import('@/views/system-mgr/smsmsgpush'),
|
||||
name: '消息管理',
|
||||
meta: { title: '消息管理' }
|
||||
}*/
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
export default new Router({
|
||||
// mode: 'history', // require service support
|
||||
scrollBehavior: () => ({ y: 0 }),
|
||||
routes: constantRouterMap
|
||||
});
|
||||
Reference in New Issue
Block a user