attendance.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <template>
  2. <div id="attendance">
  3. <el-select v-model="value" placeholder="请选择" @change="filterDate">
  4. <el-option v-for="(item, index) in options" :key="index" :label="item" :value="item"> </el-option>
  5. </el-select>
  6. <el-table :data="tableData" border style="width: 100%">
  7. <el-table-column prop="date" label="日期"> </el-table-column>
  8. <el-table-column prop="time" label="时间"> </el-table-column>
  9. <el-table-column prop="name" label="姓名"> </el-table-column>
  10. <el-table-column align="center" label="类型">
  11. <template slot-scope="scope">
  12. <span>{{ scope.row.type === '0' ? '上课考勤' : scope.row.type === '1' ? '寝室考勤' : '' }}</span>
  13. </template>
  14. </el-table-column>
  15. <el-table-column align="center" label="状态">
  16. <template slot-scope="scope">
  17. <span>{{ scope.row.status === '0' ? '未签到' : scope.row.status === '1' ? '已签到' : scope.row.status === '2' ? '迟到' : '' }}</span>
  18. </template>
  19. </el-table-column>
  20. </el-table>
  21. </div>
  22. </template>
  23. <script>
  24. import { mapState, createNamespacedHelpers } from 'vuex';
  25. const { mapActions: attendance } = createNamespacedHelpers('attendance');
  26. const { mapActions: classes } = createNamespacedHelpers('classes');
  27. const moment = require('moment');
  28. export default {
  29. name: 'attendance',
  30. props: {
  31. tableData: { type: Array },
  32. options: { type: Array },
  33. },
  34. components: {},
  35. data: () => ({
  36. value: '',
  37. }),
  38. created() {},
  39. computed: {},
  40. methods: {
  41. filterDate(time) {
  42. this.$emit('filterDate', time);
  43. },
  44. },
  45. };
  46. </script>
  47. <style lang="less" scoped></style>