LeftNav.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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: "/#/jkcx",
  63. name: "接口、程序",
  64. }
  65. ]
  66. },
  67. {
  68. path: "/1/2",
  69. name: "系统配置",
  70. children: [
  71. {
  72. path: "/#/pzb",
  73. name: "配置表",
  74. }
  75. ]
  76. }
  77. ]
  78. }
  79. ]
  80. }
  81. },
  82. methods: {
  83. changePage(obj) {
  84. var parentIframe = parent.document.getElementById('showcontent');
  85. parentIframe.src = obj.path;
  86. }
  87. }
  88. }
  89. </script>
  90. <style scoped>
  91. .sidebar {
  92. display: block;
  93. text-align: left;
  94. }
  95. .sidebar::-webkit-scrollbar {
  96. width: 0;
  97. }
  98. .sidebar-el-menu:not(.el-menu--collapse) {
  99. //position: absolute; //top: 6%; margin: 0px 0 30px 30px; background-size: 100% 100%; height: 90%;
  100. }
  101. /deep/ .el-submenu__title:hover {
  102. background-color: rgb(103, 118, 49) !important;
  103. }
  104. /deep/ .sidebar-el-menu {
  105. margin-left: 23px !important;
  106. }
  107. .sidebar > ul {
  108. height: 100%;
  109. }
  110. .el-menu {
  111. border: 0 !important;
  112. }
  113. .el-menu-item {
  114. height: 40px;
  115. font-size: 16px;
  116. font-weight: bold;
  117. }
  118. .el-submenu .el-menu-item:hover {
  119. background-color: rgb(103, 118, 49) !important;
  120. }
  121. .el-sub-menu__title:hover {
  122. background-color: rgb(103, 118, 49) !important;
  123. }
  124. </style>