2025-04-23 11:19:06 +08:00
|
|
|
import {createRouter, createWebHashHistory} from 'vue-router'
|
2025-03-17 15:24:14 +08:00
|
|
|
import HomeView from '@/views/HomeView.vue'
|
|
|
|
|
import login from '@/views/login.vue'
|
2025-04-23 11:19:06 +08:00
|
|
|
import systemCenter from '@/views/SystemCenter.vue'
|
2025-03-17 15:24:14 +08:00
|
|
|
|
|
|
|
|
const routes = [
|
2025-04-23 11:19:06 +08:00
|
|
|
{
|
|
|
|
|
path: '/home',
|
|
|
|
|
name: 'home',
|
|
|
|
|
component: HomeView,
|
|
|
|
|
// redirect: '/stock',
|
|
|
|
|
children: [
|
|
|
|
|
{path: '/stock', component: () => import('@/layout/stock.vue')},// 库存
|
|
|
|
|
{path: '/goodsIn', component: () => import('@/layout/goodsIn.vue')},// 入库
|
|
|
|
|
{path: '/goodsOut', component: () => import('@/layout/goodsOut.vue')},// 出库
|
|
|
|
|
{path: '/kitting', component: () => import('@/layout/kitting.vue')},// 配料
|
|
|
|
|
{path: '/inTaskRecord', component: () => import('@/layout/inTaskRecord.vue')},// 入库记录
|
|
|
|
|
{path: '/outTaskRecord', component: () => import('@/layout/outTaskRecord.vue')},// 出库记录
|
|
|
|
|
{path: '/location', component: () => import('@/layout/locationsTable.vue')},// 库位
|
|
|
|
|
{path: '/goods', component: () => import('@/layout/goods.vue')},// 物料
|
|
|
|
|
{path: '/standSettings', component: () => import('@/layout/standSettings.vue')},// 站台(库口)设置
|
|
|
|
|
{path: '/config', component: () => import('@/layout/wmsConfigNew.vue')},// 系统配置
|
|
|
|
|
{path: '/taskMonitor', component: () => import('@/layout/taskMonitor.vue')},// 任务监控
|
|
|
|
|
{path: '/vehicles', component: () => import('@/layout/vehicle.vue')},// 料箱监控
|
|
|
|
|
{path: '/inventory', component: () => import('@/layout/inventory.vue')},// 盘点
|
|
|
|
|
{path: '/inventoryRecord', component: () => import('@/layout/inventoryRecord.vue')},// 盘点记录
|
|
|
|
|
{path: '/wmsLog', component: () => import('@/layout/wmsLog.vue')},// 日志
|
|
|
|
|
{path: '/workSummary', component: () => import('@/layout/workSummary.vue')},// 工作总结
|
|
|
|
|
{path: '/pickTask', component: () => import('@/layout/pickTaskMonitor.vue')},// 拣选任务
|
|
|
|
|
{path: '/outsMonitor', component: () => import('@/layout/OutsMonitor.vue')},// 任务表单
|
|
|
|
|
{path: '/clcKanban', component: () => import('@/layout/clcKanban.vue')},// 需求看板
|
|
|
|
|
{path: '/stockUpdateRecord', component: () => import('@/layout/stockUpdateRecord.vue')},// 库存更新记录
|
|
|
|
|
{path: '/roleUser', component: () => import('@/layout/role_user.vue')},// 角色——用户列表
|
|
|
|
|
{path: '/rolePermission', component: () => import('@/layout/role_permission.vue')},// 角色——权限列表
|
|
|
|
|
{path: '/test', component: () => import('@/layout/testView.vue')},// 测试
|
|
|
|
|
{path: '/dbsList', component: () => import('@/layout/dbsList.vue')},// dbs计划
|
|
|
|
|
{path: '/kittingList', component: () => import('@/layout/kittingList.vue')},// 配料单
|
|
|
|
|
{path: '/kittingRelation', component: () => import('@/layout/kittingRelation.vue')},// 对应关系
|
|
|
|
|
{path: '/imageTable', component: () => import('@/layout/ImageTable.vue')},
|
2025-06-13 08:47:58 +08:00
|
|
|
{path: '/equipment', component: () => import('@/layout/equipment.vue')},
|
2025-04-23 11:19:06 +08:00
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/',
|
|
|
|
|
name: 'login',
|
|
|
|
|
component: login
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/systemCenter',
|
|
|
|
|
name: 'systemCenter',
|
|
|
|
|
component: systemCenter
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/imageDisplay',
|
|
|
|
|
name: 'imageDisplay',
|
|
|
|
|
component: () => import('@/layout/imageDisplay.vue')
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/scanForImage',
|
|
|
|
|
name: 'scanForImage',
|
|
|
|
|
component: () => import('@/layout/scanForImage.vue')
|
|
|
|
|
}
|
2025-03-17 15:24:14 +08:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
const router = createRouter({
|
2025-04-23 11:19:06 +08:00
|
|
|
base: '/',
|
|
|
|
|
history: createWebHashHistory(),
|
|
|
|
|
routes
|
2025-03-17 15:24:14 +08:00
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// 挂载路由导航守卫
|
|
|
|
|
router.beforeEach((to, from, next) => {
|
2025-04-23 11:19:06 +08:00
|
|
|
if (to.path === '/') return next()
|
|
|
|
|
// 获取token
|
|
|
|
|
const user = sessionStorage.getItem('user')
|
|
|
|
|
if (!user) return next('/')
|
|
|
|
|
next()
|
2025-03-17 15:24:14 +08:00
|
|
|
})
|
|
|
|
|
|
|
|
|
|
export default router
|