| | |
| | | import Login from '@/pages/login/Login' |
| | | import TabsView from '@/layouts/tabs/TabsView' |
| | | import BlankView from '@/layouts/BlankView' |
| | | import PageView from '@/layouts/PageView' |
| | | // import PageView from '@/layouts/PageView' |
| | | |
| | | // 路由配置 |
| | | const options = { |
| | | routes: [ |
| | | { |
| | | path: '/login', |
| | | name: '登录页', |
| | | component: Login |
| | | component: () => import('@/pages/login') |
| | | }, |
| | | { |
| | | path: '*', |
| | | name: '404', |
| | | component: () => import('@/pages/exception/404'), |
| | | }, |
| | | { |
| | | path: '/403', |
| | | name: '403', |
| | | component: () => import('@/pages/exception/403'), |
| | | }, |
| | | { |
| | | path: '/', |
| | |
| | | redirect: '/login', |
| | | children: [ |
| | | { |
| | | path: 'dashboard', |
| | | name: 'Dashboard', |
| | | path: 'workplace', |
| | | name: '工作台', |
| | | meta: { |
| | | icon: 'dashboard' |
| | | icon: 'home', |
| | | page: { |
| | | closable: false |
| | | }, |
| | | authority: { |
| | | role: ['1001', '1002', '1003'], |
| | | } |
| | | }, |
| | | component: () => import('@/pages/workplace'), |
| | | }, |
| | | { |
| | | path: 'workplaceList', |
| | | name: '问题反馈查询', |
| | | meta: { |
| | | icon: "message" |
| | | }, |
| | | component: () => import('@/pages/workplace/workplaceList') |
| | | }, |
| | | { |
| | | path: 'resource', |
| | | name: '资源管理', |
| | | meta: { |
| | | icon: 'dashboard', |
| | | authority: { |
| | | role: ['1001', '1002', '1003'], |
| | | } |
| | | }, |
| | | component: BlankView, |
| | | children: [ |
| | | { |
| | | path: 'workplace', |
| | | name: '工作台', |
| | | component: () => import('@/pages/dashboard/workplace/WorkPlace'), |
| | | path: 'materials', |
| | | name: '物料中心', |
| | | component: () => import('@/pages/resourceManage/materialsCenter'), |
| | | }, |
| | | { |
| | | path: 'analysis', |
| | | name: '分析页', |
| | | component: () => import('@/pages/dashboard/analysis/Analysis'), |
| | | } |
| | | path: 'material-history', |
| | | name: '物料历史', |
| | | meta: { |
| | | invisible: true, |
| | | highlight: '/resource/materials' |
| | | }, |
| | | component: () => import('@/pages/resourceManage/materialsCenter/history'), |
| | | }, |
| | | { |
| | | path: 'product', |
| | | name: '产品中心', |
| | | component: () => import('@/pages/resourceManage/product'), |
| | | }, |
| | | { |
| | | path: 'product-details', |
| | | name: '产品详情', |
| | | meta: { |
| | | invisible: true, |
| | | highlight: '/resource/product' |
| | | }, |
| | | component: () => import('@/pages/resourceManage/product/details'), |
| | | }, |
| | | { |
| | | path: 'product-diff', |
| | | name: '产品差异', |
| | | meta: { |
| | | invisible: true, |
| | | highlight: '/resource/product' |
| | | }, |
| | | component: () => import('@/pages/resourceManage/product/prodDiff'), |
| | | }, |
| | | // 0120详情 |
| | | { |
| | | path: 'product-details-0120', |
| | | name: '钣金件详情', |
| | | meta: { |
| | | invisible: true, |
| | | highlight: '/resource/product' |
| | | }, |
| | | component: () => import('@/pages/resourceManage/product/details'), |
| | | }, |
| | | // 08|09二级产品详情 |
| | | { |
| | | path: 'product-details-0809', |
| | | name: '二级产品详情', |
| | | meta: { |
| | | invisible: true, |
| | | highlight: '/resource/product' |
| | | }, |
| | | component: () => import('@/pages/resourceManage/product/details'), |
| | | }, |
| | | // 电源模块详情 |
| | | { |
| | | path: 'product-details-0235', |
| | | name: '电源模块详情', |
| | | meta: { |
| | | invisible: true, |
| | | highlight: '/resource/product' |
| | | }, |
| | | component: () => import('@/pages/resourceManage/product/details'), |
| | | }, |
| | | { |
| | | path: 'software', |
| | | name: '软件中心', |
| | | component: () => import('@/pages/resourceManage/software'), |
| | | }, |
| | | { |
| | | path: 'ecr', |
| | | name: 'BOM变更记录', |
| | | component: () => import('@/pages/resourceManage/ecr'), |
| | | }, |
| | | // { |
| | | // path: 'flow-card', |
| | | // name: '流程卡', |
| | | // component:()=>import('@/pages/resourceManage/flowCard') |
| | | // }, |
| | | { |
| | | path: 'sop-file', |
| | | name: 'SOP', |
| | | component:()=>import('@/pages/resourceManage/sopFile') |
| | | }, |
| | | { |
| | | path: 'sop-history', |
| | | name: 'sop历史版本', |
| | | meta: { |
| | | invisible: true, |
| | | highlight: '/resource/sop-file' |
| | | }, |
| | | component: () => import('@/pages/resourceManage/sopFile/sop-history'), |
| | | }, |
| | | { |
| | | path: 'specification', |
| | | name: '技术规格书', |
| | | component: () => import('@/pages/resourceManage/specification'), |
| | | }, |
| | | { |
| | | path: 'specification-history', |
| | | name: '技术规格书历史版本', |
| | | meta: { |
| | | invisible: true, |
| | | highlight: '/resource/specification' |
| | | }, |
| | | component: () => import('@/pages/resourceManage/specification/history'), |
| | | }, |
| | | { |
| | | path: 'defective', |
| | | name: '不良品管理', |
| | | component: () => import('@/pages/resourceManage/defective'), |
| | | }, |
| | | ] |
| | | }, |
| | | { |
| | | path: 'form', |
| | | name: '表单页', |
| | | path: 'user', |
| | | name: '用户', |
| | | meta: { |
| | | icon: 'form', |
| | | }, |
| | | component: PageView, |
| | | children: [ |
| | | { |
| | | path: 'basic', |
| | | name: '基础表单', |
| | | component: () => import('@/pages/form/basic/BasicForm'), |
| | | icon: 'user', |
| | | page: { |
| | | cacheAble: false |
| | | }, |
| | | { |
| | | path: 'step', |
| | | name: '分步表单', |
| | | component: () => import('@/pages/form/step/StepForm'), |
| | | }, |
| | | { |
| | | path: 'advance', |
| | | name: '高级表单', |
| | | component: () => import('@/pages/form/advance/AdvancedForm'), |
| | | authority: { |
| | | role: '1004', |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | path: 'list', |
| | | name: '列表页', |
| | | meta: { |
| | | icon: 'table' |
| | | }, |
| | | component: PageView, |
| | | children: [ |
| | | { |
| | | path: 'query', |
| | | name: '查询表格', |
| | | component: () => import('@/pages/list/QueryList'), |
| | | }, |
| | | { |
| | | path: 'primary', |
| | | name: '标准列表', |
| | | component: () => import('@/pages/list/StandardList'), |
| | | }, |
| | | { |
| | | path: 'card', |
| | | name: '卡片列表', |
| | | component: () => import('@/pages/list/CardList'), |
| | | }, |
| | | { |
| | | path: 'search', |
| | | name: '搜索列表', |
| | | component: () => import('@/pages/list/search/SearchLayout'), |
| | | children: [ |
| | | { |
| | | path: 'article', |
| | | name: '文章', |
| | | component: () => import('@/pages/list/search/ArticleList'), |
| | | }, |
| | | { |
| | | path: 'application', |
| | | name: '应用', |
| | | component: () => import('@/pages/list/search/ApplicationList'), |
| | | }, |
| | | { |
| | | path: 'project', |
| | | name: '项目', |
| | | component: () => import('@/pages/list/search/ProjectList'), |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | path: 'details', |
| | | name: '详情页', |
| | | meta: { |
| | | icon: 'profile' |
| | | }, |
| | | component: BlankView, |
| | | children: [ |
| | | { |
| | | path: 'basic', |
| | | name: '基础详情页', |
| | | component: () => import('@/pages/detail/BasicDetail') |
| | | path: 'list', |
| | | name: '用户信息', |
| | | component: () => import('@/pages/user'), |
| | | }, |
| | | { |
| | | path: 'advance', |
| | | name: '高级详情页', |
| | | component: () => import('@/pages/detail/AdvancedDetail') |
| | | } |
| | | // { |
| | | // path: 'power', |
| | | // name: '角色管理', |
| | | // component: () => import('@/pages/user/power'), |
| | | // } |
| | | ] |
| | | }, |
| | | { |
| | | path: 'result', |
| | | name: '结果页', |
| | | path: 'system', |
| | | name: '系统', |
| | | meta: { |
| | | icon: 'check-circle-o', |
| | | }, |
| | | component: PageView, |
| | | children: [ |
| | | { |
| | | path: 'success', |
| | | name: '成功', |
| | | component: () => import('@/pages/result/Success') |
| | | icon: 'profile', |
| | | page: { |
| | | cacheAble: false |
| | | }, |
| | | { |
| | | path: 'error', |
| | | name: '失败', |
| | | component: () => import('@/pages/result/Error') |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | path: 'exception', |
| | | name: '异常页', |
| | | meta: { |
| | | icon: 'warning', |
| | | }, |
| | | component: BlankView, |
| | | children: [ |
| | | { |
| | | path: '404', |
| | | name: 'Exp404', |
| | | component: () => import('@/pages/exception/404') |
| | | }, |
| | | { |
| | | path: '403', |
| | | name: 'Exp403', |
| | | component: () => import('@/pages/exception/403') |
| | | }, |
| | | { |
| | | path: '500', |
| | | name: 'Exp500', |
| | | component: () => import('@/pages/exception/500') |
| | | path: 'logs', |
| | | name: '操作日志', |
| | | component: () => import('@/pages/system/logs'), |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | path: 'components', |
| | | name: '小组件', |
| | | path: 'permission', |
| | | name: '权限', |
| | | meta: { |
| | | icon: 'appstore-o' |
| | | icon: 'apartment', |
| | | page: { |
| | | cacheAble: false |
| | | }, |
| | | authority: { |
| | | role: '1004', |
| | | } |
| | | }, |
| | | component: PageView, |
| | | component: BlankView, |
| | | children: [ |
| | | { |
| | | path: 'taskCard', |
| | | name: '任务卡片', |
| | | component: () => import('@/pages/components/TaskCard') |
| | | }, |
| | | { |
| | | path: 'palette', |
| | | name: '颜色复选框', |
| | | component: () => import('@/pages/components/Palette') |
| | | path: 'list', |
| | | name: '权限管理', |
| | | component: () => import('@/pages/permission'), |
| | | } |
| | | ] |
| | | } |
| | | }, |
| | | ] |
| | | } |
| | | }, |
| | | ] |
| | | } |
| | | |
| | | // 不需要登录拦截的路由配置 |
| | | const loginIgnore = { |
| | | names: ['404'], //根据路由名称匹配 |
| | | paths: ['/login'], //根据路由fullPath匹配 |
| | | /** |
| | | * 判断路由是否包含在该配置中 |
| | | * @param route vue-router 的 route 对象 |
| | | * @returns {boolean} |
| | | */ |
| | | includes(route) { |
| | | return this.names.includes(route.name) || this.paths.includes(route.path) |
| | | } |
| | | } |
| | | |
| | | export {options, loginIgnore} |
| | | export default options |