hberp/hb_client/src/router/index.js

776 lines
23 KiB
JavaScript

import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
/* Layout */
import Layout from '@/layout'
/**
* Note: sub-menu only appear when route children.length >= 1
* Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
*
* hidden: true if set true, item will not show in the sidebar(default is false)
* alwaysShow: true if set true, will always show the root menu
* if not set alwaysShow, when item has more than one children route,
* it will becomes nested mode, otherwise not show the root menu
* redirect: noRedirect if set noRedirect will no redirect in the breadcrumb
* name:'router-name' the name is used by <keep-alive> (must set!!!)
* meta : {
perms: ['admin','editor'] control the page perms (you can set multiple perms)
title: 'title' the name show in sidebar and breadcrumb (recommend set)
icon: 'svg-name' the icon show in the sidebar
breadcrumb: false if set false, the item will hidden in breadcrumb(default is true)
activeMenu: '/example/list' if set path, the sidebar will highlight the path you set
}
*/
/**
* constantRoutes
* a base page that does not have permission requirements
* all perms can be accessed
*/
export const constantRoutes = [
{
path: '/login',
component: () => import('@/views/login/index'),
hidden: true
},
{
path: '/404',
component: () => import('@/views/404'),
hidden: true
},
{
path: '/',
component: Layout,
redirect: '/dashboard',
children: [{
path: 'dashboard',
name: 'Dashboard',
component: () => import('@/views/dashboard/index'),
meta: { title: '首页', icon: 'home', affix: true,keepAlive: false }
}]
},
{
path: '/index',
component: () => import('@/views/bigScreen/index'),
meta: { title: '大屏', icon: 'bigScreen', affix: true,keepAlive: false }
},
{
path: '/changepassword',
component: Layout,
redirect: '/changepassword',
name: 'ChangePW',
meta: { title: '修改密码', icon: 'tree' },
hidden:true,
children: [
{
path: '',
name: 'ChangePassword',
component: () => import('@/views/system/changepassword'),
meta: { title: '修改密码', noCache: true, icon: ''},
hidden: true
},
]
},
]
/**
* asyncRoutes
* the routes that need to be dynamically loaded based on user perms
*/
export const asyncRoutes = [
{
path: '/redirect',
component: Layout,
hidden: true,
children: [
{
path: '/redirect/:path(.*)',
component: () => import('@/views/redirect/index')
}
]
},
{
path: '/mtm',
component: Layout,
redirect: '/mtm/material/',
name: 'mtm',
meta: { title: '制造管理', icon: 'make', perms: ['mtm_manage'] },
children: [
{
path: 'material',
name: 'material',
component: () => import('@/views/mtm/material'),
meta: { title: '物料清单', icon: 'material', perms: ['mtm_material'] }
}
,
{
path: 'material/:id',
name: 'MaterialDO',
component: () => import('@/views/mtm/materialdo.vue'),
meta: { title: '绑定检查表', perms: ['vendor_manage'] },
hidden: true
}
,
{
path: 'materialDetail/:id',
name: 'MaterialDetail',
component: () => import('@/views/mtm/materialDetail.vue'),
meta: { title: '物料详情', perms: ['vendor_manage'] },
hidden: true
},
{
path: 'process',
name: 'process',
component: () => import('@/views/mtm/process'),
meta: { title: '工序管理', icon: 'procedure', perms: ['mtm_process'] }
},
{
path: 'step/:id',
name: 'Step',
component: () => import('@/views/mtm/step.vue'),
meta: { title: '子工序', perms: ['vendor_manage'] },
hidden: true
}
,
{
path: 'stepdo/:id',
name: 'StepDo',
component: () => import('@/views/mtm/stepdo.vue'),
meta: { title: '子工序查看', perms: ['vendor_manage'] },
hidden: true
},
{
path: '/mtm/productprocess/',
name: 'productprocess',
component: () => import('@/views/mtm/productprocess'),
meta: { title: '产品管理', icon: 'product', perms: ['mtm_productprocess'] }
},
]
},
{
path: '/pm',
component: Layout,
redirect: '/pm/plan',
name: 'pm',
meta: { title: '生产管理', icon: 'produce', perms: ['pm_manage'] },
children: [
{
path: 'plan',
name: 'plan',
component: () => import('@/views/pm/plan'),
meta: { title: '生产计划管理', icon: 'productionPlan', perms: ['index_manage'] }
}
,
{
path: 'work/:id',
name: 'work',
component: () => import('@/views/pm/work'),
meta: { title: '生产子计划', perms: ['vendor_manage'] },
hidden: true
},
{
path: 'resources',
name: 'resources',
component: () => import('@/views/pm/resources'),
meta: { title: '生产资源配置', icon: 'productionResources', perms: ['pm_resources'] }
}
,
{
path: 'management',
name: 'management',
component: () => import('@/views/pm/management'),
meta: { title: '生产任务管理', icon: 'productionTask', perms: ['pm_resources'] }
},
{
path: 'plandetails/:id',
name: 'plandetails',
component: () => import('@/views/pm/plandetails'),
meta: { title: '生产任务详情', perms: ['vendor_manage'] },
hidden: true
}
,
{
path: 'processcard/:id',
name: 'processcard',
component: () => import('@/views/pm/processcard'),
meta: { title: '流程卡', perms: ['vendor_manage'] },
hidden: true
}
]
},
{
path: '/wpm',
component: Layout,
redirect: '/wpm/worktask',
name: 'wpm',
meta: { title: '生产执行', icon: 'execute', perms: ['equipment_set'] },
children: [
{
path: 'worktask',
name: 'worktask',
component: () => import('@/views/wpm/worktask'),
meta: { title: '车间任务', icon: 'workshopTask', perms: ['index_manage'] }
},
{
path: 'operation',
name: 'operation',
component: () => import('@/views/wpm/operation'),
meta: { title: '车间操作', icon: 'workshopOperation', perms: ['index_manage'] }
}
,
{
path: 'operationdo/:id',
name: 'operationdo',
component: () => import('@/views/wpm/operationdo'),
meta: { title: '车间操作跳转界面', icon: 'home', perms: ['index_manage'] },
hidden: true
},
{
path: 'need',
name: 'need',
component: () => import('@/views/wpm/need'),
meta: { title: '过程检验', icon: 'processTest', perms: ['index_manage'] }
}
,
{
path: 'productjy',
name: 'productjy',
component: () => import('@/views/wpm/productjy'),
meta: { title: '成品检验', icon: 'finishedCheck', perms: ['index_manage'] }
}
]
},
{
path: '/em',
component: Layout,
redirect: '/em/equipment',
name: 'em',
meta: { title: '设备管理', icon: 'equipment', perms: ['em_manage'] },
children: [
{
path: 'equipment',
name: 'equipment',
component: () => import('@/views/em/equipment'),
meta: { title: '生产设备', icon: 'productionEquipment', perms: ['em_equipment'] }
},
{
path: 'monitoring ',
name: 'monitoring ',
component: () => import('@/views/em/monitoring'),
meta: { title: '监视和测量设备', icon: 'monitorEquipment', perms: ['em_monitoring'] }
},
{
path: 'record',
name: 'record',
component: () => import('@/views/em/record'),
meta: { title: '校准检定记录', icon: 'calibrationRecord', perms: ['em_record'] }
}
]
},
{
path: '/sam',
component: Layout,
redirect: '/sam/customer',
name: 'sam',
meta: { title: '销售管理', icon: 'sale', perms: ['equipment_set'] },
children: [
{
path: 'customer',
name: 'customer',
component: () => import('@/views/sam/customer'),
meta: { title: '客户管理', icon: 'customer', perms: ['index_manage'] }
},
{
path: 'contract',
name: 'contract',
component: () => import('@/views/sam/contract'),
meta: { title: '合同管理', icon: 'contract', perms: ['index_manage'] }
}
,
{
path: 'contractdetail/:id',
name: 'contractdetail',
component: () => import('@/views/sam/contractdetail'),
meta: { title: '合同详情', perms: ['vendor_manage'] },
hidden: true
}
,
{
path: 'order',
name: 'order',
component: () => import('@/views/sam/order'),
meta: { title: '订单管理', icon: 'order', perms: ['index_manage'] }
}
,
{
path: 'orderdetail/:id',
name: 'orderdetail',
component: () => import('@/views/sam/orderdetail'),
meta: { title: '订单详情', perms: ['vendor_manage'] },
hidden: true
},
{
path: 'sales',
name: 'sales',
component: () => import('@/views/sam/sales'),
meta: { title: '销售信息', icon: 'saleInfo', perms: ['index_manage'] }
}
,
{
path: 'salesdetail/:id',
name: 'salesdetail',
component: () => import('@/views/sam/salesdetail'),
meta: { title: '销售详情', perms: ['vendor_manage'] },
hidden: true
}
]
},
{
path: '/qm',
component: Layout,
redirect: '/qm/product',
name: 'qm',
meta: { title: '检验管理', icon: 'test', perms: ['equipment_set'] },
children: [
{
path: 'product',
name: 'product',
component: () => import('@/views/qm/product'),
meta: { title: '军检', icon: 'check', perms: ['index_manage'] }
}
,
{
path: 'admissiontest',
name: 'admissiontest',
component: () => import('@/views/qm/admissiontest'),
meta: { title: '入厂检验', icon: 'check', perms: ['index_manage'] }
}
,
{
path: 'processtest',
name: 'processtest',
component: () => import('@/views/qm/processtest'),
meta: { title: '过程检验', icon: 'processTest', perms: ['index_manage'] }
},
{
path: 'taskdetails/:id',
name: 'taskdetails',
component: () => import('@/views/qm/taskdetails'),
meta: { title: '过程检验详情', perms: ['vendor_manage'] },
hidden: true
}
,
{
path: 'wproduct/:id',
name: 'wproduct',
component: () => import('@/views/qm/wproduct'),
meta: { title: '工序玻璃', perms: ['vendor_manage'] },
hidden: true
}
,
{
path: 'taskrecordfrom/:id',
name: 'taskrecordfrom',
component: () => import('@/views/qm/taskrecordfrom'),
meta: { title: '检验记录', perms: ['vendor_manage'] },
hidden: true
}
,
{
path: 'producttest',
name: 'producttest',
component: () => import('@/views/qm/producttest'),
meta: { title: '成品检验', icon: 'finishedCheck', perms: ['index_manage'] }
},
{
path: 'unproduct',
name: 'unproduct',
component: () => import('@/views/qm/unproduct'),
meta: { title: '不合格品', icon: 'unqualified', perms: ['index_manage'] }
}
]
},
{
path: '/personnel',
component: Layout,
redirect: '/personnel/user',
name: 'personnel',
meta: { title: '人员管理', icon: 'user', perms: ['personnel_set'] },
children: [
{
path: 'user',
name: 'user',
component: () => import('@/views/personnel/user'),
meta: { title: '人员列表', icon: 'userList', perms: ['user_manage'] }
},
{
path: 'attendance',
name: 'attendance',
component: () => import('@/views/personnel/attendance'),
meta: { title: '考勤列表', icon: 'attendance', perms: ['attendance_manage'] }
} ,{
path: 'userupdate/:id',
name: 'userupdate',
component: () => import('@/views/personnel/userupdate'),
meta: { title: '人员信息详情', icon: 'home', perms: ['employee_detail'] },
hidden: true
},
]
},
{
path: '/inm',
component: Layout,
redirect: '/inm/warehouse',
name: 'inm',
meta: { title: '库存管理', icon: 'stock', perms: ['equipment_set'] },
children: [
{
path: 'warehouse',
name: 'warehouse',
component: () => import('@/views/inm/warehouse'),
meta: { title: '仓库', icon: 'warehouse', perms: ['index_manage'] }
},
{
path: 'inventory/:id',
name: 'inventory',
component: () => import('@/views/inm/inventory'),
meta: { title: '仓库物料', perms: ['vendor_manage'] },
hidden: true
}
,
{
path: 'materialbatch',
name: 'materialbatch',
component: () => import('@/views/inm/materialbatch'),
meta: { title: '物料批次', icon: 'materialbatch', perms: ['index_manage'] }
},
{
path: 'fifo',
name: 'fifo',
component: () => import('@/views/inm/fifo'),
meta: { title: '出入库记录', icon: 'home', perms: ['index_manage'] }
},
{
path: 'fifodetail/:id',
name: 'fifodetail',
component: () => import('@/views/inm/fifodetail'),
meta: { title: '仓库物料', perms: ['vendor_manage'] },
hidden: true
},
{
path: 'wproduct',
name: 'wproduct',
component: () => import('@/views/inm/wproduct'),
meta: { title: '半成品库', icon: 'wproduct', perms: ['index_manage'] }
},
{
path: 'product',
name: 'product',
component: () => import('@/views/inm/product'),
meta: { title: '成品库', icon: 'finishedProduct', perms: ['index_manage'] }
},
]
},
{
path: '/procurement',
component: Layout,
redirect: '/procurement/vendor',
name: 'procurement',
meta: { title: '采购管理', icon: 'purchase', perms: ['procurement_set'] },
children: [
{
path: 'vendor',
name: 'vendor',
component: () => import('@/views/procurement/vendor'),
meta: { title: '供应商', icon: 'supplier', perms: ['vendor_manage'] }
},
{
path: 'puorder',
name: 'puorder',
component: () => import('@/views/procurement/puorder'),
meta: { title: '采购订单', icon: 'purchaseOrder', perms: ['vendor_manage'] }
},
{
path: 'puorderitem/:id',
name: 'puorderitem',
component: () => import('@/views/procurement/puorderitem'),
meta: { title: '采购订单项', perms: ['vendor_manage'] },
hidden: true
}
]
},
{
path: '/statistics',
component: Layout,
redirect: '/statistics/progressStatistics',
name: 'statistics',
meta: { title: '统计分析', icon: 'statistics', perms: ['workflow_manage'] },
children: [
{
path: 'progressStatistics',
name: 'progressStatistics',
component: () => import('@/views/statistics/progressStatistics'),
meta: { title: '进度统计', icon: 'progressStatistics', perms: ['workflow_index'] }
},
{
path: 'materialStatistics',
name: 'materialStatistics',
component: () => import('@/views/statistics/materialStatistics'),
meta: { title: '物料统计', icon: 'materialStatistics', perms: ['workflow_index'] }
},
{
path: 'personStatistics',
name: 'personStatistics',
component: () => import('@/views/statistics/personStatistics'),
meta: { title: '人员统计', icon: 'personStatistics', perms: ['workflow_index'] }
},
{
path: 'costStatistics',
name: 'costStatistics',
component: () => import('@/views/statistics/costStatistics'),
meta: { title: '成本统计', icon: 'costStatistics', perms: ['workflow_index'] }
},
{
path: 'testStatistics',
name: 'testStatistics',
component: () => import('@/views/statistics/testStatistics'),
meta: { title: '检验统计', icon: 'testStatistics', perms: ['workflow_index'] }
},
]
},
{
path: '/workflow',
component: Layout,
redirect: '/workflow/index',
name: 'workflow',
meta: { title: '工作流', icon: 'home', perms: ['workflow_manage'] },
children: [
{
path: 'index',
name: 'index',
component: () => import('@/views/workflow/index'),
meta: { title: '工作流配置', icon: 'home', perms: ['workflow_index'] }
},
{
path: 'ticket',
name: 'ticket',
component: () => import('@/views/workflow/ticket'),
meta: { title: '工单管理', icon: 'home' ,noCache: true, perms: ['workflow_ticket'] },
},
{
path: 'workFlowTickets',
name: 'workFlowTickets',
component: () => import('@/views/workflow/workFlowTickets'),
meta: { title: '工单管理', icon: 'home' ,noCache: true,},
hidden: true
},
{
path: 'configuration',
name: 'configuration',
component: () => import('@/views/workflow/configuration'),
meta: { title: '人员信息详情', icon: 'home' },
hidden: true
},
{
path: 'ticketHandle',
name: 'ticketHandle',
component: () => import('@/views/workflow/ticketHandle'),
meta: { title: '工单处理', icon: 'home',noCache: true,},
hidden: true
},
{
path: 'ticketDetail',
name: 'ticketDetail',
component: () => import('@/views/workflow/ticketDetail'),
meta: { title: '工单详情', icon: 'home',noCache: true,},
hidden: true
},
]
},
{
path: '/system',
component: Layout,
redirect: '/system/user',
name: 'System',
meta: { title: '系统管理', icon: 'home', perms: ['system_manage'] },
children: [
{
path: 'user',
name: 'User',
component: () => import('@/views/system/user.vue'),
meta: { title: '用户管理', icon: 'home', perms: ['user_manage'] }
}
,
{
path: 'organization',
name: 'Organization',
component: () => import('@/views/system/organization'),
meta: { title: '部门管理', icon: 'home', perms: ['org_manage'] }
},
{
path: 'role',
name: 'Role',
component: () => import('@/views/system/role'),
meta: { title: '角色管理', icon: 'home', perms: ['role_manage'] }
},
{
path: 'position',
name: 'Postion',
component: () => import('@/views/system/position'),
meta: { title: '岗位管理', icon: 'home', perms: ['position_manage'] }
},
{
path: 'dict',
name: 'Dict',
component: () => import('@/views/system/dict'),
meta: { title: '数据字典', icon: 'home', perms: ['dict_manage'] }
},
{
path: 'file',
name: 'File',
component: () => import('@/views/system/file'),
meta: { title: '文件库', icon: 'home', perms: ['file_room'] }
},
{
path: 'task',
name: 'Task',
component: () => import('@/views/system/task'),
meta: { title: '定时任务', icon: 'home', perms: ['ptask_manage'] }
}
]
},
{
path: '/monitor',
component: Layout,
redirect: '/monitor/service',
name: 'Monitor',
meta: { title: '系统监控', icon: 'home', perms: ['monitor_set'] },
children: [
{
path: 'service',
name: 'service',
component: () => import('@/views/monitor/service'),
meta: { title: '服务监控', icon: 'home', perms: ['service_manage'] }
}
]
},
{
path: '/develop',
component: Layout,
redirect: '/develop/perm',
name: 'Develop',
meta: { title: '开发配置', icon: 'home', perms: ['dev_set'] },
children: [
{
path: 'perm',
name: 'Perm',
component: () => import('@/views/system/perm'),
meta: { title: '权限菜单', icon: 'home', perms: ['perm_manage'] }
},
{
path: 'form-gen-link',
component: Layout,
children: [
{
path: 'https://jakhuang.github.io/form-generator/',
meta: { title: '表单设计器', icon: 'home', perms: ['dev_form_gen'] }
}
]
},
{
path: 'docs-link',
component: Layout,
children: [
{
path: process.env.VUE_APP_BASE_API + '/docs/',
meta: { title: '接口文档', icon: 'home', perms: ['dev_docs'] }
}
]
},
{
path: 'docs-link2',
component: Layout,
children: [
{
path: process.env.VUE_APP_BASE_API + '/swagger/',
meta: { title: 'Swagger文档', icon: 'home', perms: ['dev_docs'] }
}
]
},
{
path: 'admin-link',
component: Layout,
children: [
{
path: process.env.VUE_APP_BASE_API + '/admin/',
meta: { title: 'Django后台', icon: 'home', perms: ['dev_admin'] }
}
]
}
]
},
{
path: '/testModel',
component: Layout,
redirect: '/testModel/faceLogin/',
name: 'testModel',
meta: { title: '测试模块', icon: 'home' },
children: [
{
path: 'faceLogin',
name: 'faceLogin',
component: () => import('@/views/testModel/faceLogin'),
meta: { title: '人脸识别登录', icon: 'home' }
},
{
path: 'caram',
name: 'caram',
component: () => import('@/views/testModel/caram'),
meta: { title: '相机调用', icon: 'home' }
},
{
path: 'markImage',
name: 'markImage',
component: () => import('@/views/testModel/markImage'),
meta: { title: '图片标记', icon: 'home' }
}
]
},
// 404 page must be placed at the end !!!
{ path: '*', redirect: '/404', hidden: true }
]
const createRouter = () => new Router({
// mode: 'history', // require service support
scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes
})
const router = createRouter()
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter() {
const newRouter = createRouter()
router.matcher = newRouter.matcher // reset router
}
export default router