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
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
| 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 <keep-alive> (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: 'mapPreview',
| name: 'mapPreview',
| component: () => import('@/container/mapPreview/index')
| },
| {
| path: 'mapPreviewDetail',
| name: 'mapPreviewDetail',
| component: () => import('@/container/mapPreviewDetail/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: 'machineList',
| name: 'machineList',
| component: () => import('@/container/machineList/index')
| },
| {
| path: 'preview',
| name: 'preview',
| component: () => import('@/container/preview/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
| })
|
|