mainMenu.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <div class="main1">
  3. <div class="main-top2">
  4. <div class="FengXianDIV1">
  5. <img class="img" src="@/assets/images/wd.png" width="29" height="25" />
  6. <span class="title">{{ title }}</span>
  7. </div>
  8. <div class="GeneralSelectDiv1">
  9. <div class="item bg_tool">工具/发送区</div>
  10. <div class="item bg_statistics">统计/分析区</div>
  11. <div class="item bg_set">设置/编辑区</div>
  12. </div>
  13. <!-- <div class="clearboth"></div> -->
  14. </div>
  15. <div class="conent">
  16. <div class="area border_sending">
  17. <div class="area_item bg_tool" v-for="item in sendingList" :key="item.menuId">
  18. <a href="javascript:void(0);" title="" @click="pageTo(item)">{{ item.menuName }}</a>
  19. <a href="javascript:void(0);"><i class="el-icon-s-promotion" @click="addShortcutMenu(item)"></i></a>
  20. </div>
  21. </div>
  22. <div class="area border_analysis">
  23. <div class="area_item bg_statistics" v-for="item in analysisList" :key="item.menuId">
  24. <a href="javascript:void(0);" title="" @click="pageTo(item)">{{ item.menuName }}</a>
  25. <a href="javascript:void(0);"><i class="el-icon-s-promotion" @click="addShortcutMenu(item)"></i></a>
  26. </div>
  27. </div>
  28. <div class="area">
  29. <div class="area_item bg_set" v-for="item in editList" :key="item.menuId">
  30. <a href="javascript:void(0);" title="" @click="pageTo(item)">{{ item.menuName }}</a>
  31. <a href="javascript:void(0);"><i class="el-icon-s-promotion" @click="addShortcutMenu(item)"></i></a>
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. </template>
  37. <script>
  38. import EventBus from "@/utils/eventBus";
  39. export default {
  40. data() {
  41. return {
  42. // 标题
  43. title: undefined,
  44. // 文档列表
  45. docList: [],
  46. // 当前父菜单对象
  47. currentMenu: {},
  48. // 菜单位置
  49. type: undefined,
  50. //当前菜单路由id
  51. routeId: undefined,
  52. sendingList: [], // 工具/发送区列表
  53. analysisList: [], // 统计/分析区列表
  54. editList: [] // 设置/编辑区列表
  55. }
  56. },
  57. computed: {},
  58. watch: {
  59. // 监听路由跳转
  60. $route: {
  61. handler: function (route) {
  62. this.routeId = route.query.id
  63. this.title = route.query.title
  64. this.init(this.routeId)
  65. },
  66. //一进页面就执行
  67. immediate: true
  68. //deep:true
  69. }
  70. },
  71. methods: {
  72. // 获取菜单
  73. init(routeId) {
  74. if (this.$store.state.permission.routes) {
  75. const routes = this.$store.state.permission.routes
  76. this.$nextTick(() => {
  77. this.docList = routes.filter((item, index, c) => item.parentId == routeId)
  78. // 工具/发送区列表
  79. this.sendingList = this.docList.filter((item, index, c) => item.menuCategory == 0)
  80. // 统计/分析区列表
  81. this.analysisList = this.docList.filter((item, index, c) => item.menuCategory == 1)
  82. // 设置/编辑区列表
  83. this.editList = this.docList.filter((item, index, c) => item.menuCategory == 2)
  84. })
  85. }
  86. },
  87. // 页面跳转
  88. pageTo(item) {
  89. this.$router.push({ path: item.path })
  90. },
  91. // 添加快捷菜单
  92. addShortcutMenu(item) {
  93. EventBus.$emit("addShortcutMenu", item)
  94. },
  95. }
  96. }
  97. </script>
  98. <style scoped lang="scss">
  99. .main1 {
  100. min-height: calc(100vh);
  101. padding: 10px 10px 0 10px;
  102. box-shadow: #dac488 0px 0px 14px inset;
  103. background-color: #000;
  104. }
  105. .main-top2 {
  106. position: relative;
  107. height: 60px;
  108. border-bottom: 2px solid #ffeb9c;
  109. width: 100%;
  110. }
  111. .FengXianDIV1 {
  112. height: 60px;
  113. line-height: 60px;
  114. border-top-left-radius: 6px;
  115. border-top-right-radius: 6px;
  116. background-color: #ffeb9c;
  117. min-width: 177px;
  118. float: left;
  119. color: #000;
  120. font-size: 20px;
  121. font-weight: 600;
  122. display: flex;
  123. img {
  124. margin: 16px 15px 16px 12px;
  125. width: 29px;
  126. height: 25px;
  127. }
  128. }
  129. .GeneralSelectDiv1 {
  130. display: flex;
  131. }
  132. .item {
  133. width: 160px;
  134. height: 45px;
  135. margin-left: 5px;
  136. margin-top: 10px;
  137. border-radius: 5px;
  138. line-height: 45px;
  139. text-align: center;
  140. color: #000;
  141. font-size: 16px;
  142. font-weight: 600;
  143. }
  144. .area {
  145. display: flex;
  146. flex-wrap: wrap;
  147. padding: 26px 5px;
  148. }
  149. .area_item {
  150. position: relative;
  151. width: 160px;
  152. height: 50px;
  153. border-radius: 5px;
  154. line-height: 50px;
  155. text-align: center;
  156. margin: 5px 5px;
  157. a {
  158. color: #000;
  159. font-size: 16px;
  160. font-weight: 400;
  161. }
  162. }
  163. .bg_tool {
  164. background: #c2e6f2;
  165. }
  166. .bg_statistics {
  167. background: #c6efcd;
  168. }
  169. .bg_set {
  170. background: #fcf2d5;
  171. }
  172. .border_sending {
  173. border-bottom: #c2e6f2 1px solid;
  174. }
  175. .border_analysis {
  176. border-bottom: #c6efcd 1px solid;
  177. }
  178. .el-icon-s-promotion{
  179. position: absolute;
  180. right: 5%;
  181. top: 55%;
  182. font-size: 19px;
  183. color: #000;
  184. }
  185. </style>