loulijun2021
2022-06-26 0d86c19b122011dc528c624597b0952660d69aba
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
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
import Vue from 'vue'
import Router from 'vue-router'
 
Vue.use(Router)
 
/* Layout */
import Layout from '@/layout'
 
/**
 * Note: sub-menu only appear when route children.length >= 1
 * Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
 *
 * hidden: true                   if set true, item will not show in the sidebar(default is false)
 * alwaysShow: true               if set true, will always show the root menu
 *                                if not set alwaysShow, when item has more than one children route,
 *                                it will becomes nested mode, otherwise not show the root menu
 * redirect: noRedirect           if set noRedirect will no redirect in the breadcrumb
 * name:'router-name'             the name is used by <keep-alive> (must set!!!)
 * meta : {
    roles: ['admin','editor']    control the page roles (you can set multiple roles)
    title: 'title'               the name show in sidebar and breadcrumb (recommend set)
    icon: 'svg-name'/'el-icon-x' the icon show in the sidebar
    breadcrumb: false            if set false, the item will hidden in breadcrumb(default is true)
    activeMenu: '/example/list'  if set path, the sidebar will highlight the path you set
  }
 */
 
/**
 * constantRoutes
 * a base page that does not have permission requirements
 * all roles can be accessed
 */
export const commonRoutes = [
  {
    path: '/login',
    component: () => import('@/views/login/index'),
    hidden: true
  },
  {
    path: '/404',
    component: () => import('@/views/404'),
    hidden: true
  },
  {
    path: '/redirect',
    component: Layout,
    hidden: true,
    children: [
      {
        path: '/redirect/:path(.*)',
        component: () => import('@/views/redirect/index')
      }
    ]
  },
  {
    path: '/',
    component: Layout,
    redirect: '/index',
    name: '系统首页',
    children: [{
      path: 'index',
      name: 'index',
      component: () => import('@/views/xtsy/index'),
      meta: { title: '系统首页', icon: 'home', affix: true }
    }]
  }
  // { path: '*', redirect: '/404', hidden: true }
]
export const asyncRoutes = [
  {
    path: '/jcsz',
    component: Layout,
    redirect: '/jcsz/zzjg',
    name: '基础设置',
    code: '1001',
    meta: { title: '基础设置', icon: 'tree' },
    alwaysShow: true, // 当children只有一个时,也显示父菜单
    children: [
      {
        path: 'zzjg',
        name: '组织架构',
        code: '1010',
        component: () => import('@/views/jcsz/zzjg'),
        meta: { title: '组织架构', icon: '' }
      }, {
        path: 'yhqd',
        name: '用户清单',
        code: '1011',
        component: () => import('@/views/jcsz/yhqd'),
        meta: { title: '用户清单', icon: '' }
      }, {
        path: 'jsqd',
        name: '角色清单',
        code: '1012',
        component: () => import('@/views/jcsz/jsqd'),
        meta: { title: '角色清单', icon: '' }
      }, {
        path: 'wldw',
        name: '往来单位',
        code: '1013',
        component: () => import('@/views/jcsz/wldw'),
        meta: { title: '往来单位', icon: '' }
      }, {
        path: 'adsz',
        name: '安灯设置',
        code: '1014',
        component: () => import('@/views/jcsz/adsz'),
        meta: { title: '安灯设置', icon: '' }
      }
    ]
  },
  {
    path: '/sbgl',
    component: Layout,
    redirect: '/sbgl/sblx',
    name: '设备管理',
    code: '1002',
    meta: { title: '设备管理', icon: 'example' },
    alwaysShow: true,
    children: [
      {
        path: 'sblx',
        name: '设备类型',
        code: '1020',
        component: () => import('@/views/sbgl/sblx'),
        meta: { title: '设备类型', icon: '' }
      },
      {
        path: 'wxjl',
        code: '1029',
        name: '维修记录',
        component: () => import('@/views/sbgl/wxjl'),
        meta: { title: '维修记录', icon: '' }
      }, {
        path: 'sbz',
        name: '设备组',
        code: '1021',
        component: () => import('@/views/sbgl/sbz'),
        meta: { title: '设备组', icon: '' }
      }, {
        path: 'sbqd',
        name: '设备清单',
        code: '1022',
        component: () => import('@/views/sbgl/sbqd'),
        meta: { title: '设备清单', icon: '' }
      },
      {
        path: 'djbz',
        name: '点检标准',
        code: '1023',
        component: () => import('@/views/sbgl/djbz'),
        meta: { title: '点检标准', icon: '' }
      },
      {
        path: 'djbw',
        name: '点检部位',
        code: '1024',
        component: () => import('@/views/sbgl/djbw'),
        meta: { title: '点检部位', icon: '' }
      },
      {
        path: 'bybz',
        name: '保养标准',
        code: '1025',
        component: () => import('@/views/sbgl/bybz'),
        meta: { title: '保养标准', icon: '' }
      },
      {
        path: 'bybw',
        name: '保养部位',
        code: '1026',
        component: () => import('@/views/sbgl/bybw'),
        meta: { title: '保养部位', icon: '' }
      },
      {
        path: 'djjl',
        name: '点检记录',
        code: '1027',
        component: () => import('@/views/sbgl/djjl'),
        meta: { title: '点检记录', icon: '' }
      },
      {
        path: 'byjl',
        name: '保养记录',
        code: '1028',
        component: () => import('@/views/sbgl/byjl'),
        meta: { title: '保养记录', icon: '' }
      }
    ]
  },
  {
    path: '/gzgl',
    component: Layout,
    redirect: '/gzgl/gzlx',
    name: '工装管理',
    code: '1003',
    meta: { title: '工装管理', icon: 'component' },
    alwaysShow: true,
    children: [
      {
        path: 'gzlx',
        name: '工装类型',
        code: '1030',
        component: () => import('@/views/gzgl/gzlx'),
        meta: { title: '工装类型', icon: '' }
      }, {
        path: 'sjxj',
        name: '上机下机',
        code: '1039',
        component: () => import('@/views/gzgl/sjxj'),
        meta: { title: '上机下机', icon: '' }
      }, {
        path: 'ckrk',
        name: '出库入库',
        code: '1040',
        component: () => import('@/views/gzgl/ckrk'),
        meta: { title: '出库入库', icon: '' }
      }, {
        path: 'gzqd',
        name: '工装清单',
        code: '1031',
        component: () => import('@/views/gzgl/gzqd'),
        meta: { title: '工装清单', icon: '' }
      }, {
        path: 'djbz',
        name: '点检标准',
        code: '1032',
        component: () => import('@/views/gzgl/djbz'),
        meta: { title: '点检标准', icon: '' }
      }, {
        path: 'djbw',
        name: '点检部位',
        code: '1033',
        component: () => import('@/views/gzgl/djbw'),
        meta: { title: '点检部位', icon: '' }
      }, {
        path: 'bybz',
        name: '保养标准',
        code: '1034',
        component: () => import('@/views/gzgl/bybz'),
        meta: { title: '保养标准', icon: '' }
      }, {
        path: 'bybw',
        name: '保养部位',
        code: '1035',
        component: () => import('@/views/gzgl/bybw'),
        meta: { title: '保养部位', icon: '' }
      }, {
        path: 'djjl',
        name: '点检记录',
        code: '1036',
        component: () => import('@/views/gzgl/djjl'),
        meta: { title: '点检记录', icon: '' }
      }, {
        path: 'byjl',
        name: '保养记录',
        code: '1037',
        component: () => import('@/views/gzgl/byjl'),
        meta: { title: '保养记录', icon: '' }
      }, {
        path: 'gzwx',
        name: '工装维修',
        code: '1038',
        component: () => import('@/views/gzgl/gzwx'),
        meta: { title: '工装维修', icon: '' }
      }
    ]
  },
  {
    path: '/wlgl',
    component: Layout,
    redirect: '/wlgl/ckdy',
    name: '物料管理',
    code: '1004',
    meta: { title: '物料管理', icon: 'table' },
    alwaysShow: true,
    children: [
      {
        path: 'ckdy',
        name: '仓库定义',
        code: '1050',
        component: () => import('@/views/wlgl/ckdy'),
        meta: { title: '仓库定义', icon: '' }
      },
      {
        path: 'kwdy',
        name: '库位定义',
        code: '1051',
        component: () => import('@/views/wlgl/kwdy'),
        meta: { title: '库位定义', icon: '' }
      }, {
        path: 'rqlx',
        name: '容器类型',
        code: '1052',
        component: () => import('@/views/wlgl/rqlx'),
        meta: { title: '容器类型', icon: '' }
      }, {
        path: 'rqqd',
        name: '容器清单',
        code: '1053',
        component: () => import('@/views/wlgl/rqqd'),
        meta: { title: '容器清单', icon: '' }
      }, {
        path: 'crkjl',
        name: '出入库记录',
        code: '1054',
        component: () => import('@/views/wlgl/crkjl'),
        meta: { title: '出入库记录', icon: '' }
      }, {
        path: 'kccx',
        name: '库存查询',
        code: '1055',
        component: () => import('@/views/wlgl/kccx'),
        meta: { title: '库存查询', icon: '' }
      }
    ]
  },
  {
    path: '/zzmx',
    component: Layout,
    redirect: '/zzmx/gylx',
    name: '制造模型',
    code: '1005',
    meta: { title: '制造模型', icon: 'icu' },
    alwaysShow: true,
    children: [
      {
        path: 'wllx',
        name: '物料类型',
        code: '1060',
        component: () => import('@/views/zzmx/wllx'),
        meta: { title: '物料类型', icon: '' }
      },
      {
        path: 'chda',
        name: '存货档案',
        code: '1061',
        component: () => import('@/views/zzmx/chda'),
        meta: { title: '存货档案', icon: '' }
      }, {
        path: 'wlqd',
        name: '物料清单',
        code: '1062',
        component: () => import('@/views/zzmx/wlqd'),
        meta: { title: '物料清单', icon: '' }
      },
      {
        path: 'gylx',
        name: '工艺路线',
        code: '1063',
        component: () => import('@/views/zzmx/gylx'),
        meta: { title: '工艺路线', icon: '' }
      }, {
        path: 'gxdy',
        name: '工序定义',
        code: '1064',
        component: () => import('@/views/zzmx/gxdy'),
        meta: { title: '工序定义', icon: '' }
      },
      {
        path: 'jpgj',
        name: '节拍工价',
        code: '1065',
        component: () => import('@/views/zzmx/jpgj'),
        meta: { title: '节拍工价', icon: '' }
      }
    ]
  },
  {
    path: '/scgl',
    component: Layout,
    redirect: '/scgl/scdd',
    name: '生产管理',
    code: '1006',
    meta: { title: '生产管理', icon: 'production' },
    alwaysShow: true,
    children: [
      {
        path: 'scdd',
        name: 'ERP生产订单',
        code: '1070',
        component: () => import('@/views/scgl/scdd'),
        meta: { title: 'ERP生产订单', icon: '' }
      }, {
        path: 'gd',
        name: 'MES工单',
        code: '1071',
        component: () => import('@/views/scgl/gd'),
        meta: { title: 'MES工单', icon: '' }
      }, {
        path: 'gdpg',
        name: '工单派工',
        code: '1072',
        component: () => import('@/views/scgl/gdpg'),
        meta: { title: '工单派工', icon: '' }
      }, {
        path: 'sckbg',
        name: '生产开报工',
        code: '1073',
        component: () => import('@/views/scgl/sckbg'),
        meta: { title: '生产开报工', icon: '' }
      }
    ]
  },
  {
    path: '/zlgl',
    component: Layout,
    redirect: '/zlgl/zjbz',
    name: '质量管理',
    code: '1007',
    meta: { title: '质量管理', icon: 'quality' },
    alwaysShow: true,
    children: [
      {
        path: 'zjbz',
        name: '质检标准',
        code: '1080',
        component: () => import('@/views/zlgl/zjbz'),
        meta: { title: '质检标准', icon: '' }
      }, {
        path: 'qxdy',
        name: '缺陷定义',
        code: '1081',
        component: () => import('@/views/zlgl/qxdy'),
        meta: { title: '缺陷定义', icon: '' }
      }, {
        path: 'gxjy',
        name: '工序检验',
        code: '1082',
        component: () => import('@/views/zlgl/gxjy'),
        meta: { title: '工序检验', icon: '' }
      }, {
        path: 'wljy',
        name: '物流检验',
        code: '1083',
        component: () => import('@/views/zlgl/wljy'),
        meta: { title: '物流检验', icon: '' }
      }, {
        path: 'qxsj',
        name: '缺陷统计',
        code: '1084',
        component: () => import('@/views/zlgl/qxsj'),
        meta: { title: '缺陷统计', icon: '' }
      }
    ]
  },
  {
    path: '/xtsz',
    component: Layout,
    redirect: '/xtsz/bmgz',
    name: '系统设置',
    code: '1009',
    meta: { title: '系统设置', icon: 'xtsz' },
    alwaysShow: true,
    children: [
      {
        path: 'bmgz',
        name: '编码规则',
        code: '1101',
        component: () => import('@/views/xtsz/bmgz'),
        meta: { title: '编码规则', icon: '' }
      }, {
        path: 'mmxg',
        name: '密码修改',
        code: '1102',
        component: () => import('@/views/xtsz/mmxg'),
        meta: { title: '密码修改', icon: '' }
      }, {
        path: 'xtrz',
        name: '系统日志',
        code: '1103',
        component: () => import('@/views/xtsz/xtrz'),
        meta: { title: '系统日志', icon: '' }
      }, {
        path: 'sc',
        name: 'SOP上传',
        code: '1104',
        component: () => import('@/views/xtsz/sc'),
        meta: { title: 'SOP上传', icon: '' }
      }
    ]
  }
]
 
const createRouter = () => new Router({
  // mode: 'history', // require service support
  scrollBehavior: () => ({ y: 0 }),
  routes: commonRoutes
})
 
const router = createRouter()
 
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter() {
  const newRouter = createRouter()
  router.matcher = newRouter.matcher // reset router
}
 
export default router