teaLeave.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <div id="teaLeave">
  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. <teaLeaveList :classList="classList"></teaLeaveList>
  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 teaLeaveList from '@/layout/user/teaLeaveList.vue';
  18. import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
  19. const { mapActions: mapClass } = createNamespacedHelpers('classes');
  20. const { mapActions: mapStudent } = createNamespacedHelpers('student');
  21. export default {
  22. name: 'leave',
  23. props: {},
  24. components: {
  25. NavBar, //头部导航
  26. teaLeaveList, //班主任学生请假列表
  27. },
  28. data: () => ({
  29. classList: [],
  30. title: '',
  31. isleftarrow: '',
  32. navShow: true,
  33. }),
  34. created() {
  35. this.searchInfo();
  36. },
  37. computed: {
  38. ...mapState(['user']),
  39. },
  40. mounted() {
  41. this.title = this.$route.meta.title;
  42. this.isleftarrow = this.$route.meta.isleftarrow;
  43. },
  44. watch: {
  45. $route(to, from) {
  46. this.title = to.meta.title;
  47. this.isleftarrow = to.meta.isleftarrow;
  48. },
  49. },
  50. methods: {
  51. ...mapClass({ classinfo: 'query' }),
  52. ...mapStudent({ stuQuery: 'query', stuFetch: 'fetch' }),
  53. async searchInfo({ ...info } = {}) {
  54. const res = await this.classinfo({ ...info });
  55. var result = res.data.filter(item => item.headteacherid === this.user.userid);
  56. this.$set(this, `classList`, result);
  57. },
  58. },
  59. };
  60. </script>
  61. <style lang="less" scoped>
  62. .style {
  63. width: 100%;
  64. min-height: 667px;
  65. position: relative;
  66. background-color: #f9fafc;
  67. }
  68. .top {
  69. height: 46px;
  70. overflow: hidden;
  71. }
  72. .main {
  73. min-height: 570px;
  74. }
  75. </style>