home.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <!-- 左边导航栏 -->
  3. <el-container class="homePage">
  4. <el-container class="homeBody">
  5. <el-aside width="12%" class="aside core_dialogue">
  6. <el-col :span="12">
  7. <el-menu
  8. class="el-menu-vertical-demo"
  9. @open="handleOpen"
  10. @close="handleClose"
  11. :unique-opened="false">
  12. <div class="submenu" v-for="(item,ind) in navList" :key="ind">
  13. <el-submenu v-if="item['group'].length" :index='ind.toString()' >
  14. <template slot="title">
  15. <div class="subTitle" @click="goto(item.goto)" :style="$route.path.indexOf(item.goto)!=-1?'color:#40aaff':''">
  16. <i :class="item.icon" style="margin-right: 15px;width: 15px;" :style="$route.path.indexOf(item.goto)!=-1?'color:#40aaff':''"></i>
  17. {{ item.label }}
  18. </div>
  19. </template>
  20. <div class="submenu" v-for="(item2,ind2) in item['group']" :key="ind2">
  21. <el-menu-item :index="ind2.toString()" @click="goto(item2.goto)">
  22. <template slot="title">
  23. <div class="subTitle" :style="$route.path.indexOf(item2.goto)!=-1?'color:#40aaff':''">
  24. <i :class="item2.icon" style="margin-right: 15px;width: 15px;"></i>
  25. {{ item2.label }}
  26. </div>
  27. </template>
  28. </el-menu-item>
  29. </div>
  30. </el-submenu>
  31. <el-menu-item :index="ind.toString()" v-else-if="$store.state.userInfo.type==0" @click="goto(item.goto)">
  32. <template slot="title">
  33. <div class="subTitle" :style="$route.path.indexOf(item.goto)!=-1?'color:#40aaff':''">
  34. <i :class="item.icon" style="margin-right: 15px;width: 15px;" :style="$route.path.indexOf(item.goto)!=-1?'color:#40aaff':''"></i>
  35. {{ item.label }}
  36. </div>
  37. </template>
  38. </el-menu-item>
  39. </div>
  40. </el-menu>
  41. </el-col>
  42. </el-aside>
  43. <el-main class="main core_dialogue">
  44. <router-view></router-view>
  45. </el-main>
  46. </el-container>
  47. </el-container>
  48. </template>
  49. <script>
  50. export default {
  51. data() {
  52. return {
  53. navList:[
  54. {id:1,label:"项目立项管理",power:false,goto:"/projectApplication",icon:"iconfont icon-shuben",group:[
  55. {label:"创客空间申请",power:false,goto:"/MakerSpaceApply"},
  56. {label:"创客项目申请",power:false,goto:"/newStudentProjectApply"},
  57. ]},
  58. {id:2,label:"活动申请",power:false,icon:"el-icon-wind-power",goto:"/makerActvity",group:[
  59. {label:"创客活动申请",power:false,goto:"/newMarkerActivity"},
  60. {label:"个人创客申请",power:false,goto:"/newNomMarkerActivity"},
  61. ]},
  62. {id:2,label:"事后汇总",power:false,goto:"/makerfund",icon:"iconfont icon-zijinguanli",group:[
  63. {label:"创客活动资金申请",power:false,goto:"/newMarkerfundApply"},
  64. {label:"个人创客资金申请",power:false,goto:"/newNomMarkerFundApply"}
  65. ]},
  66. // {id:3,label:"资金使用管理",goto:"/makerfund",icon:"iconfont icon-zijinguanli",group:[]},
  67. {id:4,label:"项目管理",power:true,goto:"/ProjectManagement",icon:"el-icon-receiving",group:[]},
  68. {id:5,label:"项目结项",power:true,goto:"/projectSettlement",icon:"iconfont icon-_yuanhuanchong",group:[]},
  69. // {id:6,label:"学分登记",goto:"/credit",icon:"iconfont icon-yonghu"},
  70. {id:7,label:"成果展示",power:true,goto:"/resultsShow",icon:"iconfont icon-xiangmuguanli2",group:[]},
  71. {id:8,label:"创业公司登记",power:true,goto:"/firm",icon:"iconfont icon-zuzhijiegou",group:[]},
  72. {id:9,label:"消息通知",power:true,goto:"/messageNotification",icon:"iconfont icon-xiaoxitongzhi3",group:[]},
  73. {id:10,label:"数据监测",power:true,goto:"/echarts",icon:"iconfont icon-qushi",group:[]},
  74. ]
  75. }
  76. },
  77. methods:{
  78. goto(url){
  79. // console.log(this.$route.path);
  80. this.$router.push(url)
  81. // console.log('1111')
  82. },
  83. homeExit(){
  84. // console.log(this.$route.path)
  85. this.$router.push('/login')
  86. },
  87. handleOpen(key, keyPath) {
  88. console.log(key, keyPath);
  89. },
  90. handleClose(key, keyPath) {
  91. console.log(key, keyPath);
  92. }
  93. },
  94. mounted(){
  95. console.log(this.$store)
  96. }
  97. }
  98. </script>
  99. <style lang="less" scoped>
  100. .homePage{
  101. // 减去公共部分使页面铺满浏览器
  102. height: calc(100% - 70px);
  103. width: 100%;
  104. .homeBody{
  105. margin: 20px 20px 30px 20px;
  106. .aside{
  107. background-color: #fff;
  108. color: #909399;
  109. height: 100%;
  110. border-radius: 5px;
  111. display: flex;
  112. align-items: center;
  113. flex-direction: column;
  114. min-width: 220px;
  115. .btns{
  116. display: flex;
  117. width: 100%;
  118. height: 70px;
  119. align-items: center;
  120. font-size: 16px;
  121. cursor: pointer;
  122. box-sizing: border-box;
  123. padding-left: 20%;
  124. &:hover{
  125. background-color: #cccccc;
  126. }
  127. span{
  128. align-items: center;
  129. width: 80%;
  130. white-space: nowrap;
  131. overflow: hidden;
  132. text-overflow:ellipsis;
  133. i{
  134. position: relative;
  135. top: 1px;
  136. font-size: 17px;
  137. margin-right: 3px;
  138. }
  139. }
  140. }
  141. }
  142. .main {
  143. background-color: #fff;
  144. color: #333;
  145. // text-align: center;
  146. // overflow: hidden ;
  147. margin-left: 20px;
  148. box-sizing: border-box;
  149. padding: 20px 30px;
  150. border-radius: 5px;
  151. }
  152. }
  153. .el-menu{
  154. border-right:none;
  155. }
  156. .el-col-12{
  157. width: 100%;
  158. }
  159. }
  160. .subTitle{
  161. width: 100%;
  162. height: 100%;
  163. display: flex;
  164. align-items: center;
  165. box-sizing: border-box;
  166. padding-left: 20%;
  167. // background-color: red;
  168. }
  169. :deep(.el-menu-item.is-active){
  170. color: #333 !important;
  171. i{
  172. color: #909399;
  173. }
  174. }
  175. </style>