generator-platform-routers.js 33 KB

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