mainData.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <div id="mainData">
  3. <el-row>
  4. <el-col :span="24">
  5. <el-col :span="24" class="beijing">
  6. <el-row type="flex">
  7. <el-col :span="4" v-for="(i, index) in arrange" :key="index" @click.native="changeLesson(i)">
  8. <el-row style="text-align:center">
  9. <el-col :span="24">{{ i.day }}</el-col>
  10. <el-col :span="24">{{ i.date | getMD }}</el-col>
  11. </el-row>
  12. </el-col>
  13. </el-row>
  14. <el-col :span="24" class="top">
  15. <el-col :span="12" class="time">时间</el-col>
  16. <el-col :span="12" class="date">
  17. <el-col :span="24"> {{ today.date }}</el-col>
  18. <el-col :span="24">{{ today.day }}</el-col>
  19. </el-col>
  20. </el-col>
  21. <template v-if="lesson">
  22. <el-col :span="24" class="context" v-for="(item, index) in lesson" :key="index">
  23. <el-col :span="12" class="contexttime">
  24. <span>{{ item.time }}</span>
  25. </el-col>
  26. <el-col :span="12" class="contextclass">
  27. <p>{{ item.subname }}</p>
  28. <p class="title" @click="click(item)">{{ item.teaname }}</p>
  29. </el-col>
  30. <el-col :span="24">
  31. <p></p>
  32. </el-col>
  33. </el-col>
  34. </template>
  35. </el-col>
  36. </el-col>
  37. </el-row>
  38. </div>
  39. </template>
  40. <script>
  41. import { mapActions, mapState, createNamespacedHelpers } from 'vuex';
  42. export default {
  43. name: 'mainData',
  44. props: {
  45. lesson: null,
  46. today: null,
  47. arrange: null,
  48. },
  49. components: {},
  50. data: () => ({}),
  51. created() {},
  52. computed: {
  53. ...mapState(['user']),
  54. },
  55. methods: {
  56. changeLesson(date) {
  57. this.$emit('getLesson', date);
  58. },
  59. click(item) {
  60. this.$router.push({ path: '/home/teacher', query: { teaid: item.teaid, lessonid: item._id } });
  61. },
  62. },
  63. filters: {
  64. getMD(date) {
  65. let arr = date.split('-');
  66. //${arr[1]}-
  67. return `${arr[1]}-${arr[2]}`;
  68. },
  69. },
  70. };
  71. </script>
  72. <style lang="less" scoped>
  73. p {
  74. padding: 0;
  75. margin: 0;
  76. }
  77. .info {
  78. text-align: center;
  79. padding: 7px 0 0 0;
  80. }
  81. .beijing {
  82. background-color: #eee;
  83. min-height: 700px;
  84. }
  85. .top {
  86. margin: 20px 0 0 0;
  87. }
  88. /deep/.el-button {
  89. border-radius: 11px;
  90. padding: 10px 10px 10px 10px;
  91. }
  92. .time {
  93. background-color: #ffffff;
  94. height: 70px;
  95. font-size: 16px;
  96. padding: 0px 0px 0 50px;
  97. line-height: 60px;
  98. color: #222222;
  99. }
  100. .date {
  101. background-color: #ffffff;
  102. height: 70px;
  103. font-size: 16px;
  104. line-height: 30px;
  105. color: #222222;
  106. }
  107. .context {
  108. background-color: #ffffff;
  109. height: 102px;
  110. width: 92%;
  111. margin: 15px 15px 0 15px;
  112. color: #bbbbbb;
  113. }
  114. .contexttime {
  115. padding: 15px 20px 0 20px;
  116. }
  117. .contextclass {
  118. background-color: #ffffff;
  119. }
  120. .contextclass p {
  121. padding: 15px 0 0 0;
  122. text-align: center;
  123. }
  124. .title {
  125. color: blueviolet;
  126. }
  127. </style>