index.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <div id="index">
  3. <el-row>
  4. <el-col :span="24" class="style">
  5. <el-col :span="24" class="top">
  6. <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
  7. </el-col>
  8. <el-col :span="24" class="main">
  9. <el-col :span="24" class="message">
  10. <messageInfo :info="info" :teainfo="teainfo" :jiaoshiinfo="jiaoshiinfo"></messageInfo>
  11. </el-col>
  12. <el-col :span="24" class="clickBtn">
  13. <clickBtn></clickBtn>
  14. </el-col>
  15. </el-col>
  16. <el-col :span="24" class="foot">
  17. <footInfo></footInfo>
  18. </el-col>
  19. </el-col>
  20. </el-row>
  21. </div>
  22. </template>
  23. <script>
  24. import NavBar from '@/layout/common/topInfo.vue';
  25. import footInfo from '@/layout/common/footInfo.vue';
  26. import messageInfo from '@/layout/user/messageInfo.vue';
  27. import clickBtn from '@/layout/user/clickBtn.vue';
  28. import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
  29. const { mapActions: mapDirectors } = createNamespacedHelpers('director');
  30. const { mapActions: mapStudent } = createNamespacedHelpers('student');
  31. const { mapActions: mapTeacher } = createNamespacedHelpers('teacher');
  32. const { mapActions: mapDept } = createNamespacedHelpers('dept');
  33. export default {
  34. name: 'index',
  35. props: {},
  36. components: {
  37. NavBar, //头部导航
  38. footInfo, //底部导航
  39. messageInfo, //个人信息
  40. clickBtn, //功能按钮
  41. },
  42. data: () => ({
  43. info: {},
  44. teainfo: {},
  45. jiaoshiinfo: {},
  46. title: '',
  47. isleftarrow: '',
  48. navShow: true,
  49. }),
  50. created() {
  51. this.searchSite();
  52. },
  53. computed: {
  54. ...mapState(['user']),
  55. },
  56. mounted() {
  57. this.title = this.$route.meta.title;
  58. this.isleftarrow = this.$route.meta.isleftarrow;
  59. },
  60. watch: {
  61. $route(to, from) {
  62. this.title = to.meta.title;
  63. this.isleftarrow = to.meta.isleftarrow;
  64. },
  65. },
  66. methods: {
  67. ...mapDirectors({ directorQuery: 'query', directorFetch: 'fetch' }),
  68. ...mapStudent({ studentQuery: 'query', studentFetch: 'fetch' }),
  69. ...mapTeacher({ teacherlist: 'query', teacherfetch: 'fetch' }),
  70. ...mapDept({ deptFetch: 'fetch' }),
  71. // 查询登录用户信息
  72. async searchSite() {
  73. // 1:班主任,4:学生
  74. const res = await this.studentFetch(this.user.userid);
  75. this.$set(this, `info`, res.data);
  76. },
  77. },
  78. };
  79. </script>
  80. <style lang="less" scoped>
  81. .style {
  82. width: 100%;
  83. min-height: 667px;
  84. position: relative;
  85. background-color: #f9fafc;
  86. }
  87. .top {
  88. height: 46px;
  89. overflow: hidden;
  90. }
  91. .main {
  92. min-height: 570px;
  93. }
  94. .foot {
  95. height: 90px;
  96. overflow: hidden;
  97. }
  98. </style>