vNav.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <template>
  2. <div class="vNavCom">
  3. <div class="logo">
  4. <img style="width:120px; border-bottom: 1px solid #bbb;padding: 15px" src="@/../public/img/logo2.png" alt="">
  5. </div>
  6. <el-menu background-color="#f6fafd" @select="handleSelect" text-color="#5d77ad" unique-opened active-text-color="#fff">
  7. <!-- <el-menu-item index="-1" @click="jump('home')"> -->
  8. <!-- <i class="el-icon-menu"></i> -->
  9. <div class="el-menu-item special" @click="jump('home')" :class="$route.name==='home' ? 'active' : ''">
  10. <img style="width: 20px" class="icon2" :src="imgList[$route.name==='home' ? 4 : 0]" alt="">
  11. <span slot="title" class="a_menu" style="font-size:16px" :style="$route.name==='home' ? 'color: #fff' : ''">首页</span>
  12. </div>
  13. <!-- </el-menu-item> -->
  14. <el-submenu v-for="(item,index) in route||filterOne" :key="index" :index="`${index}`">
  15. <template slot="title">
  16. <!-- <span :class="'iconfont '+item.icon"></span> -->
  17. <!-- {{url+item.icon+'.png'}} -->
  18. <img style="width: 20px" :src="imgList[item.icon]" alt="">
  19. <span class="a_menu">{{item.name}}</span>
  20. </template>
  21. <el-menu-item v-for="(child,childIndex) in item.child||item.child.filter(j => menuIdList.includes(j.menuid))" @click="jump(child.to)" :class="$route.name===child.to ? 'active' : ''" :key="childIndex" :index="`${index}-${childIndex}`" :style="childIndex!==item.child.length-1?'margin-bottom: 15px':''">
  22. <div>{{child.name}}</div>
  23. </el-menu-item>
  24. </el-submenu>
  25. </el-menu>
  26. </div>
  27. </template>
  28. <script>
  29. export default {
  30. data () {
  31. return {
  32. list: [],
  33. number: 0,
  34. imgList: [
  35. require('../../../public/img/home.png'),
  36. require('../../../public/img/company.png'),
  37. require('../../../public/img/people.png'),
  38. require('../../../public/img/setting.png'),
  39. require('../../../public/img/home-active.png'),
  40. require('../../../public/img/company-active.png'),
  41. require('../../../public/img/people-active.png'),
  42. require('../../../public/img/setting-active.png')
  43. ],
  44. // url: '../../../public/img/',.
  45. menuIdList: [],
  46. route: [
  47. {
  48. name: '公司设置',
  49. // menuid: 100,
  50. to: '',
  51. icon: 1,
  52. child: [{
  53. name: '基本信息设置',
  54. menuid: 503,
  55. to: 'basicInfo'
  56. },
  57. {
  58. name: '职位信息设置',
  59. menuid: 504,
  60. to: 'positionInfo'
  61. },
  62. {
  63. name: '简历信息设置',
  64. menuid: 505,
  65. to: 'formManage'
  66. },
  67. {
  68. name: '视频库管理',
  69. menuid: 507,
  70. to: 'videoManage'
  71. },
  72. {
  73. name: '面试问题设置',
  74. menuid: 506,
  75. to: 'procedureManage'
  76. },
  77. // {
  78. // name: '应用场景管理',
  79. // menuid: 508,
  80. // to: 'sceneManage'
  81. // },
  82. {
  83. name: '邀约管理',
  84. menuid: 509,
  85. to: 'templateManage'
  86. },
  87. {
  88. name: '邮箱管理',
  89. menuid: 510,
  90. to: 'mailManage'
  91. }
  92. ]
  93. },
  94. {
  95. name: '候选人管理',
  96. // menuid: 200,
  97. to: '',
  98. icon: 2,
  99. child: [{
  100. name: '人才库',
  101. menuid: 511,
  102. to: 'candidateAll'
  103. },
  104. {
  105. name: '简历管理',
  106. menuid: 512,
  107. to: 'resumeList'
  108. },
  109. {
  110. name: '面试管理',
  111. menuid: 513,
  112. to: 'candidateList'
  113. }
  114. ]
  115. },
  116. {
  117. name: '系统管理',
  118. // menuid: 200,
  119. to: '',
  120. icon: 3,
  121. child: [{
  122. name: '密码设置',
  123. menuid: 514,
  124. to: 'passwordSettings'
  125. },
  126. {
  127. name: '数据统计',
  128. menuid: 515,
  129. to: 'statistics'
  130. }
  131. ]
  132. }
  133. ]
  134. }
  135. },
  136. created () {
  137. // localStorage.getItem('token') && this.queryNumber()
  138. // this.menuIdList = localStorage.getItem('menuId') ? localStorage.getItem('menuId').split(',').map(item => item - 0) : []
  139. let menuList = JSON.parse(localStorage.getItem('menuId'))
  140. menuList && this.route.forEach(item => {
  141. item.child.forEach(i => {
  142. menuList.forEach(j => {
  143. j.menuid === i.menuid && (i.name = j.menuname)
  144. })
  145. })
  146. })
  147. },
  148. mounted () {
  149. this.handleSelect('0-0', this.route)
  150. },
  151. computed: {
  152. // filterOne () {
  153. // return this.route.filter(item => item.child.filter(j => this.menuIdList.includes(j.menuid)).length)
  154. // }
  155. },
  156. methods: {
  157. queryNumber () {
  158. let reqdata = {}
  159. this.$api.post('/platform/company/platformNotExamineCompanyCount', {
  160. reqdata
  161. }).then(res => {
  162. // this.number = res.object.notExamineCompanyCount
  163. this.$store.commit('setNumber', res.object.notExamineCompanyCount)
  164. })
  165. },
  166. handleSelect (key, keyPath) {
  167. this.$emit('keyPath', key, this.route || this.filterOne)
  168. },
  169. jump (to) {
  170. if (this.$route.name === to) {
  171. return false
  172. }
  173. this.$router.push({
  174. name: to
  175. })
  176. this.$forceUpdate()
  177. }
  178. }
  179. }
  180. </script>
  181. <style lang="scss" scoped>
  182. @import './vNav.scss';
  183. /deep/.el-submenu__title i {
  184. color: #8D9498;
  185. }
  186. .special {
  187. // height: 56px!important;
  188. // width: 210px!important;
  189. // margin: 0!important;
  190. color: #5d77ad;
  191. // text-align: start!important;
  192. padding-left: 0;
  193. position: relative;
  194. padding-right: 0;
  195. font-size: 16px!important;
  196. // display: flex;
  197. // justify-content: space-between;
  198. .icon2 {
  199. position: absolute;
  200. left: 12px;
  201. top: 10px;
  202. }
  203. }
  204. // .logo {
  205. // color: #ffffff;
  206. // font-size: 20px;
  207. // padding: 15% 0 13% 0;
  208. // }
  209. // .vNavCom{
  210. // overflow-y: scroll;
  211. // }
  212. // .vNavCom::-webkit-scrollbar{
  213. // display:none;
  214. // }
  215. </style><style lang="scss">
  216. .el-submenu {
  217. .el-badge__content {
  218. margin-top: 25% !important;
  219. position: relative;
  220. width: 20px;
  221. left: 25px;
  222. }
  223. }
  224. </style>