LeftNav.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <div class="sidebar">
  3. <div style="font-family: AliMaMa;font-size: 30px;font-weight: 1000;text-align: left;">
  4. <span style="position: absolute;top:-3px;left: 70px;color: #fff;">目录</span>
  5. </div>
  6. <div style="height: 40px"></div>
  7. <el-menu
  8. active-text-color="#ffd04b"
  9. background-color="transparent"
  10. class="sidebar-el-menu"
  11. default-active="1"
  12. text-color="#fff">
  13. <!-- 一级菜单 -->
  14. <template v-for="item in list">
  15. <el-submenu v-if="item.children && item.children.length" :key="item.path" :index="item.path">
  16. <template slot="title"><img :src="require('../fdjh/img/plan.png')" style="margin-right: 10px;"
  17. width="28px"/><span style="font-size:18px;font-weight:bold">{{
  18. item.name
  19. }}</span>
  20. </template>
  21. <!-- 二级菜单 -->
  22. <template v-for="itemChild in item.children">
  23. <el-submenu v-if="itemChild.children && itemChild.children.length" :key="itemChild.path"
  24. :index="itemChild.path">
  25. <template slot="title"><img :src="require('../fdjh/img/pc1.png')"
  26. style="margin-right: 10px;"/><span
  27. style="font-size:16px;font-weight:bold">{{ itemChild.name }}</span></template>
  28. <!-- 三级菜单 -->
  29. <el-menu-item v-for="itemChild_Child in itemChild.children" :key="itemChild_Child.path"
  30. :index="itemChild_Child.path" @click="changePage(itemChild_Child)">
  31. <img :src="require('../fdjh/img/last1.png')" style="margin-right: 10px;"/><span
  32. slot="title">{{ itemChild_Child.name }}</span></el-menu-item>
  33. </el-submenu>
  34. <el-menu-item v-else :key="itemChild.path" :index="itemChild.path"><img
  35. :src="require('../fdjh/img/pc1.png')"
  36. style="margin-right: 10px;"/><span slot="title">{{ itemChild.name }}</span>
  37. </el-menu-item>
  38. </template>
  39. </el-submenu>
  40. <el-menu-item v-else :key="item.path" :index="item.path"><img :src="require('../fdjh/img/plan.png')"
  41. style="margin-right: 10px;"
  42. width="28px"/><span
  43. slot="title">{{ item.name }}</span></el-menu-item>
  44. </template>
  45. </el-menu>
  46. </div>
  47. </template>
  48. <script>
  49. export default {
  50. data() {
  51. return {
  52. list: [
  53. {
  54. path: "/1",
  55. name: "实时调度计划",
  56. children: [
  57. {
  58. path: "/1/1",
  59. name: "发电端计划监控",
  60. children: [
  61. {
  62. path: "/#/table1",
  63. name: "风电",
  64. },
  65. {
  66. path: "/#/fdjhgf",
  67. name: "光伏电站",
  68. },
  69. {
  70. path: "/#/fdjhhd",
  71. name: "火电厂",
  72. },
  73. {
  74. path: "/#/fdjhcn",
  75. name: "储能",
  76. }
  77. ]
  78. },
  79. {
  80. path: "/1/2",
  81. name: "约束条件监控",
  82. children: [
  83. {
  84. path: "/#/llx",
  85. name: "联络线",
  86. },
  87. {
  88. path: "/#/dm",
  89. name: "断面",
  90. }
  91. ]
  92. },
  93. {
  94. path: "/1/3",
  95. name: "数据采集监控监控",
  96. children: [
  97. {
  98. path: "/#/hd",
  99. name: "火电厂",
  100. },
  101. {
  102. path: "/#/fdgf",
  103. name: "风电、光伏电站",
  104. },
  105. {
  106. path: "/#/ptfh",
  107. name: "普通负荷",
  108. },
  109. {
  110. path: "/#/gaoznfh",
  111. name: "高载能负荷",
  112. }
  113. ]
  114. }
  115. ]
  116. }
  117. ]
  118. }
  119. },
  120. methods: {
  121. changePage(obj) {
  122. var parentIframe = parent.document.getElementById('showcontent');
  123. parentIframe.src = obj.path;
  124. }
  125. }
  126. }
  127. </script>
  128. <style scoped>
  129. .sidebar {
  130. display: block;
  131. text-align: left;
  132. }
  133. .sidebar::-webkit-scrollbar {
  134. width: 0;
  135. }
  136. .sidebar-el-menu:not(.el-menu--collapse) {
  137. //position: absolute; //top: 6%; margin: 0px 0 30px 30px; background-size: 100% 100%; height: 90%;
  138. }
  139. /deep/ .el-submenu__title:hover {
  140. background-color: rgb(103, 118, 49) !important;
  141. }
  142. /deep/ .sidebar-el-menu {
  143. margin-left: 23px !important;
  144. }
  145. .sidebar > ul {
  146. height: 100%;
  147. }
  148. .el-menu {
  149. border: 0 !important;
  150. }
  151. .el-menu-item {
  152. height: 40px;
  153. font-size: 16px;
  154. font-weight: bold;
  155. }
  156. .el-submenu .el-menu-item:hover {
  157. background-color: rgb(103, 118, 49) !important;
  158. }
  159. .el-sub-menu__title:hover {
  160. background-color: rgb(103, 118, 49) !important;
  161. }
  162. </style>