Aside.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <el-menu
  3. :default-active="this.$store.state.currentMenuItem"
  4. style="width: 220px; height: 100%"
  5. background-color="#141B29"
  6. text-color="#fff"
  7. active-text-color="#ffd04b"
  8. :router="true"
  9. >
  10. <el-sub-menu v-for="(item, index) in menu" :key="item" :index="index + ''">
  11. <template v-slot:title>
  12. <el-icon :size="18">
  13. <component :is="item.icon" />
  14. </el-icon>
  15. <span>{{ item.title }}</span>
  16. </template>
  17. <el-menu-item
  18. v-for="son in item.items"
  19. :index="son.path"
  20. :key="son"
  21. @click="changeIndex(son.path)"
  22. >
  23. {{ son.name }}
  24. </el-menu-item>
  25. </el-sub-menu>
  26. </el-menu>
  27. </template>
  28. <script>
  29. import { ref } from "vue";
  30. export default {
  31. setup() {
  32. let defaultActive = ref();
  33. function changeIndex(path) {
  34. defaultActive.value = path;
  35. }
  36. let menu = [
  37. {
  38. icon: "Fold",
  39. title: "航次管理",
  40. items: [
  41. {
  42. path: "/voyage/voyageList",
  43. name: "航次列表",
  44. },
  45. ],
  46. },
  47. {
  48. icon: "userFilled",
  49. title: "货主信息",
  50. items: [
  51. {
  52. path: "/cargoOwnerManage/cargoOwnerCompanyList",
  53. name: "货主公司列表",
  54. },
  55. ],
  56. },
  57. {
  58. icon: "User",
  59. title: "代理信息",
  60. items: [
  61. {
  62. path: "/agencyManage/agencyCompanyList",
  63. name: "代理公司列表",
  64. },
  65. {
  66. path: "/agencyManage/agencyExamine",
  67. name: "代理公司审核",
  68. },
  69. ],
  70. },
  71. {
  72. icon: "Avatar",
  73. title: "船东信息",
  74. items: [
  75. {
  76. path: "/shipOwnerManage/shipOwnerList",
  77. name: "船东列表",
  78. },
  79. ],
  80. },
  81. {
  82. icon: "Ship",
  83. title: "船舶信息",
  84. items: [
  85. {
  86. path: "/shipManage/shipList",
  87. name: "船舶列表",
  88. },
  89. ],
  90. },
  91. {
  92. icon: "Place",
  93. title: "港口信息",
  94. items: [
  95. {
  96. path: "/portsManage/portsList",
  97. name: "港口列表",
  98. },
  99. {
  100. path: "/portsManage/sailingSchedule",
  101. name: "航期维护",
  102. },
  103. ],
  104. },
  105. {
  106. icon: "Magnet",
  107. title: "航次区块链",
  108. items: [
  109. {
  110. path: "/toolManage/blockChain",
  111. name: "航次上链",
  112. },
  113. ],
  114. },
  115. {
  116. icon: "Document",
  117. title: "项目管理",
  118. items: [
  119. {
  120. path: "/toolManage/versions",
  121. name: "版本日志",
  122. },
  123. {
  124. path: "/toolManage/uploadFileManage",
  125. name: "通用文件上传",
  126. },
  127. {
  128. path: "/urls",
  129. name: "项目集成",
  130. },
  131. ],
  132. },
  133. ];
  134. return {
  135. changeIndex,
  136. defaultActive,
  137. menu,
  138. };
  139. },
  140. };
  141. </script>
  142. <style scoped>
  143. .el-sub-menu__title i {
  144. height: 20px;
  145. margin-right: 10px;
  146. }
  147. </style>