mineConfig.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. let routeDataList = [{
  2. id: '1',
  3. name: "预警记录",
  4. limits: "",
  5. route: "mineWarningRecording",
  6. routeUrl: "/pages_basics/views/earlyWarningManage/earlyWarningList",
  7. img: require('@/images/commonality/icon_003.png'),
  8. buttonType: "page",
  9. },
  10. {
  11. id: '2',
  12. name: "我的实验室",
  13. limits: "",
  14. route: "laboratory",
  15. routeUrl: "/pages_manage/views/laboratory/meLaboratory",
  16. img: require('@/images/commonality/icon_002.png'),
  17. buttonType: "page",
  18. },
  19. {
  20. id: '3',
  21. name: "预案执行记录",
  22. limits: "",
  23. route: "PlanExecuteRecord",
  24. routeUrl: "/pages_manage/views/plan/planList",
  25. img: require('@/images/commonality/icon_004.png'),
  26. buttonType: "page",
  27. },
  28. {
  29. id: '4', //id
  30. name: "身份验证", //名称
  31. limits: "", //权限字段
  32. route: "faceImage", //路由名称
  33. routeUrl: "/pages_basics/views/faceImage", //组件地址
  34. img: require('@/images/commonality/icon_001.png'), //图片
  35. buttonType: "page", //类型
  36. },
  37. {
  38. id: '5', //id
  39. name: "授权开门", //名称
  40. limits: "", //权限字段
  41. route: "empowerOpen", //路由名称
  42. routeUrl: "/pages_manage/views/accessControl/empowerOpen", //组件地址
  43. img: require('@/images/commonality/icon_001.png'), //图片
  44. buttonType: "page", //类型
  45. },
  46. {
  47. id: '6', //id
  48. name: "远程开门", //名称
  49. limits: "", //权限字段
  50. route: "remoteOpen", //路由名称
  51. routeUrl: "/pages_manage/views/accessControl/remoteOpen", //组件地址
  52. img: require('@/images/commonality/icon_001.png'), //图片
  53. buttonType: "page", //类型
  54. }
  55. ];
  56. export function getMineConfig(data) {
  57. let list = JSON.parse(JSON.stringify(data));
  58. let mineList = [];
  59. for (let i = 0; i < list.length; i++) {
  60. let bigObj = {
  61. type: list[i].type,
  62. layout: [],
  63. };
  64. for (let l = 0; l < list[i].layout.length; l++) {
  65. for (let o = 0; o < routeDataList.length; o++) {
  66. if (list[i].layout[l].path === routeDataList[o].route) {
  67. bigObj.layout.push({
  68. limits: routeDataList[o].limits,
  69. route: routeDataList[o].route,
  70. routeUrl: routeDataList[o].routeUrl,
  71. name: routeDataList[o].name,
  72. img: routeDataList[o].img,
  73. buttonType: routeDataList[o].buttonType,
  74. })
  75. }
  76. }
  77. }
  78. if (bigObj.layout[0]) {
  79. mineList.push(bigObj);
  80. }
  81. }
  82. return mineList;
  83. }