classmenu.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <template>
  2. <div id="classmenu">
  3. <van-row>
  4. <van-col :span="24" class="style">
  5. <van-col :span="24" class="top">
  6. <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
  7. </van-col>
  8. <!-- <el-col :span="24">
  9. <el-image :src="topImage"></el-image>
  10. </el-col> -->
  11. <van-col :span="24">
  12. <el-col :span="8" class="list" v-for="(item, index) in menuList" :key="index" @click.native="turnTo(item.name)">
  13. <i :class="item.icon"></i>
  14. <p>{{ item.name }}</p>
  15. </el-col>
  16. </van-col>
  17. </van-col>
  18. </van-row>
  19. </div>
  20. </template>
  21. <script>
  22. import NavBar from '@/layout/common/topInfo.vue';
  23. import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
  24. export default {
  25. name: 'classmenu',
  26. props: {},
  27. components: { NavBar },
  28. data: () => ({
  29. title: '',
  30. isleftarrow: '',
  31. navShow: true,
  32. menuList: [
  33. { name: '课程信息', icon: 'iconfont iconkecheng' },
  34. { name: '个人信息', icon: 'iconfont icongeren' },
  35. { name: '问卷调查', icon: 'iconfont icondibudaohanglan-' },
  36. { name: '班级信息', icon: 'iconfont iconbanjixinxi' },
  37. { name: '班级名单', icon: 'iconfont iconmingdan' },
  38. { name: '班级成绩', icon: 'iconfont iconchengji' },
  39. { name: '请假管理', icon: 'iconfont iconqingjia' },
  40. { name: '考勤管理', icon: 'iconfont iconkaoqin' },
  41. { name: '学生评分', icon: 'iconfont iconpingfenqia' },
  42. { name: '学生作业', icon: 'iconfont iconxueshengzuoye' },
  43. ],
  44. topImage: require('@/assets/logo.png'),
  45. }),
  46. created() {},
  47. computed: {
  48. ...mapState(['user', 'classid']),
  49. },
  50. methods: {
  51. turnTo(name) {
  52. if (name === '课程信息') this.$router.push({ path: '/home/index' });
  53. if (name === '个人信息') this.$router.push({ path: '/user/personalDetail', query: { id: this.user.userid } });
  54. if (name === '问卷调查') this.$router.push({ path: '/question/index' });
  55. if (name === '班级信息') this.$router.push({ path: '/user/classInfos' });
  56. if (name === '班级名单') this.$router.push({ path: '/class/classStuList', query: { id: this.classid } });
  57. if (name === '班级成绩') this.$router.push({ path: '/class/achieve', query: { classid: this.classid } });
  58. if (name === '请假管理') this.$router.push({ path: '/user/teaLeave' });
  59. if (name === '考勤管理') this.$router.push({ path: '/user/attendance' });
  60. if (name === '学生评分') this.$router.push({ path: '/user/score' });
  61. if (name === '学生作业') this.$router.push({ path: '/task/index' });
  62. },
  63. },
  64. mounted() {
  65. this.title = this.$route.meta.title;
  66. this.isleftarrow = this.$route.meta.isleftarrow;
  67. },
  68. watch: {
  69. $route(to, from) {
  70. this.title = to.meta.title;
  71. this.isleftarrow = to.meta.isleftarrow;
  72. },
  73. },
  74. };
  75. </script>
  76. <style lang="less" scoped>
  77. .style {
  78. width: 100%;
  79. min-height: 667px;
  80. position: relative;
  81. background-color: #f9fafc;
  82. }
  83. .top {
  84. height: 46px;
  85. overflow: hidden;
  86. }
  87. .main {
  88. min-height: 570px;
  89. }
  90. .list {
  91. text-align: center;
  92. background-color: #fff;
  93. margin: 15px 10px 0 10px;
  94. width: 27%;
  95. border-radius: 5px;
  96. padding: 15px 0 0 0;
  97. .iconfont {
  98. font-size: 40px;
  99. }
  100. p {
  101. font-size: 16px;
  102. font-family: 楷体;
  103. font-weight: bold;
  104. }
  105. }
  106. .list:first-child {
  107. .iconfont {
  108. color: #f55467;
  109. }
  110. p {
  111. color: #f55467;
  112. }
  113. }
  114. .list:nth-child(2) {
  115. .iconfont {
  116. color: #f7b52c;
  117. }
  118. p {
  119. color: #f7b52c;
  120. }
  121. }
  122. .list:nth-child(3) {
  123. .iconfont {
  124. color: #6cd4f5;
  125. }
  126. p {
  127. color: #6cd4f5;
  128. }
  129. }
  130. .list:nth-child(4) {
  131. .iconfont {
  132. color: #40cc93;
  133. }
  134. p {
  135. color: #40cc93;
  136. }
  137. }
  138. .list:nth-child(5) {
  139. .iconfont {
  140. color: #3259ce;
  141. }
  142. p {
  143. color: #3259ce;
  144. }
  145. }
  146. .list:nth-child(6) {
  147. .iconfont {
  148. color: #a49273;
  149. }
  150. p {
  151. color: #a49273;
  152. }
  153. }
  154. .list:nth-child(7) {
  155. .iconfont {
  156. color: #ff8a65;
  157. }
  158. p {
  159. color: #ff8a65;
  160. }
  161. }
  162. .list:nth-child(8) {
  163. .iconfont {
  164. color: #ff5f7a;
  165. }
  166. p {
  167. color: #ff5f7a;
  168. }
  169. }
  170. .list:nth-child(9) {
  171. .iconfont {
  172. color: #0590df;
  173. }
  174. p {
  175. color: #0590df;
  176. }
  177. }
  178. .list:nth-child(10) {
  179. .iconfont {
  180. color: #f3dd24;
  181. }
  182. p {
  183. color: #f3dd24;
  184. }
  185. }
  186. </style>