mainData.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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" class="arrangeList" 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">
  29. <span @click="click(item)">{{ item.teaname }}</span>
  30. </p>
  31. </el-col>
  32. <el-col :span="24">
  33. <p></p>
  34. </el-col>
  35. </el-col>
  36. </template>
  37. </el-col>
  38. </el-col>
  39. </el-row>
  40. </div>
  41. </template>
  42. <script>
  43. import { mapActions, mapState, createNamespacedHelpers } from 'vuex';
  44. export default {
  45. name: 'mainData',
  46. props: {
  47. lesson: null,
  48. today: null,
  49. arrange: null,
  50. },
  51. components: {},
  52. data: () => ({}),
  53. created() {},
  54. computed: {
  55. ...mapState(['user']),
  56. },
  57. methods: {
  58. changeLesson(date) {
  59. this.$emit('getLesson', date);
  60. },
  61. click(item) {
  62. this.$router.push({ path: 'teacherscore/index', query: { teaid: item.teaid, lessonid: item._id } });
  63. },
  64. },
  65. filters: {
  66. getMD(date) {
  67. let arr = date.split('-');
  68. //${arr[1]}-
  69. return `${arr[1]}-${arr[2]}`;
  70. },
  71. },
  72. };
  73. </script>
  74. <style lang="less" scoped>
  75. p {
  76. padding: 0;
  77. margin: 0;
  78. }
  79. .info {
  80. text-align: center;
  81. padding: 7px 0 0 0;
  82. }
  83. .beijing {
  84. background-color: #f9fafc;
  85. }
  86. .top {
  87. margin: 10px 0 0 0;
  88. }
  89. /deep/.el-button {
  90. border-radius: 11px;
  91. padding: 10px 10px 10px 10px;
  92. }
  93. .time {
  94. background-color: #ffffff;
  95. height: 70px;
  96. font-size: 16px;
  97. padding: 0px 0px 0 50px;
  98. line-height: 60px;
  99. color: #222222;
  100. }
  101. .date {
  102. background-color: #ffffff;
  103. height: 70px;
  104. font-size: 16px;
  105. line-height: 30px;
  106. color: #222222;
  107. }
  108. .context {
  109. background-color: #ffffff;
  110. height: 102px;
  111. width: 92%;
  112. margin: 15px 15px 0 15px;
  113. color: #bbbbbb;
  114. }
  115. .contexttime {
  116. padding: 15px 20px 0 20px;
  117. }
  118. .contextclass {
  119. background-color: #ffffff;
  120. }
  121. .contextclass p {
  122. padding: 15px 0 0 0;
  123. text-align: center;
  124. }
  125. .title {
  126. color: blueviolet;
  127. }
  128. .arrangeList {
  129. background: #fff;
  130. padding: 10px 0;
  131. border-right: 1px dashed #f5f5f5;
  132. }
  133. .arrangeList:last-child {
  134. border-right: none;
  135. }
  136. </style>