2024-07-02 08:16:55 +08:00
|
|
|
import { createRouter, createWebHashHistory } from 'vue-router'
|
|
|
|
|
import HomeView from '@/views/HomeView.vue'
|
|
|
|
|
import stock from '@/layout/stock.vue'
|
|
|
|
|
import login from '@/views/login.vue'
|
|
|
|
|
import systemCenter from'@/views/SystemCenter.vue'
|
|
|
|
|
|
|
|
|
|
const routes = [
|
|
|
|
|
{
|
|
|
|
|
path: '/home',
|
|
|
|
|
name: 'home',
|
|
|
|
|
component: HomeView,
|
|
|
|
|
redirect: '/stock',
|
|
|
|
|
children: [
|
|
|
|
|
{ path: '/stock', component: stock },// 库存
|
|
|
|
|
{ path: '/goodsIn', component: () => import('@/layout/goodsIn.vue') },// 入库
|
|
|
|
|
{ path: '/goodsOut', component: () => import('@/layout/goodsOut.vue') },// 出库
|
|
|
|
|
{ path: '/inTaskRecord', component: () => import('@/layout/inTaskRecord.vue') },// 入库记录
|
|
|
|
|
{ path: '/outTaskRecord', component: () => import('@/layout/outTaskRecord.vue') },// 出库记录
|
2024-08-04 23:06:03 +08:00
|
|
|
{ path: '/location', component: () => import('@/layout/locationsTable.vue') },// 库位
|
2024-07-02 08:16:55 +08:00
|
|
|
{ path: '/goods', component: () => import('@/layout/goods.vue') },// 物料
|
|
|
|
|
{ path: '/standSettings', component: () => import('@/layout/standSettings.vue') },// 站台(库口)设置
|
2024-08-04 23:06:03 +08:00
|
|
|
{ path: '/config', component: () => import('@/layout/wmsConfig.vue') },// 系统配置
|
2024-07-02 08:16:55 +08:00
|
|
|
{ path: '/taskMonitor', component: () => import('@/layout/taskMonitor.vue') },// 任务监控
|
2024-08-04 23:06:03 +08:00
|
|
|
{ path: '/vehicles', component: () => import('@/layout/vehicle.vue') },// 料箱监控
|
2024-07-02 08:16:55 +08:00
|
|
|
{ path: '/inventory', component: () => import('@/layout/inventory.vue') },// 盘点
|
2024-08-04 23:06:03 +08:00
|
|
|
{ path: '/inventoryRecord', component: () => import('@/layout/inventoryRecord.vue') },// 盘点记录
|
2024-07-02 08:16:55 +08:00
|
|
|
{ path: '/wmsLog', component: () => import('@/layout/wmsLog.vue') },// 日志
|
2024-07-25 16:59:14 +08:00
|
|
|
{ path: '/testDoKitting', component: () => import('@/layout/doKitting.vue') },// 备料执行
|
|
|
|
|
{ path: '/testFinishKitting', component: () => import('@/layout/finishKitting.vue') },// 备料完成
|
2024-08-07 23:12:42 +08:00
|
|
|
{ path: '/testCallEmptyVehicle', component: () => import('@/layout/callEmptyVehicle.vue') },// 呼叫空箱
|
|
|
|
|
{ path: '/testSortBoxs', component: () => import('@/layout/sortBoxs.vue') },// 整理盒子
|
2024-08-14 22:35:32 +08:00
|
|
|
{ path: '/uploadDbs', component: () => import('@/layout/dbsTable.vue') },// 上传DBS
|
|
|
|
|
{ path: '/uploadOrders', component: () => import('@/layout/kateOrdersTable.vue') },// 上传工单
|
2024-07-02 08:16:55 +08:00
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/',
|
|
|
|
|
name: 'login',
|
|
|
|
|
component: login
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/systemCenter',
|
|
|
|
|
name: 'systemCenter',
|
|
|
|
|
component: systemCenter
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
const router = createRouter({
|
|
|
|
|
base: '/',
|
|
|
|
|
history: createWebHashHistory(),
|
|
|
|
|
routes
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// 挂载路由导航守卫
|
|
|
|
|
router.beforeEach((to, from, next) => {
|
|
|
|
|
if (to.path === '/') return next()
|
|
|
|
|
// 获取token
|
|
|
|
|
const user = sessionStorage.getItem('user')
|
|
|
|
|
if (!user) return next('/')
|
|
|
|
|
next()
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
export default router
|