stuDetail.vue 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <div id="personalDetail">
  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. <studentteainfo :messInfo="messInfo" :teainfo="teainfo"></studentteainfo>
  10. </el-col>
  11. </el-col>
  12. </el-row>
  13. </div>
  14. </template>
  15. <script>
  16. import NavBar from '@/layout/common/topInfo.vue';
  17. import studentteainfo from '@/layout/class/studentteainfo.vue';
  18. import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
  19. const { mapActions: mapDirectors } = createNamespacedHelpers('director');
  20. const { mapActions: mapStudent } = createNamespacedHelpers('student');
  21. const { mapActions: mapteacher } = createNamespacedHelpers('teacher');
  22. const { mapActions: mapDept } = createNamespacedHelpers('dept');
  23. export default {
  24. name: 'personalDetail',
  25. props: {},
  26. components: {
  27. NavBar, //头部导航
  28. studentteainfo, //学生详细信息
  29. },
  30. data: () => ({
  31. messInfo: {},
  32. teainfo: {},
  33. stulist: {},
  34. title: '',
  35. isleftarrow: '',
  36. navShow: true,
  37. jianshiinfo: {},
  38. }),
  39. created() {
  40. this.searchInfo();
  41. },
  42. computed: {
  43. id() {
  44. return this.$route.query.id;
  45. },
  46. ...mapState(['user']),
  47. },
  48. mounted() {
  49. this.title = this.$route.meta.title;
  50. this.isleftarrow = this.$route.meta.isleftarrow;
  51. },
  52. watch: {
  53. $route(to, from) {
  54. this.title = to.meta.title;
  55. this.isleftarrow = to.meta.isleftarrow;
  56. },
  57. },
  58. methods: {
  59. ...mapDirectors({ directorQuery: 'query', directorFetch: 'fetch' }),
  60. ...mapStudent({ studentQuery: 'query', studentFetch: 'fetch' }),
  61. ...mapDept({ deptFetch: 'fetch' }),
  62. ...mapteacher({ teacherFether: 'fetch' }),
  63. async searchInfo() {
  64. const res = await this.studentFetch(this.id);
  65. this.$set(this, `messInfo`, res.data);
  66. const val = await this.directorFetch(this.id);
  67. if (val.data != null) {
  68. const arr = await this.deptFetch(val.data.department);
  69. val.data.department = arr.data.name;
  70. this.$set(this, `teainfo`, val.data);
  71. }
  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. </style>