routes.js
5.75 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
import layoutHeaderAside from '@/layout/header-aside'
// 由于懒加载页面太多的话会造成webpack热更新太慢,所以开发环境不使用懒加载,只有生产环境使用懒加载
const _import = require('@/libs/util.import.' + process.env.NODE_ENV)
/**
* 在主框架内显示(children 由后台返回资源点集合 从 resources 中动态过滤加载)
*/
const frameIn = [{
path: '/',
redirect: {
name: 'main'
},
component: layoutHeaderAside,
children: []
}]
/**
* 首页
* icon:element-ui
*/
export const home = {
path: '/index',
name: 'main',
icon: 's-home',
meta: {
title: '用户管理',
authId: '102',
parentId: '0',
cache: true
},
component: _import('consumerManage/index')
}
export const sys = [
// 系统 前端日志
// {
// path: '/log',
// name: 'log',
// meta: {
// title: '前端日志',
// },
// component: _import('system/log')
// },
// 刷新页面 必须保留
{
path: '/refresh',
name: 'refresh',
hidden: true,
component: _import('system/function/refresh')
},
// 页面重定向 必须保留
{
path: 'redirect/:route*',
name: 'redirect',
hidden: true,
component: _import('system/function/redirect')
}
]
/**
* 所有需动态过滤的资源点
*/
export const resources = {
'10201': {
path: '/consumerManage/index',
name: 'main',
meta: {
title: '供应链用户管理',
authId: '10201',
parentId: '102',
cache: true
},
component: _import('consumerManage/index'),
auth: []
},
'10202': {
path: '/consumerManage/factory',
name: 'fimsTable2',
meta: {
title: '工厂/仓库管理',
authId: '10202',
parentId: '102',
cache: true
},
component: _import('consumerManage/factory'),
auth: []
},
'103': {
path: '/deviceManage',
icon: 'document',
name: '设备管理',
meta: {
title: '设备管理',
authId: '103',
parentId: '0'
}
},
'10301': {
path: '/deviceManage/inventory',
name: 'fimsTable3',
meta: {
title: '设备库存管理',
authId: '10301',
parentId: '103',
cache: true
},
component: _import('deviceManage/deviceInventory'),
auth: []
},
'10302': {
path: '/deviceManage/firmware',
name: 'fimsTable4',
meta: {
title: '固件版本管理',
authId: '10302',
parentId: '103',
cache: true
},
component: _import('deviceManage/firmware'),
auth: []
},
'10303': {
path: '/deviceManage/deviceSetting',
name: 'fimsTable5',
meta: {
title: '设备配置管理',
authId: '10303',
parentId: '103',
cache: true
},
component: _import('deviceManage/deviceSetting'),
auth: []
},
'10304': {
path: '/materielManage/material',
name: 'fimsTable9',
meta: {
title: '物料管理',
authId: '10304',
parentId: '103',
cache: true
},
component: _import('materielManage/material'),
auth: []
},
'10305': {
path: '/deviceManage/outManage',
name: 'fimsTable6',
meta: {
title: 'GPS出库管理',
authId: '10305',
parentId: '103',
cache: true
},
component: _import('deviceManage/outManage'),
auth: []
},
'10306': {
path: '/equipment/exportExcelRecord',
name: 'exportExcelRecord',
meta: {
title: '下载excel',
authId: '10306',
parentId: '103',
cache: true
},
component: _import('equipment/exportExcelRecord'),
auth: []
},
'10307': {
path: '/equipment/initialize',
name: 'fimsTable10307',
meta: {
title: '批量初始化',
authId: '10307',
parentId: '103',
cache: true
},
component: _import('equipment/initialize'),
auth: []
},
'10308': {
path: '/orderManage/rules',
name: 'fimsTable10308',
meta: {
title: '设备分发规则',
authId: '10308',
parentId: '103',
cache: true
},
component: _import('orderManage/rules'),
auth: []
},
'104': {
path: '/orderManage',
icon: 'document',
name: '订单管理',
meta: {
title: '订单管理',
authId: '104',
parentId: '0'
}
},
'10401': {
path: '/orderManage/assignOrder',
name: 'fimsTable7',
meta: {
title: '分配订单',
authId: '10401',
parentId: '104',
cache: true
},
component: _import('orderManage/assignOrder'),
auth: []
},
'10402': {
path: '/orderManage/invoice',
name: 'fimsTable8',
meta: {
title: '发货单管理',
authId: '10402',
parentId: '104',
cache: true
},
component: _import('orderManage/invoice'),
auth: []
},
// '10403': {
// path: '/orderManage/rules',
// name: 'fimsTable10403',
// meta: {
// title: '设备分发规则',
// authId: '10403',
// parentId: '104',
// cache: true
// },
// component: _import('orderManage/rules'),
// auth: []
// },
// '10404': {
// path: '/orderManage/codeRules',
// name: 'fimsTable10404',
// meta: {
// title: '编码规则配置',
// authId: '10404',
// parentId: '104',
// cache: true
// },
// component: _import('orderManage/codeRules'),
// auth: []
// },
}
/**
* 在主框架之外显示
*/
const frameOut = [
// 登录
{
path: '/login',
name: 'login',
component: _import('system/login')
}
]
/**
* 错误页面
*/
export const errorPage = {
path: '*',
name: '404',
component: _import('system/error/404')
}
// 导出需要显示菜单的
export const frameInRoutes = frameIn
export const localRoutes = {
...resources, [home.meta.authId]: home
}
// 重新组织后导出
export default [
...frameOut,
errorPage
]