import Vue from 'vue' import Router from 'vue-router' // in development-env not use lazy-loading, because lazy-loading too many pages will cause webpack hot update too slow. so only in production use lazy-loading; // detail: https://panjiachen.github.io/vue-element-admin-site/#/lazy-loading Vue.use(Router) /* Layout */ import Layout from '../views/layout/Layout' /** * 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 redirct in the breadcrumb * name:'router-name' the name is used by (must set!!!) * meta : { title: 'title' the name show in submenu and breadcrumb (recommend set) icon: 'svg-name' the icon show in the sidebar, } **/ export const constantRouterMap = [ // 默认页面(登录) { path: '/', component: () => import('@/views/login/index'), hidden: true }, // { path: '/login', component: () => import('@/views/login/index'), hidden: true }, // 首页 { path: '/home', component: () => import('@/container/home/index'), children: [ { path: 'index', name: 'index', component: () => import('@/container/home/Welcome') }, { path: 'map', name: 'map', component: () => import('@/container/Map/index') }, { path: 'workshop/:id', name: 'workshop', component: () => import('@/container/workshop/index') }, // 设备维护 { path: 'maintenance/:style', name: 'maintenance', component: () => import('@/container/maintenance/index') }, // 工件信息 { path: 'component', name: 'component', component: () => import('@/container/component/index') }, // 台账 { path: 'ledger', name: 'ledger', component: () => import('@/container/ledger/index') }, // 设备类型管理 { path: 'deviceType', name: 'deviceType', component: () => import('@/container/deviceType/index') }, ] }, { path: '/dashboard', component: Layout, redirect: '/dashboard/index', // name: 'Dashboard', // hidden: true, children: [{ path: 'index', name: 'dashboard', component: () => import('@/views/dashboard/Home') }] }, {// 车间 path: '/workshop', component: Layout, redirect: 'noredirect', name: 'workshop', meta: { title: '车间列表', icon: 'classroom' }, children: [{ path: ':pid', // name: '', component: () => import('@/views/workshop/workshop'), meta: { title: '', icon: 'workshop' } } ] }, {// 车间大屏 path: '/workshoplist', component: Layout, redirect: 'noredirect', name: 'workshoplist', meta: { title: '车间大屏', icon: 'classroom' }, children: [{ path: ':pids', // name: '', component: () => import('@/views/workshop/workshoplist'), meta: { title: '', icon: 'workshop' } } ] }, {// 设备管理 path: '/device', component: Layout, redirect: 'noredirect', name: 'manage', meta: { title: '设备', icon: 'device' }, children: [{ path: ':did', // name: '', component: () => import('@/views/device/manage'), meta: { title: '', icon: 'device' } } ] }, {// 设备保养 path: '/deviceManage', component: Layout, redirect: 'noredirect', name: 'deviceManage', meta: { title: '设备保养', icon: 'alarm' }, children: [ { path: ':paths', component: () => import(`@/views/deviceManage/dailymaintain`), meta: { title: '', icon: 'alarm' } } ] }, {// 报表生成 path: '/report', component: Layout, redirect: 'noredirect', name: 'report', meta: { title: '报表生成', icon: 'alarm' }, children: [ { path: ':paths', component: () => import(`@/views/report/report`), meta: { title: '', icon: 'alarm' } } ] }, {// 19厂数据导入 path: '/import19', component: Layout, redirect: 'noredirect', name: 'import19', meta: { title: '19厂数据导入', icon: 'alarm' }, children: [ { path: ':index', component: () => import(`@/views/report/import19`), meta: { title: '', icon: 'alarm' } } ] }, {// 机床状态分布图 path: '/stateDistribution', component: Layout, redirect: 'noredirect', name: 'stateDistribution', meta: { title: '机床状态分布图', icon: 'alarm' }, children: [ { path: ':index', component: () => import(`@/views/nc/state-distribution`), meta: { title: '', icon: 'alarm' } } ] }, {// 当日状态分布图 path: '/dailyStateDistribution', component: Layout, redirect: 'noredirect', name: 'dailyStateDistribution', meta: { title: '当日状态分布图', icon: 'alarm' }, children: [ { path: ':index', component: () => import(`@/views/nc/daily-state-distribution`), meta: { title: '', icon: 'alarm' } } ] }, {// 2厂故障时间导入 path: '/importDownTime', component: Layout, redirect: 'noredirect', name: 'importDownTime', meta: { title: '故障时间导入', icon: 'alarm' }, children: [ { path: ':index', component: () => import(`@/views/report/importDownTime`), meta: { title: '', icon: 'alarm' } } ] }, {// 故障时间清零 path: '/clearDownTime', component: Layout, redirect: 'noredirect', name: 'clearDownTime', meta: { title: '故障时间清零', icon: 'alarm' }, children: [ { path: ':index', component: () => import(`@/views/report/clearDownTime`), meta: { title: '', icon: 'alarm' } } ] }, {// 制度时间输入 path: '/workDays', component: Layout, redirect: 'noredirect', name: 'workDays', meta: { title: '制度时间输入', icon: 'alarm' }, children: [ { path: ':index', component: () => import(`@/views/report/workDays`), meta: { title: '', icon: 'alarm' } } ] }, // 历史数据 { path: '/history-data', component: Layout, children: [ { path: 'index', name: 'history-data', component: () => import('@/views/history-data/HistoryData'), meta: { title: '历史数据', icon: 'history' } } ] }, // 今日数据 { path: '/current-data', component: Layout, children: [ { path: 'index', name: 'current-data', component: () => import('@/views/current-data/CurrentData'), meta: { title: '今日数据', icon: 'log' } } ] }, // 报警信息 { path: '/Alarm', component: Layout, children: [ { path: 'index', name: 'Alarm', component: () => import('@/views/alarm/Alarm'), meta: { title: '刀具预警', icon: 'alarm' } } ] }, // 车间地图 // { // path: '/tool', // component: Layout, // children: [ // { // path: 'index', // name: 'tool', // component: () => import('@/views/tool/machine-tool'), // meta: { title: '车间地图', icon: 'alarm' } // } // ] // }, { path: '/themap', component: Layout, children: [ { path: 'index', name: 'themap', component: () => import('@/views/tool/machine-tool'), meta: { title: '车间地图', icon: 'alarm' } } ] }, // 车间大屏 { path: '/screen', component: Layout, children: [ { path: 'index', name: 'screen', component: () => import('@/views/screen/machine-tool'), meta: { title: '车间大屏', icon: 'alarm' } } ] }, { path: '/status-monitor', component: Layout, children: [ { path: 'index', name: 'status-monitor', component: () => import('@/views/status-monitor/status-monitor'), meta: { title: '状态监控', icon: 'alarm' } } ] }, { path: '/status-monitor2', component: Layout, children: [ { path: 'index', name: 'status-monitor2', component: () => import('@/views/status-monitor2/status-monitor'), meta: { title: '状态监控2', icon: 'alarm' } } ] }, // 刀具信息 // { // path: '/tool-info', // component: Layout, // children: [ // { // path: 'index', // name: 'tool-info', // component: () => import('@/views/tool-info/ToolInfo'), // meta: { title: '刀具信息', icon: 'alarm' } // } // ] // }, // 用户权限控制 { path: '/perm', component: Layout, children: [ { path: 'ums', name: 'ums', component: () => import('@/views/perm/ums'), meta: { title: '用户管理', icon: '' } } ] }, // // 用户信息 // { // path: '/user', // component: Layout, // children: [ // { // path: 'user', // name: 'user', // component: () => import('@/views/user/userInfo'), // meta: { title: '个人中心', icon: '' } // } // ] // }, // 班次设置 { path: '/shift-config', component: Layout, children: [{ path: 'index', name: 'shift-config', component: () => import('@/views/shift-config/ShiftConfig'), meta: { title: '班次设置', icon: 'log' } }] }, { path: '/machine-types', component: Layout, children: [{ path: 'index', name: 'machine-types', component: () => import('@/views/machine-types/MachineTypes'), meta: { title: '机床类型', icon: 'log' } }] }, { path: '/component-info', component: Layout, children: [{ path: 'index', name: 'component-info', component: () => import('@/views/component-info/componentInfo'), meta: { title: '工件信息', icon: 'log' } }] }, // 报表 // { // path: '/report', // component: Layout, // children: [{ // path: 'index', // name: 'report', // component: () => import('@/views/report/Report'), // meta: { title: '报表生成', icon: 'log' } // }] // }, // 404 页面 { path: '/404', component: () => import('@/views/404') }, { path: '*', redirect: '/404', hidden: false } ] export default new Router({ mode: 'hash', base: '/', scrollBehavior: () => ({ y: 0 }), routes: constantRouterMap })