leftBar.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. <template>
  2. <div class="bottom">
  3. <!-- <div
  4. class="item"
  5. @click="clickItem('/')"
  6. :class="{ active: $route.path === '/' }"
  7. >
  8. <p>首页</p>
  9. </div>
  10. <div
  11. class="item"
  12. @click="clickItem('/b')"
  13. :class="{ active: $route.path === '/b' }"
  14. >
  15. <p>学习中心</p>
  16. </div> -->
  17. <el-row class="tac">
  18. <el-col :span="12">
  19. <el-menu
  20. :default-active="path"
  21. background-color="#fff"
  22. text-color="#777"
  23. active-text-color="#fff"
  24. router
  25. >
  26. <el-menu-item index="/course">
  27. <div class="img" v-if="path == '/course'">
  28. <img src="../../assets/icon/course-active.svg" alt="" />
  29. </div>
  30. <div class="img" v-else>
  31. <img src="../../assets/icon/course.png" alt="" />
  32. </div>
  33. <span>课程项目管理</span>
  34. </el-menu-item>
  35. <el-menu-item index="/student">
  36. <div class="img" v-if="path == '/student'">
  37. <img src="../../assets/icon/student-active.svg" alt="" />
  38. </div>
  39. <div class="img" v-else>
  40. <img src="../../assets/icon/user.png" alt="" />
  41. </div>
  42. <span slot="title">学生管理</span>
  43. </el-menu-item>
  44. <el-menu-item index="/works">
  45. <div class="img" v-if="path == '/works'">
  46. <img src="../../assets/icon/work-active.svg" alt="" />
  47. </div>
  48. <div class="img" v-else>
  49. <img src="../../assets/icon/works.png" alt="" />
  50. </div>
  51. <span slot="title">评价管理</span>
  52. </el-menu-item>
  53. <el-menu-item index="/class">
  54. <div class="img" v-if="path == '/class'">
  55. <img src="../../assets/icon/class-active.svg" alt="" />
  56. </div>
  57. <div class="img" v-else>
  58. <img src="../../assets/icon/class.png" alt="" />
  59. </div>
  60. <span slot="title">班级管理</span>
  61. </el-menu-item>
  62. <el-menu-item index="/data">
  63. <div class="img" v-if="path == '/data'">
  64. <img src="../../assets/icon/data-active.svg" alt="" />
  65. </div>
  66. <div class="img" v-else>
  67. <img src="../../assets/icon/data.png" alt="" />
  68. </div>
  69. <span slot="title">我的资料</span>
  70. </el-menu-item>
  71. <el-menu-item index="/notice">
  72. <div class="img" v-if="path == '/notice'">
  73. <img src="../../assets/icon/new-active.svg" alt="" />
  74. </div>
  75. <div class="img" v-else>
  76. <img src="../../assets/icon/notice.png" alt="" />
  77. </div>
  78. <span slot="title">通知公告</span>
  79. </el-menu-item>
  80. <el-menu-item index="/library">
  81. <div class="img" v-if="path == '/library'">
  82. <img src="../../assets/icon/new-active.svg" alt="" />
  83. </div>
  84. <div class="img" v-else>
  85. <img src="../../assets/icon/notice.png" alt="" />
  86. </div>
  87. <span slot="title">素材库</span>
  88. </el-menu-item>
  89. <el-menu-item index="/classRoom">
  90. <div class="img" v-if="path == '/classRoom'">
  91. <img src="../../assets/icon/new-active.svg" alt="" />
  92. </div>
  93. <div class="img" v-else>
  94. <img src="../../assets/icon/notice.png" alt="" />
  95. </div>
  96. <span slot="title">课堂备课</span>
  97. </el-menu-item>
  98. <el-menu-item index="/liveRoom">
  99. <div class="img" v-if="path == '/liveRoom'">
  100. <img src="../../assets/icon/new-active.svg" alt="" />
  101. </div>
  102. <div class="img" v-else>
  103. <img src="../../assets/icon/notice.png" alt="" />
  104. </div>
  105. <span slot="title">实时课堂</span>
  106. </el-menu-item>
  107. <el-menu-item index="/addPPt">
  108. <div class="img" v-if="path == '/addPPt'">
  109. <img src="../../assets/icon/new-active.svg" alt="" />
  110. </div>
  111. <div class="img" v-else>
  112. <img src="../../assets/icon/notice.png" alt="" />
  113. </div>
  114. <span slot="title">添加备课</span>
  115. </el-menu-item>
  116. <el-menu-item index="/studyLibrary">
  117. <div class="img" v-if="path == '/studyLibrary'">
  118. <img src="../../assets/icon/new-active.svg" alt="" />
  119. </div>
  120. <div class="img" v-else>
  121. <img src="../../assets/icon/notice.png" alt="" />
  122. </div>
  123. <span slot="title">学习资料</span>
  124. </el-menu-item>
  125. <el-menu-item index="/GridList">
  126. <div class="img" v-if="path == '/GridList'">
  127. <img src="../../assets/icon/new-active.svg" alt="" />
  128. </div>
  129. <div class="img" v-else>
  130. <img src="../../assets/icon/notice.png" alt="" />
  131. </div>
  132. <span slot="title">思维网格列表</span>
  133. </el-menu-item>
  134. <el-menu-item index="/wordList">
  135. <div class="img" v-if="path == '/wordList'">
  136. <img src="../../assets/icon/new-active.svg" alt="" />
  137. </div>
  138. <div class="img" v-else>
  139. <img src="../../assets/icon/notice.png" alt="" />
  140. </div>
  141. <span slot="title">思维网格列表</span>
  142. </el-menu-item>
  143. <el-menu-item index="/Ttype">
  144. <div class="img" v-if="path == '/Ttype'">
  145. <img src="../../assets/icon/new-active.svg" alt="" />
  146. </div>
  147. <div class="img" v-else>
  148. <img src="../../assets/icon/notice.png" alt="" />
  149. </div>
  150. <span slot="title">分组管理</span>
  151. </el-menu-item>
  152. <el-menu-item index="/banner">
  153. <div class="img" v-if="path == '/banner'">
  154. <img src="../../assets/icon/new-active.svg" alt="" />
  155. </div>
  156. <div class="img" v-else>
  157. <img src="../../assets/icon/notice.png" alt="" />
  158. </div>
  159. <span slot="title">Banner管理</span>
  160. </el-menu-item>
  161. <el-menu-item index="/eventCenter">
  162. <div class="img" v-if="path == '/eventCenter'">
  163. <img src="../../assets/icon/new-active.svg" alt="" />
  164. </div>
  165. <div class="img" v-else>
  166. <img src="../../assets/icon/notice.png" alt="" />
  167. </div>
  168. <span slot="title">赛事中心管理</span>
  169. </el-menu-item>
  170. <!-- <el-menu-item index="/ask">
  171. <div class="img" v-if="path == '/ask'">
  172. <img
  173. src="../../assets/icon/ask-active.png"
  174. style="width: 110%; height: 110%; margin-left: -3px"
  175. alt=""
  176. />
  177. </div>
  178. <div class="img" v-else>
  179. <img
  180. src="../../assets/icon/ask.png"
  181. style="width: 110%; height: 110%; margin-left: -3px"
  182. alt=""
  183. />
  184. </div>
  185. <span slot="title">问卷调查</span>
  186. </el-menu-item> -->
  187. </el-menu>
  188. </el-col>
  189. </el-row>
  190. </div>
  191. </template>
  192. <script>
  193. export default {
  194. props: {
  195. luyou: Number,
  196. },
  197. data() {
  198. return {
  199. path: this.$route.path,
  200. };
  201. },
  202. methods: {
  203. clickItem: function (path) {
  204. this.$router.push(path);
  205. },
  206. },
  207. watch: {
  208. luyou: {
  209. handler(n, o) {
  210. this.path = this.$route.path;
  211. },
  212. deep: true, // 深度监听父组件传过来对象变化
  213. },
  214. },
  215. };
  216. </script>
  217. <style scoped>
  218. .bottom {
  219. position: absolute;
  220. left: 20px;
  221. margin-top: 20px;
  222. background-color: #fff;
  223. width: 180px;
  224. height: calc(100% - 100px);
  225. min-height: 500px;
  226. z-index: 999;
  227. display: inline-block;
  228. border-radius: 5px;
  229. overflow: hidden;
  230. }
  231. .item {
  232. margin: 5px 20%;
  233. float: left;
  234. }
  235. .item p {
  236. margin: 0;
  237. font-size: 15px;
  238. }
  239. .active {
  240. color: #108b70;
  241. }
  242. .bottom >>> .el-menu-item.is-active {
  243. background: #3d67bc !important;
  244. }
  245. .tac >>> .el-col-12 {
  246. width: 100%;
  247. }
  248. .tac >>> .el-menu {
  249. border-right: none;
  250. }
  251. .tac >>> .el-menu-item {
  252. display: flex;
  253. justify-content: center;
  254. align-items: center;
  255. }
  256. .img {
  257. width: 20px;
  258. padding-right: 5px;
  259. padding-bottom: 3px;
  260. }
  261. .img > img {
  262. width: 100%;
  263. height: 100%;
  264. }
  265. </style>