index.js
3.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import Vue from 'vue';
import VueRouter from 'vue-router';
Vue.use(VueRouter);
const router = new VueRouter({
routes: [
{
path: '/',
redirect: '/list'
},
{
path: '/',
component: () => import('@/layout/index.vue'),
redirect: '/list',
children: [
{
//禁止修改命名list 其他地方用到
path: 'list',
component: () => import('@/views/defaultList.vue'),
name: 'list',
meta: { title: $gl("kanbanLsit") },
},
{
path: 'sorting',
component: () => import('@/views/sorting'),
name: 'sorting',
meta: { title: '长庆井下拣选看板P1019、P1022、P1025' },
},
{
path: 'sortingTwo',
component: () => import('@/views/sortingTwo'),
name: 'sortingTwo',
meta: { title: '长庆井下拣选看板P1028、P1031、P1034' },
},
{
path: 'sortingThree',
component: () => import('@/views/sortingThree'),
name: 'sortingThree',
meta: { title: '长庆井下拣选看板P1001、P1004、P1007' },
},
{
path: 'sortingFour',
component: () => import('@/views/sortingFour'),
name: 'sortingFour',
meta: { title: '长庆井下拣选看板P1010、P1013、P1016' },
},
// {
// path: 'sortingFour',
// component: () => import('@/views/sortingFour'),
// name: 'sortingFour',
// meta: { title: '长庆井下拣选看板P2002' },
// },
{
path: 'managePlatform_duanZi',
component: () => import('@/views/managePlatform_duanZi'),
name: 'managePlatform_duanZi',
meta: { title: '智能综合立库管理平台1' },
},
{
path: 'managePlatform_duanZi2',
component: () => import('@/views/managePlatform_duanZi2'),
name: 'managePlatform_duanZi2',
meta: { title: '智能综合立库管理平台2' },
},
// {
// path: 'dome',
// component: () => import('@/views/dome'),
// name: 'dome',
// meta: { title: 'dome' },
// },
],
},
]
})
var routerArr = router.options.routes;
var allRouter = null;
if (routerArr.length > 1) {
allRouter = allRouter = routerArr[1].children;
}
router.afterEach((to, from) => {
//console.log('后置路由守卫', to, from);
var path = from.path;
if (allRouter != null) {
for (let i = 0; i < allRouter.length; i++) {
var tempPath = "/" + allRouter[i].path;
if (path == tempPath) window.location.reload();
}
}
})
export default router;