generator-platform-routers.js 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689
  1. // eslint-disable-next-line
  2. import * as loginService from '@/api/upms/login'
  3. // eslint-disable-next-line
  4. import { UserLayout, BasicLayout, BlankLayout, RouteView, PageView } from '@/layouts'
  5. import { GlobalConstant } from '@/constant'
  6. import BaseTool from '../utils/tool'
  7. // 前端路由表
  8. const constantRouterComponents = {
  9. // 基础页面 layout 必须引入
  10. 'UserLayout': UserLayout,
  11. 'BasicLayout': BasicLayout,
  12. 'BlankLayout': BlankLayout,
  13. 'RouteView': RouteView,
  14. 'PageView': PageView,
  15. '403': () => import(/* webpackChunkName: "error" */ '@/views/exception/403'),
  16. '404': () => import(/* webpackChunkName: "error" */ '@/views/exception/404'),
  17. '500': () => import(/* webpackChunkName: "error" */ '@/views/exception/500'),
  18. 'IndexView': () => import(/* webpackChunkName: "error" */ '@/views/index/Index'),
  19. // upms
  20. 'Dept': () => import('@/views/upms/dept/Dept'),
  21. 'User': () => import('@/views/upms/user/User'),
  22. 'Role': () => import('@/views/upms/role/Role'),
  23. 'Menu': () => import('@/views/upms/menu/Menu'),
  24. 'Dict': () => import('@/views/upms/dict/Dict'),
  25. 'Notice': () => import('@/views/upms/notice/SysNotice'),
  26. 'Log': () => import('@/views/upms/log/Log'),
  27. 'Task': () => import('@/views/upms/task/Task'),
  28. 'Config': () => import('@/views/upms/config/Config'),
  29. 'SysTeam': () => import('@/views/upms/team/SysTeam'),
  30. // result
  31. 'ResultSuccess': () => import(/* webpackChunkName: "result" */ '@/views/result/Success'),
  32. 'ResultFail': () => import(/* webpackChunkName: "result" */ '@/views/result/Error'),
  33. // exception
  34. 'Exception403': () => import(/* webpackChunkName: "fail" */ '@/views/exception/403'),
  35. 'Exception404': () => import(/* webpackChunkName: "fail" */ '@/views/exception/404'),
  36. 'Exception500': () => import(/* webpackChunkName: "fail" */ '@/views/exception/500'),
  37. // account
  38. 'AccountCenter': () => import('@/views/account/center/Index'),
  39. 'AccountSettings': () => import('@/views/account/settings/Index'),
  40. // 其他组件
  41. 'SystemRoleList': () => import('@/views/role/RoleList'),
  42. // 设备类型
  43. 'SbType': () => import('@/views/sb/type/SbType'),
  44. // 设备位置
  45. 'SbPosition': () => import('@/views/sb/position/SbPosition'),
  46. // 设备位置台账
  47. 'SbPositionCount': () => import('@/views/sb/count/SbPositionCount'),
  48. 'SbPositionNum': () => import('@/views/sb/position/SbPositionNum'),
  49. // 设备状态台账
  50. 'SbStatusCount': () => import('@/views/sb/count/SbStatusCount'),
  51. // 设备自定义类型台账
  52. 'SbUseTypeCount': () => import('@/views/sb/count/SbUseTypeCount'),
  53. // 设别规格
  54. 'SbGuige': () => import('@/views/sb/guige/SbGuige'),
  55. // 设别基础信息
  56. 'SbInfo': () => import('@/views/sb/info/SbInfo'),
  57. // 测量设备基础信息
  58. 'MeasureSbInfo': () => import('@/views/sb/info/MeasureSbInfo'),
  59. // 测量设备基础信息-需要检定-外部检定的
  60. 'MeasureSbInfoCheck': () => import('@/views/sb/info/MeasureSbInfoCheck'),
  61. // 测量设备基础信息-需要检定-自检的
  62. 'MeasureSbInfoCheckSelf': () => import('@/views/sb/info/MeasureSbInfoCheckSelf'),
  63. // 测量设备基础信息-不需要检定的
  64. 'MeasureSbInfoNotCheck': () => import('@/views/sb/info/MeasureSbInfoNotCheck'),
  65. // 测量设备预警台账
  66. 'MeasureSbInfoWarn': () => import('@/views/sb/info/MeasureSbInfoWarn'),
  67. // 测量设备基础信息-在库
  68. 'MeasureSbInfoInStore': () => import('@/views/sb/info/MeasureSbInfoInStore'),
  69. // 测量设备-检定记录
  70. 'MeasureLog': () => import('@/views/sb/measurelog/MeasureLog'),
  71. // 特种设备-检定记录
  72. 'MeasureLogSpecial': () => import('@/views/sb/measurelog/MeasureLogSpecial'),
  73. // 特种设备基础信息
  74. 'SpecialSbInfo': () => import('@/views/sb/info/SpecialSbInfo'),
  75. // 特种设备预警
  76. 'SpecialSbInfoWarn': () => import('@/views/sb/info/SpecialSbInfoWarn'),
  77. // 特种设备在库
  78. 'SpecialSbInfoInStore': () => import('@/views/sb/info/SpecialSbInfoInStore'),
  79. // 父子设备树
  80. 'ParentSbInfo': () => import('@/views/sb/info/ParentSbInfo'),
  81. // 设别型号库
  82. 'SbModel': () => import('@/views/sb/model/SbModel'),
  83. // 设备bom
  84. 'SbModelBom': () => import('@/views/sb/modelbom/SbModelBom'),
  85. // 设备型号筛选对应的备件bom
  86. 'SbModelSpareListBom': () => import('@/views/sb/modelbom/SbModelSpareListBom'),
  87. // 设备树
  88. 'SbInfoTree': () => import('@/views/sb/info/SbInfoTree'),
  89. // 部位类别
  90. 'PartType': () => import('@/views/part/type/PartType'),
  91. // 部位信息
  92. 'PartInfo': () => import('@/views/part/info/PartInfo'),
  93. // 设备部位信息
  94. 'SbInfoForPartInfo': () => import('@/views/sb/info/SbInfoForPartInfo'),
  95. // 位号信息
  96. 'Location': () => import('@/views/sb/location/Location'),
  97. // 设备位号信息
  98. 'SbInfoForLocation': () => import('@/views/sb/info/SbInfoForLocation'),
  99. // 备件类别
  100. 'SpareType': () => import('@/views/sqarepartmanage/sparetype/SpareType'),
  101. // 备件基础信息和报表
  102. 'SparePartInfo': () => import('@/views/sqarepartmanage/sparepartinfo/SparePartInfo'),
  103. 'SparePartInfoPrint': () => import('@/views/sqarepartmanage/sparepartinfo/SparePartInfoPrint'),
  104. 'SparePartMonthReport': () => import('@/views/sqarepartmanage/report/SparePartMonthReport'),
  105. // 备件库存汇总、备件库存汇总预警、备件保养预警(已废弃,改成备件更换预警)
  106. 'SparePartTotal': () => import('@/views/sqarepartmanage/sparepartinfo/SparePartTotal'),
  107. 'SparePartTotalMinStock': () => import('@/views/sqarepartmanage/sparepartinfo/SparePartTotalMinStock'),
  108. 'SparePartTotalCheckStock': () => import('@/views/sqarepartmanage/sparepartinfo/SparePartTotalCheckStock'),
  109. 'SpareUpdateAlert': () => import('@/views/sqarepartmanage/sparepartinfo/SpareUpdateAlert'),
  110. // 仓库汇总、仓库备件库存汇总(单个仓库的)
  111. 'SpareStoreTotal': () => import('@/views/store/sparestore/SpareStoreTotal'),
  112. 'SpareStoreTotalMinStock': () => import('@/views/store/sparestore/SpareStoreTotalMinStock'),
  113. // 备件使用信息
  114. 'SparePartUsed': () => import('@/views/sqarepartmanage/sparepartused/SparePartUsed'),
  115. 'SbInfoStopDetail': () => import('@/views/sb/stop-detail/SbInfoStopDetail'),
  116. // 点检
  117. 'SpotCheckStandard': () => import('@/views/check/checkstandard/SpotCheckStandard'),
  118. 'SpotCheckProject': () => import('@/views/check/checkproject/SpotCheckProject'),
  119. 'SpotCheckPlan': () => import('@/views/check/checkplan/SpotCheckPlan'),
  120. 'SpotCheckJobOverTime': () => import('@/views/check/checkjob/SpotCheckJobOverTime'),
  121. 'SpotCheckJob': () => import('@/views/check/checkjob/SpotCheckJob'),
  122. 'SpotCheckJobFinish': () => import('@/views/check/checkjob/SpotCheckJobFinish'),
  123. // 保养
  124. 'PollingCheckStandard': () => import('@/views/check/checkstandard/PollingCheckStandard'),
  125. 'PollingCheckProject': () => import('@/views/check/checkproject/PollingCheckProject'),
  126. 'PollingCheckPlan': () => import('@/views/check/checkplan/PollingCheckPlan'),
  127. 'PollingCheckJob': () => import('@/views/check/checkjob/PollingCheckJob'),
  128. 'PollingCheckJobOverTime': () => import('@/views/check/checkjob/PollingCheckJobOverTime'),
  129. 'PollingCheckJobFinish': () => import('@/views/check/checkjob/PollingCheckJobFinish'),
  130. // 润滑
  131. 'RunCheckStandard': () => import('@/views/check/checkstandard/RunCheckStandard'),
  132. 'RunCheckProject': () => import('@/views/check/checkproject/RunCheckProject'),
  133. 'RunCheckPlan': () => import('@/views/check/checkplan/RunCheckPlan'),
  134. 'RunCheckJob': () => import('@/views/check/checkjob/RunCheckJob'),
  135. 'RunCheckJobOverTime': () => import('@/views/check/checkjob/RunCheckJobOverTime'),
  136. 'RunCheckJobFinish': () => import('@/views/check/checkjob/RunCheckJobFinish'),
  137. // 工器具校准
  138. 'AdjustCheckStandard': () => import('@/views/check/checkstandard/AdjustCheckStandard'),
  139. 'AdjustCheckProject': () => import('@/views/check/checkproject/AdjustCheckProject'),
  140. 'AdjustCheckPlan': () => import('@/views/check/checkplan/AdjustCheckPlan'),
  141. 'AdjustCheckJob': () => import('@/views/check/checkjob/AdjustCheckJob'),
  142. // 特种设备定期检验
  143. 'SpecialCheckStandard': () => import('@/views/check/checkstandard/SpecialCheckStandard'),
  144. 'SpecialCheckProject': () => import('@/views/check/checkproject/SpecialCheckProject'),
  145. 'SpecialCheckPlan': () => import('@/views/check/checkplan/SpecialCheckPlan'),
  146. 'SpecialCheckJob': () => import('@/views/check/checkjob/SpecialCheckJob'),
  147. // 仓库信息
  148. 'Store': () => import('@/views/store/store/Store'),
  149. // 备件库存
  150. 'SpareStore': () => import('@/views/store/sparestore/SpareStore'),
  151. 'PurchaseStoreForm': () => import('@/views/store/purchaseform/PurchaseStoreForm'),
  152. // 备件二级库存
  153. 'SpareStoreSecond': () => import('@/views/store/sparestoresecond/SpareStoreSecond'),
  154. // 入库登记单
  155. 'InStoreForm': () => import('@/views/store/instoreform/InStoreForm'),
  156. // 出库登记单
  157. 'OutStoreForm': () => import('@/views/store/outstoreform/OutStoreForm'), // 出库
  158. 'OutStoreFormYY': () => import('@/views/store/outstoreform/OutStoreFormYY'), // 用友出库
  159. 'OutStoreFormBackYY': () => import('@/views/store/outstoreform/OutStoreFormBackYY'), // 用友退库
  160. // 调拨登记单
  161. 'TransferStoreForm': () => import('@/views/store/transferstoreform/TransferStoreForm'),
  162. // 备件领用详情
  163. 'SparePickDetail': () => import('@/views/store/sparepickdetail/SparePickDetail'),
  164. // 备件领用登记单
  165. 'SparePickForm': () => import('@/views/store/sparepickform/SparePickForm'),
  166. // 备件回收详情
  167. 'SpareRecoveryDetail': () => import('@/views/store/sparerecoverydetail/SpareRecoveryDetail'),
  168. // 备件回收登记单
  169. 'SpareRecoveryForm': () => import('@/views/store/sparerecoveryform/SpareRecoveryForm'),
  170. // 备件退库详情
  171. 'SpareRestoreDetail': () => import('@/views/store/sparerestoredetail/SpareRestoreDetail'),
  172. // 备件退库登记单
  173. 'SpareRestoreForm': () => import('@/views/store/sparerestoreform/SpareRestoreForm'),
  174. // 备件退货详情
  175. 'SpareBackDetail': () => import('@/views/store/sparebackdetail/SpareBackDetail'),
  176. // 备件退货登记单
  177. 'SpareBackForm': () => import('@/views/store/sparebackform/SpareBackForm'),
  178. // 入库详情
  179. 'InStoreDetail': () => import('@/views/store/instoredetail/InStoreDetail'),
  180. // 出库详情
  181. 'OutStoreDetail': () => import('@/views/store/outstoredetail/OutStoreDetail'),
  182. // 调拨详情
  183. 'TransferStoreDetail': () => import('@/views/store/transferstoredetail/TransferStoreDetail'),
  184. // 报修单
  185. 'RepairApplicationForm': () => import('@/views/repair/application-form/RepairApplicationForm'),
  186. 'RepairOut': () => import('@/views/repair/application-form/RepairOut'),
  187. // 验收单
  188. 'RepairCheckForm': () => import('@/views/repair/application-form/RepairCheckForm'),
  189. // 维修单
  190. 'RepairForm': () => import('@/views/repair/application-form/RepairForm'),
  191. 'RepairCloseForm': () => import('@/views/repair/application-form/RepairCloseForm'),
  192. 'MRepairForm': () => import('@/views/repair/application-form/MyRepairForm'),
  193. 'MyRepairForm': () => import('@/views/repair/form/MyRepairForm'),
  194. 'WaitRepairForm': () => import('@/views/repair/application-form/WaitRepairForm'),
  195. 'RepairCallerCheckForm': () => import('@/views/repair/application-form/RepairCallerCheckForm'),
  196. 'RepairManagerCheckForm': () => import('@/views/repair/application-form/RepairManagerCheckForm'),
  197. 'WaitAllocatedRepairForm': () => import('@/views/repair/application-form/WaitAllocatedRepairForm'),
  198. 'WaitDispatchRepairForm': () => import('@/views/repair/application-form/WaitDispatchRepairForm'),
  199. 'ReportRepairForm': () => import('@/views/repair/application-form/ReportRepairForm'),
  200. // 验收单
  201. 'RepairCheck': () => import('@/views/repair/check/RepairCheck'),
  202. // 故障类别
  203. 'ErrorType': () => import('@/views/repair/errortype/ErrorType'),
  204. // 维修费用单
  205. 'RepairFee': () => import('@/views/repair/fee/RepairFee'),
  206. // 维修项目
  207. 'RepairProject': () => import('@/views/repair/repairproject/RepairProject'),
  208. 'RepairReason': () => import('@/views/repair/repair-reason/RepairReason'),
  209. // 生产商
  210. 'FirmProducer': () => import('@/views/firm/producer/FirmProducer'),
  211. // 巡检管理
  212. 'FillInfo': () => import('@/views/fill/info/FillInfo'),
  213. 'FillGather': () => import('@/views/fill/gather/FillGather'),
  214. 'FillGatherTask': () => import('@/views/fill/task/FillGatherTask'),
  215. 'BackFillGatherTask': () => import('@/views/fill/task/BackFillGatherTask'),
  216. 'VerifyFillGatherTask': () => import('@/views/fill/task/VerifyFillGatherTask'),
  217. 'SbInspectionFill': () => import('@/views/sb/inspection-fill/SbInspectionFill'),
  218. 'MySbInspectionFill': () => import('@/views/sb/inspection-fill/MySbInspectionFill'),
  219. 'ZGSbInspectionFill': () => import('@/views/sb/inspection-fill/ZGSbInspectionFill'),
  220. 'AdminSbInspectionFill': () => import('@/views/sb/inspection-fill/AdminSbInspectionFill'),
  221. 'SbRunFill': () => import('@/views/sb/run-fill/SbRunFill'),
  222. 'ZGSbRunFill': () => import('@/views/sb/run-fill/ZGSbRunFill'),
  223. 'MySbRunFill': () => import('@/views/sb/run-fill/MySbRunFill'),
  224. 'AdminSbRunFill': () => import('@/views/sb/run-fill/AdminSbRunFill'),
  225. // 仓库月报表
  226. 'StoreMonthReport': () => import('@/views/report/store/StoreMonthReport'),
  227. // 出入库明细+汇总
  228. 'ReportInStoreDetail': () => import('@/views/report/instoredetail/InStoreDetail'),
  229. 'MyReportInStoreDetail': () => import('@/views/report/instoredetail/MyInStoreDetail'),
  230. 'ReportOutStoreDetail': () => import('@/views/report/outstoredetail/OutStoreDetail'),
  231. 'MyReportOutStoreDetail': () => import('@/views/report/outstoredetail/MyOutStoreDetail'),
  232. 'ReportInStoreCount': () => import('@/views/report/instorecount/InStoreCount'),
  233. 'ReportOutStoreCount': () => import('@/views/report/outstorecount/OutStoreCount'),
  234. 'ReportSparePartInfo': () => import('@/views/report/sparepartinfo/SparePartInfo'),
  235. 'ReportSparePickDetail': () => import('@/views/report/sparepickdetail/SparePickDetail'),
  236. 'MyReportSparePickDetail': () => import('@/views/report/sparepickdetail/MySparePickDetail'),
  237. 'ReportSparePickCount': () => import('@/views/report/sparepickcount/SparePickCount'),
  238. 'StatisticsRepairFormSb': () => import('@/views/statistics/repair/StatisticsRepairFormSb'),
  239. 'StatisticsRepairFormMonth': () => import('@/views/statistics/repair/StatisticsRepairFormMonthView'),
  240. 'StatisticsRepairFormErrorType': () => import('@/views/statistics/repair/StatisticsRepairFormErrorTypeView'),
  241. 'StatisticsSparePartUsedSpare': () => import('@/views/statistics/spare/StatisticsSparePartUsedSpare'),
  242. 'StatisticsRepairFormUser': () => import('@/views/statistics/repair/StatisticsRepairFormUserView'),
  243. 'WorkplaceBacklog': () => import('@/views/workplace/backlog/WorkplaceBacklog'),
  244. 'StoreWorkplaceBacklog': () => import('@/views/workplace/backlog/StoreWorkplaceBacklog'),
  245. 'SbWorkplaceBacklog': () => import('@/views/workplace/backlog/SbWorkplaceBacklog'),
  246. 'NewWorkplaceBacklog': () => import('@/views/workplace/backlog/NewWorkplaceBacklog'),
  247. 'Supplier': () => import('@/views/purchase/supplier/Supplier'),
  248. 'SupplierApply': () => import('@/views/purchase/supplier/SupplierApply'),
  249. 'PurchaseDemandPlan': () => import('@/views/purchase/purchase-demand-plan/PurchaseDemandPlan'),
  250. 'PurchasePlan': () => import('@/views/purchase/purchase-plan/PurchasePlan'),
  251. 'PurchasePayment': () => import('@/views/purchase/purchase-payment/PurchasePaymentPage'),
  252. 'PurchaseReimburse': () => import('@/views/purchase/purchase-reimburse/PurchaseReimbursePage'),
  253. 'PurchaseOrder': () => import('@/views/purchase/purchase-order/PurchaseOrder'),
  254. 'PurchaseApply': () => import('@/views/purchase/purchase-apply/PurchaseApply'),
  255. 'PurchaseDispatchOrderPage': () => import('@/views/purchase/purchase-dispatch-order/PurchaseDispatchOrderPage'),
  256. // 审批
  257. 'Model': () => import('@/views/activiti/model/Model'),
  258. 'Flow': () => import('@/views/activiti/flow/Flow'),
  259. 'MyTask': () => import('@/views/activiti/task/MyTask'), // 我的待办
  260. 'MyTaskFinish': () => import('@/views/activiti/task/MyTaskFinish'), // 我的已办
  261. 'MyTaskClaim': () => import('@/views/activiti/task/MyTaskClaim'), // 我的签收
  262. 'MyStart': () => import('@/views/activiti/task/MyStart'), // 我的申请
  263. 'ActivitiUserModel': () => import('@/views/activiti/user-model/ActivitiUserModel'), // 流程审批节点设置
  264. 'DesignForm': () => import('@/views/design/designForm/DesignForm'),
  265. // 隐患管理
  266. 'HiddenDanger': () => import('@/views/hidden/hidden/HiddenDanger'), // 隐患任务
  267. // 调拨申请
  268. 'SbAllocateApply': () => import('@/views/sb/allocate-apply/ProjectSbAllocateApply'),
  269. 'GroupToProjectSbAllocateApply': () => import('@/views/sb/allocate-apply/GroupToProjectSbAllocateApply'),
  270. 'ProjectToProjectSbAllocateApply': () => import('@/views/sb/allocate-apply/ProjectToProjectSbAllocateApply'),
  271. 'MySbAllocateApply': () => import('@/views/sb/allocate-apply/MySbAllocateApply'),
  272. 'ZGSbAllocateApply': () => import('@/views/sb/allocate-apply/ZGSbAllocateApply'),
  273. 'XmbZgSbAllocateApply': () => import('@/views/sb/allocate-apply/XmbZgSbAllocateApply'),
  274. 'FgsZgSbAllocateApply': () => import('@/views/sb/allocate-apply/FgsZgSbAllocateApply'),
  275. // 调拨审批
  276. 'SbAllocateTaskAudit': () => import('@/views/sb/allocate-task/SbAllocateTaskAudit'),
  277. // 我的功能
  278. 'ProjectStore': () => import('@/views/store/store/ProjectStore'),
  279. 'CompanyStore': () => import('@/views/store/store/CompanyStore'),
  280. 'MyStore': () => import('@/views/store/store/MyStore'),
  281. 'MyInStoreForm': () => import('@/views/store/instoreform/MyInStoreForm'),
  282. 'MyOutStoreForm': () => import('@/views/store/outstoreform/MyOutStoreForm'),
  283. 'MyTransferStoreForm': () => import('@/views/store/transferstoreform/MyTransferStoreForm'),
  284. 'MySparePickForm': () => import('@/views/store/sparepickform/MySparePickForm'),
  285. 'MySbInfo': () => import('@/views/sb/info/MySbInfo'),
  286. 'ProjectSbInfo': () => import('@/views/sb/info/ProjectSbInfo'),
  287. 'BanzuSbInfo': () => import('@/views/sb/info/BanzuSbInfo'),
  288. 'CompanySbInfo': () => import('@/views/sb/info/CompanySbInfo'),
  289. 'MySpareStore': () => import('@/views/store/sparestore/MySpareStore'),
  290. 'MySpareStoreTotal': () => import('@/views/store/sparestore/MySpareStoreTotal'),
  291. 'MyRunCheckJob': () => import('@/views/check/checkjob/MyRunCheckJob'),
  292. 'MyPollingCheckJob': () => import('@/views/check/checkjob/MyPollingCheckJob'),
  293. 'MyPollingCheckJobFinish': () => import('@/views/check/checkjob/MyPollingCheckJobFinish'),
  294. 'MyPollingCheckJobOverTime': () => import('@/views/check/checkjob/MyPollingCheckJobOverTime'),
  295. 'MySpotCheckJob': () => import('@/views/check/checkjob/MySpotCheckJob'),
  296. // 验收单
  297. 'SbCheckForm': () => import('@/views/sb/sbcheckform/SbCheckForm'),
  298. 'FillProjectQuantity': () => import('@/views/fill/project-quantity/FillProjectQuantity'),
  299. 'SbCheckDetail': () => import('@/views/sb/sbcheckdetail/SbCheckDetail'),
  300. 'Article': () => import('@/views/operate/article/Article'),
  301. // 设备变动
  302. 'SbScrapForm': () => import('@/views/sb/scraps/SbScrapForm'), // 报废单
  303. // 设备变动记录
  304. 'SbChangeRecord': () => import('@/views/sb/change-record/SbChangeRecord'), // 设备变动记录
  305. // 备件盘点
  306. 'StoreCheckPlan': () => import('@/views/store/storecheckplan/StoreCheckPlan'),
  307. 'StoreCheckJob': () => import('@/views/store/storecheckjob/StoreCheckJob'),
  308. // 设备盘点
  309. 'SbStoreCheckPlan': () => import('@/views/sb/storecheckplan/StoreCheckPlan'),
  310. 'SbStoreCheckJob': () => import('@/views/sb/storecheckjob/StoreCheckJob'),
  311. // 保养任务日程表
  312. 'CheckJobCalendar': () => import('@/views/check/checkjob/CheckJobCalendar'),
  313. // 设备状态变更表
  314. 'SbStatusLog': () => import('@/views/sb/status-log/SbStatusLog'),
  315. // 设备停机记录表
  316. 'SbStopLog': () => import('@/views/sb/stop-logs/SbStopLog'),
  317. // 设备安装调试过程记录
  318. 'SbInfoDebug': () => import('@/views/sb/info/SbInfoDebug'),
  319. // 设备试车过程记录
  320. 'SbInfoTestRun': () => import('@/views/sb/info/SbInfoTestRun'),
  321. // 设备报废
  322. 'SbInfoScrap': () => import('@/views/sb/scrap/SbInfoScrap'),
  323. // 设备维护标准
  324. 'SbInfoStandard': () => import('@/views/sb/info/SbInfoStandard'),
  325. // 报表
  326. 'AnalysisSbInfo': () => import('@/views/dashboard/AnalysisSbInfo'), // 保养任务完成率报表
  327. 'CheckJobReport': () => import('@/views/dashboard/CheckJobReport'), // 保养任务完成率报表
  328. 'MeasureLogReport': () => import('@/views/dashboard/MeasureLogReport'), // 检定记录月完成数量报表
  329. 'SbInfoTypeReport': () => import('@/views/dashboard/SbInfoTypeReport'), // 设备类型占比统计
  330. 'CheckJobReportWeek': () => import('@/views/dashboard/CheckJobReportWeek'), // 保养任务周工作负荷统计报表
  331. 'RepairReport': () => import('@/views/dashboard/RepairReport'), // >24小时停机次数按月统计
  332. 'RepairReportSbAll': () => import('@/views/dashboard/RepairReportSbAll'), // 设备故障次数按月统计
  333. 'RepairReportSbInfo': () => import('@/views/dashboard/RepairReportSbInfo'), // 设备维修报表
  334. 'RepairReportSbInfoFee': () => import('@/views/dashboard/RepairReportSbInfoFee'), // 设备维修费用报表
  335. 'RepairReportMttr': () => import('@/views/dashboard/RepairReportMttr'), // MTTR月统计报表
  336. 'RepairReportFee': () => import('@/views/dashboard/RepairReportFee'), // 费用按月统计
  337. 'StoreReport1': () => import('@/views/dashboard/StoreReport1'), // 仓库报表
  338. 'RepairScreen': () => import('@/views/big-screen/RepairScreen'), // 车间大屏
  339. // 工作台
  340. 'SbInfoWorkplaceBacklog': () => import('@/views/workplace/backlog/SbInfoWorkplaceBacklog'), // 设备工作台
  341. // 自定义管理
  342. 'CustomizeReport': () => import('@/views/customize/report/CustomizeReport'), // 自定义报表
  343. 'CustomFieldTemplate': () => import('@/views/customize/fieldTemplate/CustomFieldTemplate'), // 自定义模板
  344. 'CustomFieldTemplateData': () => import('@/views/customize/fieldTemplateData/CustomFieldTemplateData'), // 自定义模板数据
  345. // 新增路由
  346. 'SparePartUsedSelectTable': () => import('@/views/sqarepartmanage/sparepartused/modules/SparePartUsedSelectTable'), // 备件使用记录
  347. // 电度和遥测数据
  348. 'RemoteMeasure': () => import('@/views/remote/measure/RemoteMeasure'),
  349. 'RemoteMeasureLog': () => import('@/views/remote/measure-log/RemoteMeasureLog'),
  350. 'RemoteDegree': () => import('@/views/remote/degree/RemoteDegree'),
  351. 'RemoteDegreeLog': () => import('@/views/remote/degree-log/RemoteDegreeLog'),
  352. // opc
  353. 'RemoteOpc': () => import('@/views/remote/opc/RemoteOpc'), // 模拟+数字量+创建+未创建(全部的)
  354. 'RemoteOpcNotCreated': () => import('@/views/remote/opc/RemoteOpcNotCreated'), // 服务端未创建对应的点位
  355. 'RemoteOpcLog': () => import('@/views/remote/opc-log/RemoteOpcLog'), // 记录
  356. // 初始化导入
  357. 'ImportExcel': () => import('@/views/excel/ImportExcel'),
  358. // 乾坤
  359. 'Plan': () => import('@/views/qykh/plan/Plan'),
  360. 'PlanDetail': () => import('@/views/qykh/plan-detail/PlanDetail'),
  361. 'Product': () => import('@/views/qykh/product/Product'),
  362. 'ProductHelp': () => import('@/views/qykh/product-help/ProductHelp'),
  363. 'Hotspot': () => import('@/views/qykh/hotspot/Hotspot'),
  364. 'HotspotHelp': () => import('@/views/qykh/hotspot-help/HotspotHelp'),
  365. 'Information': () => import('@/views/qykh/information/Information'),
  366. 'InformationHelp': () => import('@/views/qykh/information-help/InformationHelp'),
  367. // 筹建管理
  368. 'PreparationAll': () => import('@/views/preparation/preparation/PreparationAll'),
  369. 'PreparationMine': () => import('@/views/preparation/preparation/PreparationMine'),
  370. 'PreparationDispatch': () => import('@/views/preparation/preparation/PreparationDispatch'),
  371. // 工器具管理
  372. 'Tool': () => import('@/views/tool/tool/Tool'),
  373. 'ToolWaitCheck': () => import('@/views/tool/tool/ToolWaitCheck'),
  374. 'ToolLog': () => import('@/views/tool/tool-log/ToolLog'),
  375. // 日历
  376. 'Calendar': () => import('@/views/calendar/Calendar')
  377. }
  378. // 前端未找到页面路由(固定不用改)
  379. const notFoundRouter = {
  380. path: '*', redirect: '/404', hidden: true
  381. }
  382. // 根级菜单
  383. const rootRouter = {
  384. key: 'RootIndex',
  385. path: '/',
  386. url: '/',
  387. name: 'index',
  388. component: 'BasicLayout',
  389. meta: { title: '首页' },
  390. redirect: '/WorkplaceBacklog',
  391. type: 1,
  392. children: []
  393. }
  394. /**
  395. * 基础路由
  396. * @type { *[] }
  397. */
  398. export const constantRouterMap = [
  399. {
  400. path: '/user',
  401. component: UserLayout,
  402. redirect: '/user/login',
  403. hidden: true,
  404. children: [
  405. {
  406. path: 'login',
  407. name: 'login',
  408. component: () => import(/* webpackChunkName: "user" */ '@/views/Login')
  409. },
  410. {
  411. path: '/work/scan',
  412. name: 'scan',
  413. component: () => import(/* webpackChunkName: "user" */ '@/views/Scan')
  414. },
  415. {
  416. path: 'register',
  417. name: 'register',
  418. component: () => import(/* webpackChunkName: "user" */ '@/views/Register')
  419. },
  420. {
  421. path: 'register-result',
  422. name: 'registerResult',
  423. component: () => import(/* webpackChunkName: "user" */ '@/views/RegisterResult')
  424. },
  425. {
  426. path: 'recover',
  427. name: 'recover',
  428. component: undefined
  429. }
  430. ]
  431. },
  432. {
  433. path: '/404',
  434. component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
  435. },
  436. {
  437. path: '/tree',
  438. component: () => import('@/views/sb/info/modules/SbTreeModal.vue')
  439. },
  440. {
  441. path: '/opc',
  442. component: () => import('@/views/opc/Opc.vue')
  443. },
  444. {
  445. path: '/toWorkplaceBacklog',
  446. component: () => import('@/views/statisticView/22')
  447. },
  448. {
  449. path: '/InfoBigScreen',
  450. component: () => import('@/views/statisticView/22')
  451. },
  452. {
  453. path: '/InfoDetailBigScreen',
  454. component: () => import('@/views/statisticView/44')
  455. },
  456. {
  457. path: '/RepairBigScreen',
  458. component: () => import('@/views/statisticView/100')
  459. },
  460. {
  461. path: '/SwitchingRoomBigScreen',
  462. component: () => import('@/views/statisticView/SwitchingRoom')
  463. },
  464. {
  465. path: '/TransformerDetailBigScreen',
  466. component: () => import('@/views/statisticView/TransformerDetail')
  467. },
  468. {
  469. path: '/TransformerHistoryBigScreen',
  470. component: () => import('@/views/statisticView/TransformerHistory')
  471. },
  472. {
  473. path: '/DayStatistics',
  474. component: () => import('@/views/statisticView/DayStatistics')
  475. },
  476. {
  477. path: '/MonthStatistics',
  478. component: () => import('@/views/statisticView/MonthStatistics')
  479. },
  480. {
  481. path: '/StoreBigScreen',
  482. component: () => import('@/views/statisticView/9')
  483. },
  484. {
  485. path: '/main',
  486. component: () => import('@/views/statisticView/Main')
  487. },
  488. {
  489. path: '/single/login',
  490. name: 'SingleLogin',
  491. component: () => import('@/views/white-list/SingleLogin'),
  492. meta: {
  493. title: '单点登录',
  494. keepAlive: false,
  495. hiddenHeaderContent: true,
  496. target: null,
  497. permission: ''
  498. },
  499. hidden: true,
  500. hideChildrenInMenu: true
  501. },
  502. {
  503. path: '/result/success',
  504. name: 'ResultSuccess',
  505. component: () => import(/* webpackChunkName: "result" */ '@/views/result/Success'),
  506. meta: {
  507. title: '结果页',
  508. keepAlive: false,
  509. hiddenHeaderContent: true,
  510. target: null,
  511. permission: ''
  512. },
  513. hidden: true,
  514. hideChildrenInMenu: true
  515. }
  516. ]
  517. /**
  518. * 默认菜单
  519. */
  520. const defaultRouter = {
  521. key: 'RootDefault',
  522. path: '/default',
  523. url: '/default',
  524. name: 'default',
  525. component: BasicLayout,
  526. meta: { title: '默认' },
  527. redirect: '/account/settings',
  528. type: 1,
  529. children: [
  530. {
  531. path: '/account/center',
  532. name: 'center',
  533. component: constantRouterComponents['AccountCenter'],
  534. meta: {
  535. title: '个人中心',
  536. keepAlive: false,
  537. hiddenHeaderContent: false,
  538. target: null,
  539. permission: ''
  540. },
  541. hidden: true,
  542. hideChildrenInMenu: true
  543. },
  544. {
  545. path: '/account/settings',
  546. name: 'settings',
  547. component: constantRouterComponents['AccountSettings'],
  548. meta: {
  549. title: '个人设置',
  550. keepAlive: false,
  551. hiddenHeaderContent: true,
  552. target: null,
  553. permission: ''
  554. },
  555. hidden: true,
  556. hideChildrenInMenu: true
  557. }]
  558. }
  559. /**
  560. * 动态生成菜单
  561. * @param token
  562. * @returns {Promise<Router>}
  563. */
  564. export const generatorDynamicRouter = (menus) => {
  565. return new Promise((resolve, reject) => {
  566. try {
  567. const menuNav = []
  568. // 后端数据, 根级树数组, 根级 PID,后端已转为树型 解构
  569. // listToTree(result, childrenNav, 0)
  570. rootRouter.children = menus
  571. menuNav.push(rootRouter)
  572. const routers = generator(menuNav)
  573. routers.push(notFoundRouter)
  574. routers.push(defaultRouter)
  575. resolve(routers)
  576. } catch (e) {
  577. reject(e)
  578. }
  579. })
  580. }
  581. /**
  582. * 格式化树形结构数据 生成 vue-router 层级路由表
  583. *
  584. * @param routerMap
  585. * @param parent
  586. * @returns {*}
  587. */
  588. export const generator = (routerMap, parent) => {
  589. return routerMap.map(itemTree => {
  590. let item = itemTree.item
  591. if (BaseTool.Object.isBlank(item)) {
  592. item = itemTree
  593. }
  594. item.children = itemTree.children
  595. // 如果不是菜单则跳过
  596. if (GlobalConstant.MenuTypeMenu === item.type) {
  597. return null
  598. }
  599. // path: '/dashboard',
  600. // name: 'dashboard',
  601. // redirect: '/dashboard/workplace', // 可以做父路由到子路由的跳转
  602. // component: RouteView,
  603. // meta: { title: '仪表盘', keepAlive: true, icon: bxAnaalyse, permission: [ 'dashboard' ] },
  604. const { title, visible, hideChildren, hiddenHeaderContent, target, icon } = item || {}
  605. const myComponent = constantRouterComponents[item.component || item.name]
  606. const currentRouter = {
  607. // 如果路由设置了 path,则作为默认 path,否则 路由地址 动态拼接生成如 /dashboard/workplace
  608. path: item.url || `${parent && parent.url || ''}/${item.name}`,
  609. // 路由名称,建议唯一
  610. name: item.name,
  611. // 该路由对应页面的 组件 :方案1
  612. component: myComponent,
  613. // 该路由对应页面的 组件 :方案2 (动态加载)
  614. // component: constantRouterComponents[item.component || item.key] || () => import(`@/views/${item.component}`),
  615. // meta: 页面标题, 菜单图标, 页面权限(供指令权限用,可去掉)
  616. meta: { title: title, icon: icon || undefined, keepAlive: false, hiddenHeaderContent: hiddenHeaderContent || false, target: target, permission: item.permission }
  617. }
  618. // 是否设置了隐藏菜单
  619. if (visible === false) {
  620. currentRouter.hidden = true
  621. }
  622. // 是否设置了隐藏子菜单
  623. if (hideChildren || visible === false) {
  624. currentRouter.hideChildrenInMenu = true
  625. }
  626. // 为了防止出现后端返回结果不规范,处理有可能出现拼接出两个 反斜杠
  627. if (!currentRouter.path.startsWith('http')) {
  628. currentRouter.path = currentRouter.path.replace('//', '/')
  629. }
  630. // 重定向
  631. item.redirect && (currentRouter.redirect = item.redirect)
  632. // 是否有子菜单,并递归处理
  633. if (item.children && item.children.length > 0) {
  634. // Recursion
  635. currentRouter.children = generator(item.children, currentRouter)
  636. }
  637. return currentRouter
  638. })
  639. }
  640. /**
  641. * 数组转树形结构
  642. * @param list 源数组
  643. * @param tree 树
  644. * @param parentId 父ID
  645. */
  646. // const listToTree = (list, tree, parentId) => {
  647. // list.forEach(item => {
  648. // // 判断是否为父级菜单
  649. // if (item.parentId === parentId) {
  650. // const child = {
  651. // ...item,
  652. // key: item.key || item.name,
  653. // children: []
  654. // }
  655. // // 迭代 list, 找到当前菜单相符合的所有子菜单
  656. // listToTree(list, child.children, item.id)
  657. // // 删掉不存在 children 值的属性
  658. // if (child.children.length <= 0) {
  659. // delete child.children
  660. // }
  661. // // 加入到树中
  662. // tree.push(child)
  663. // }
  664. // })
  665. // }