slide.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <template>
  2. <div class="slide-layout nav-menu">
  3. <div class="navigator_menu">
  4. <span>导航面板</span>
  5. </div>
  6. <el-menu text-color="#999" active-text-color="#333" class="el-menu-vertical-demo" @select='handleSelect'>
  7. <template v-for="(nav, i) in navs">
  8. <router-link tag="div" :to="nav.link" :key="i" v-if="!nav.children">
  9. <el-menu-item :index="i+''" style="padding-left: 49px;">
  10. <i class="iconfonts i-fix" :style="{backgroundPosition: '0px -'+(Number(actice_idx)===i?nav.top + 14:nav.top)+'px'}"></i>
  11. <span slot="title">{{nav.text}}</span>
  12. </el-menu-item>
  13. </router-link>
  14. <el-submenu v-else :key="i" :index="i+''">
  15. <template slot="title">
  16. <i class="iconfonts i-fix" :style="{backgroundPosition: '0px -'+nav.top+'px'}"></i>
  17. <span style="padding-left:30px">{{nav.text}}</span>
  18. </template>
  19. <router-link tag="div" :to="nav.link" v-for="(nav, j) in nav.children" :key="j">
  20. <el-menu-item :index="i+'-'+j">{{nav.text}}</el-menu-item>
  21. </router-link>
  22. </el-submenu>
  23. </template>
  24. </el-menu>
  25. </div>
  26. </template>
  27. <script>
  28. export default {
  29. name: 'm-aside',
  30. component: {},
  31. data () {
  32. let navs = [
  33. // { text: '首页', link: {name: 'Home'}, top: 14 },
  34. { text: '设备管理', link: {name: 'device'}, top: 126 },
  35. { text: '订单管理',
  36. link: {name: 'Order'},
  37. children: [
  38. { text: '相机订单', link: {name: 'Order'} },
  39. { text: '权益订单', link: {name: 'qyOrder'} },
  40. { text: '下载订单', link: {name: 'downloadOrder'} }
  41. ],
  42. top: 42 },
  43. // { text: '增值服务', link: {name: 'Added'}, top: 70 },
  44. // {
  45. // text: '代理平台',
  46. // link: {name: 'home'},
  47. // children: [
  48. // { text: '代理管理', link: {name: 'hone'} },
  49. // { text: '代理查询', link: {name: 'hone'} },
  50. // { text: '公告设置', link: {name: 'hone'} }
  51. // ],
  52. // top: 98
  53. // },
  54. // { text: '发票管理', link: {name: 'invoice'}, top: 126 },
  55. {
  56. text: '更多设置',
  57. link: {name: 'home'},
  58. children: [
  59. // { text: '激光场景', link: {name: 'laser'} },
  60. { text: '场景管理', link: {name: 'scene'} },
  61. { text: '反馈消息', link: {name: 'feedback'} },
  62. // { text: '设备管理', link: {name: 'device'} },
  63. { text: 'app管理', link: {name: 'appupload'} },
  64. { text: '客户管理', link: {name: 'client'} }
  65. ],
  66. top: 154
  67. },
  68. // { text: '经销商申请', link: {name: 'distributor-list'}, top: 98 },
  69. // { text: '留言管理', link: {name: 'leaving'}, top: 182 },
  70. {
  71. text: '版本管理',
  72. link: {name: 'edition'},
  73. children: [
  74. { text: '八目相机', link: {name: 'edition'}, top: 182 },
  75. { text: '转台相机', link: {name: 'turntableCamera'}, top: 182 },
  76. { text: '激光相机', link: {name: 'laserCamera'}, top: 182 }
  77. ],
  78. top: 154
  79. },
  80. // { text: '版本管理', link: {name: 'edition'}, top: 182 },
  81. { text: '数据统计', link: {name: 'Statistics'}, top: 210 }
  82. // {
  83. // text: 'SDK 发布管理',
  84. // link: {name: 'sdkManage'},
  85. // children: [
  86. // { text: 'SpaceTarget', link: {name: 'spaceTarget'}, top: 182 }
  87. // ],
  88. // top: 154
  89. // },
  90. // { text: '用户列表', link: {name: 'userList'}, top: 126 },
  91. // { text: '操作日志', link: {name: 'oplog'}, top: 210 }
  92. // { text: '数据下载', link: {name: 'Down'}, top: 210 }
  93. // ,
  94. // {
  95. // text: 'BBS',
  96. // link: {name: 'home'},
  97. // children: [
  98. // { text: '文章列表', link: {name: 'home'} },
  99. // { text: '评论管理', link: {name: 'home'} },
  100. // { text: '用户管理', link: {name: 'home'} }
  101. // ],
  102. // top: 182
  103. // }
  104. ]
  105. return {
  106. actice_idx: 1,
  107. navs: navs
  108. }
  109. },
  110. methods: {
  111. handleSelect (key) {
  112. console.log(key)
  113. this.actice_idx = key
  114. },
  115. openNotice () {
  116. this.$store.commit('SET_OPENNOTICE', true)
  117. }
  118. }
  119. }
  120. </script>
  121. <style scoped>
  122. .slide-layout {
  123. border: 1px solid #ebeef5;
  124. background: #ffffff;
  125. z-index: 1;
  126. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  127. }
  128. .nav-menu {
  129. padding-left: 5px;
  130. user-select: none;
  131. font-size: 20px;
  132. }
  133. .nav-menu-item {
  134. margin: 20px 0;
  135. }
  136. .menu-title {
  137. font-size: 18px;
  138. margin-left: 15px;
  139. }
  140. .jiantou {
  141. width: 8px;
  142. height: 8px;
  143. border-top: 2px solid #000;
  144. border-right: 2px solid #000;
  145. transform: rotate(135deg);
  146. display: inline-block;
  147. margin-left: 64px;
  148. }
  149. .flex-item {
  150. cursor: pointer;
  151. display: flex;
  152. align-items: center;
  153. transition: all 0.3s;
  154. }
  155. .flex-item-list {
  156. margin-left: 32px;
  157. margin-top: 20px;
  158. }
  159. .flex-item-list li {
  160. cursor: pointer;
  161. margin-top: 20px;
  162. color: #999;
  163. }
  164. .fade-enter-active,
  165. .fade-leave-active {
  166. transition: opacity .5s;
  167. }
  168. .fade-enter,
  169. .fade-leave-to
  170. /* .fade-leave-active below version 2.1.8 */
  171. {
  172. opacity: 0;
  173. }
  174. .iconfont {
  175. margin-right: 10px;
  176. }
  177. .navigator_menu {
  178. line-height: 56px;
  179. height: 56px;
  180. }
  181. .navigator_menu>span {
  182. padding-left: 20px;
  183. font-size: 12px;
  184. color: #999;
  185. }
  186. </style>
  187. <style type="text/css">
  188. .el-menu-item.is-active {
  189. background: #f2f2f2;
  190. /*color: #333;*/
  191. }
  192. .i-fix {
  193. display: inline-block;
  194. background-repeat: no-repeat;
  195. width: 14px;
  196. height: 14px;
  197. vertical-align: middle;
  198. background-image: url('~@/assets/images/icon/sys_icon.png')
  199. }
  200. .iconfonts {
  201. position: absolute;
  202. left: 20px;
  203. top: 50%;
  204. margin-top: -9px;
  205. }
  206. </style>