routes.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481
  1. /* Layout */
  2. import Layout from '@/views/layout/layout'
  3. import LayoutInfo from '@/views/layout/layout-info'
  4. import LayoutDefault from '@/views/layout/layout-default'
  5. // import Main from '@/views/layout/app-main'
  6. // 由于懒加载页面太多的话会造成webpack热更新太慢,所以开发环境不使用懒加载,只有生产环境使用懒加载
  7. const _import = require('@/utils/util.import.' + process.env.NODE_ENV)
  8. /**
  9. * 在主框架内显示
  10. */
  11. const frameIn = [
  12. {
  13. path: '/',
  14. redirect: { name: 'dashboard' },
  15. component: Layout,
  16. children: [
  17. // 首页
  18. {
  19. path: 'dashboard',
  20. name: 'dashboard',
  21. meta: {
  22. title: '首页',
  23. auth: true
  24. },
  25. component: _import('/system/dashboard')
  26. },
  27. // 刷新页面 必须保留
  28. {
  29. path: 'refresh',
  30. name: 'refresh',
  31. hidden: true,
  32. component: _import('/system/function/refresh')
  33. },
  34. // 页面重定向 必须保留
  35. {
  36. path: 'redirect/:route*',
  37. name: 'redirect',
  38. hidden: true,
  39. component: _import('/system/function/redirect')
  40. }
  41. ]
  42. }
  43. ]
  44. /**
  45. * 在主框架之外显示
  46. */
  47. const frameOut = [
  48. // 登录
  49. {
  50. path: '/login',
  51. name: 'login',
  52. meta: {
  53. title: '登录'
  54. },
  55. component: _import('/system/login')
  56. },
  57. {
  58. path: '/fileView',
  59. name: 'fileView',
  60. meta: {
  61. title: '文件预览页'
  62. },
  63. component: _import('/viewFile')
  64. },
  65. {
  66. path: '/iframe',
  67. name: 'iframe',
  68. meta: {
  69. title: 'iframe'
  70. },
  71. component: _import('/system/iframe')
  72. }
  73. ]
  74. /**
  75. * 错误页面
  76. */
  77. const errorPage = [
  78. {
  79. path: '/404',
  80. name: 'error404',
  81. meta: {
  82. title: '404-页面不存在'
  83. },
  84. hidden: true,
  85. component: _import('/system/error/404')
  86. },
  87. {
  88. path: '/401',
  89. name: 'error401',
  90. meta: {
  91. title: '401- 未授权'
  92. },
  93. hidden: true,
  94. component: _import('/system/error/401')
  95. },
  96. {
  97. path: '/403',
  98. name: 'error403',
  99. meta: {
  100. title: '403-权限不足'
  101. },
  102. hidden: true,
  103. component: _import('/system/error/403')
  104. }
  105. // {
  106. // path: '/nomenu',
  107. // name: 'nomenu',
  108. // meta: {
  109. // title: '没有菜单资源'
  110. // },
  111. // hidden: true,
  112. // component: _import('/system/error/nomenu')
  113. // }
  114. ]
  115. // 自定义
  116. const frameCustom = [
  117. {
  118. path: '/next-menu',
  119. redirect: 'index',
  120. component: LayoutInfo,
  121. children: [
  122. {
  123. path: 'index',
  124. name: 'next-menu',
  125. meta: { title: '更多', icon: 'dashboard' },
  126. component: _import('/system/dashboard/next-menu')
  127. }
  128. ]
  129. },
  130. // {
  131. // path: '/message',
  132. // component: Layout,
  133. // redirect: 'index',
  134. // children: [
  135. // {
  136. // path: 'index',
  137. // name: 'message',
  138. // meta: { title: '消息', icon: 'message' },
  139. // component:_import('/message/index')
  140. // }, {
  141. // path: 'chat',
  142. // name: 'chat',
  143. // meta: { title: '聊天', icon: 'message' },
  144. // component:_import('/message/index')
  145. // }
  146. // ]
  147. // },
  148. {
  149. path: '/notice',
  150. component: Layout,
  151. redirect: 'index',
  152. children: [
  153. {
  154. path: 'index',
  155. name: 'notice',
  156. meta: { title: '公告', icon: 'notice' },
  157. component: _import('/platform/notice/index')
  158. }
  159. ]
  160. },
  161. {
  162. path: '/contacts',
  163. component: Layout,
  164. redirect: 'index',
  165. children: [
  166. {
  167. path: 'index',
  168. name: 'contacts',
  169. meta: { title: '通讯录', icon: 'contacts' },
  170. component: _import('/platform/contacts/index')
  171. }
  172. ]
  173. },
  174. {
  175. path: '/message/inner/receive',
  176. component: Layout,
  177. redirect: 'index',
  178. children: [
  179. {
  180. path: 'index',
  181. name: 'news',
  182. meta: { title: '我的消息', icon: 'news' },
  183. component: _import('/platform/message/inner/receive')
  184. }
  185. ]
  186. },
  187. {
  188. path: '/my',
  189. component: Layout,
  190. redirect: 'index',
  191. children: [
  192. {
  193. path: 'index',
  194. name: 'my',
  195. meta: { title: '我的', icon: 'my' },
  196. component: _import('/platform/my/index')
  197. },
  198. {
  199. path: 'userInfo',
  200. name: 'userInfo',
  201. meta: {
  202. title: '个人信息',
  203. icon: 'my',
  204. isLeftBar: true,
  205. isShowBar: false
  206. },
  207. component: _import('/platform/my/user-info')
  208. },
  209. {
  210. path: 'changePassword',
  211. name: 'changePassword',
  212. meta: {
  213. title: '修改密码',
  214. icon: 'my',
  215. isLeftBar: true,
  216. isShowBar: false
  217. },
  218. component: _import('/platform/my/change-password')
  219. },
  220. // {
  221. // path: 'setting',
  222. // name: 'setting',
  223. // meta: { title: '设置', icon: 'my', isLeftBar: true, isShowBar: false },
  224. // component:_import('/platform/my/setting')
  225. // },
  226. {
  227. path: 'help',
  228. name: 'help',
  229. meta: {
  230. title: '帮助',
  231. icon: 'help',
  232. isLeftBar: true,
  233. isShowBar: false
  234. },
  235. component: _import('/platform/my/help')
  236. },
  237. {
  238. path: 'aboutUs',
  239. name: 'aboutUs',
  240. meta: {
  241. title: '关于我们',
  242. icon: 'my',
  243. isLeftBar: true,
  244. isShowBar: false
  245. },
  246. component: _import('/platform/my/about-us')
  247. }
  248. ]
  249. },
  250. {
  251. path: '/bpmn',
  252. redirect: 'pending',
  253. component: LayoutDefault,
  254. children: [
  255. {
  256. path: 'pending/index',
  257. name: 'pending',
  258. meta: { title: '待办事宜' },
  259. component: _import('/platform/bpmn/pending/index')
  260. },
  261. {
  262. path: 'pending-matter/index',
  263. name: 'pendingMatter',
  264. meta: { title: '待办事宜' },
  265. component: _import('/platform/bpmn/pending-matter/index')
  266. },
  267. {
  268. path: 'completed/index',
  269. name: 'completed',
  270. meta: { title: '办结事宜' },
  271. component: _import('/platform/bpmn/completed/index')
  272. },
  273. {
  274. path: 'handled/index',
  275. name: 'handled',
  276. meta: { title: '已办事宜' },
  277. component: _import('/platform/bpmn/handled/index')
  278. },
  279. {
  280. path: 'myRequest/index',
  281. name: 'myRequest',
  282. meta: { title: '我的请求' },
  283. component: _import('/platform/bpmn/my-request/index')
  284. },
  285. {
  286. path: 'newProcess/index',
  287. name: 'newProcess',
  288. meta: { title: '新建流程' },
  289. component: _import('/platform/bpmn/new-process/index')
  290. },
  291. {
  292. path: 'myDraft/index',
  293. name: 'myDraft',
  294. meta: { title: '我的草稿' },
  295. component: _import('/platform/bpmn/my-draft/index')
  296. },
  297. {
  298. path: 'myRevoke/index',
  299. name: 'myRevoke',
  300. meta: { title: '可撤销事务' },
  301. component: _import('/platform/bpmn/my-revoke/index')
  302. },
  303. {
  304. path: 'uploadAttachment/index',
  305. name: 'uploadAttachment',
  306. meta: { title: '上传附件' },
  307. component: _import('/platform/bpmn/upload-attachment/index')
  308. },
  309. {
  310. path: 'myCompleted/index',
  311. name: 'myCompleted',
  312. meta: { title: '我结束的流程' },
  313. component: _import('/platform/bpmn/my-completed/index')
  314. },
  315. {
  316. path: 'taskChange/index',
  317. name: 'taskChange',
  318. meta: { title: '我的转办代理' },
  319. component: _import('/platform/bpmn/task-change/index')
  320. },
  321. {
  322. path: 'taskChangeDetail',
  323. name: 'taskChangeDetail',
  324. meta: { title: '详细信息' },
  325. component: _import('/platform/bpmn/task-change/detail')
  326. },
  327. {
  328. path: 'reminders/index',
  329. name: 'reminders',
  330. meta: { title: '催办事宜' },
  331. component: _import('/platform/bpmn/reminders/index')
  332. },
  333. // {
  334. // path: 'documents/documents',
  335. // name: 'documents',
  336. // meta: { title: '查阅文件' },
  337. // component: _import('/platform/bpmn/documents/documents')
  338. // },
  339. {
  340. path: 'memorandum/index',
  341. name: 'memorandum',
  342. meta: { title: '备忘录' },
  343. component: _import('/platform/bpmn/memorandum/index')
  344. },
  345. {
  346. path: 'documents/test',
  347. name: 'test',
  348. meta: { title: '查阅文件' },
  349. component: _import('/platform/bpmn/documents/test')
  350. },
  351. {
  352. path: 'myTest/index',
  353. name: 'myTest',
  354. meta: { title: '我的考试' },
  355. component: _import('/platform/bpmn/my-test/index')
  356. },
  357. {
  358. path: 'siginin/index',
  359. name: 'siginin',
  360. meta: { title: '签到' },
  361. component: _import('/platform/bpmn/siginin/index')
  362. },
  363. {
  364. path: 'siginin/outIndex',
  365. name: 'outSiginin',
  366. meta: { title: '签到' },
  367. component: _import('/platform/bpmn/siginin/outIndex')
  368. },
  369. {
  370. path: 'alienRegistration/index',
  371. name: 'alienRegistration',
  372. meta: { title: '外来人员登记' },
  373. component: _import('/platform/bpmn/alienRegistration/index')
  374. },
  375. {
  376. path: 'satisfactionV2/index',
  377. name: 'satisfactionV2',
  378. meta: { title: '满意度调查' },
  379. component: _import('/platform/bpmn/satisfactionV2/index')
  380. },
  381. {
  382. path: 'report/oralReport',
  383. name: 'oralReport',
  384. meta: { title: '口头报告查询' },
  385. component: _import('/platform/bpmn/report/oralReport')
  386. },
  387. {
  388. path: 'report/delayReport',
  389. name: 'delayReport',
  390. meta: { title: '延迟报告查询' },
  391. component: _import('/platform/bpmn/report/delayReport')
  392. },
  393. {
  394. path: 'addiInspect/index',
  395. name: 'addiInspect',
  396. meta: { title: '附加检验申请' },
  397. component: _import('/platform/bpmn/addiInspect/index')
  398. },
  399. {
  400. path: 'communication/communicationList',
  401. name: 'communicationList',
  402. meta: { title: '信息沟通' },
  403. component: _import('/platform/bpmn/communication/communicationList')
  404. },
  405. {
  406. path: 'complaint/complaintList',
  407. name: 'complaintList',
  408. meta: { title: '投诉列表' },
  409. component: _import('/platform/bpmn/complaint/complaintList')
  410. },
  411. {
  412. path: 'satisfaction/satisfaction',
  413. name: 'satisfaction',
  414. meta: { title: '满意度评价' },
  415. component: _import('/platform/bpmn/satisfaction/satisfaction')
  416. },
  417. {
  418. path: 'mySchedule/index',
  419. name: 'mySchedule',
  420. meta: { title: '我的排班' },
  421. component: _import('/platform/bpmn/my-schedule/index')
  422. },
  423. {
  424. path: 'shiftTransferApplication/staList',
  425. name: 'shiftTransferApplication',
  426. meta: { title: '调班申请' },
  427. component: _import('/platform/bpmn/shiftTransferApplication/staList')
  428. }
  429. ]
  430. },
  431. {
  432. path: '/message/inner/receive',
  433. component: _import('/platform/message/inner/receive'),
  434. name: 'messageInnerReceive',
  435. meta: { title: '我的消息' }
  436. },
  437. {
  438. path: '/d/list/:id(\\w+)',
  439. component: _import('/platform/data/template-list'),
  440. name: 'dataTemplateList',
  441. meta: { title: '模版' }
  442. },
  443. // {
  444. // path: '/d/form',
  445. // component:_import('/platform/data/template-form'),
  446. // name: 'dataTemplateform',
  447. // meta: { title: '表单明细' }
  448. // },
  449. {
  450. path: '/demo',
  451. component: LayoutInfo,
  452. redirect: 'form',
  453. children: [
  454. {
  455. path: 'form',
  456. name: 'demoForm',
  457. meta: { title: '表单Demo', icon: 'table' },
  458. component: _import('/demo/form')
  459. }
  460. // {
  461. // path: 'toolbar',
  462. // name: 'demoToolbar',
  463. // meta: { title: '工具栏', icon: 'toolbar' },
  464. // component:_import('/demo/toolbar')
  465. // }
  466. ]
  467. },
  468. { path: '*', redirect: '/404', hidden: true }
  469. ]
  470. // 导出需要显示菜单的
  471. export const frameInRoutes = frameIn
  472. // 重新组织后导出
  473. export default [...frameIn, ...frameOut, ...errorPage, ...frameCustom]