TaskList.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <template>
  2. <div class="tasks">
  3. <div class="tasks-top">
  4. <el-calendar v-model="date" />
  5. <div class="tasks-top-notification">
  6. <div class="tasks-top-notification-title">
  7. <div>
  8. <svg-icon icon-class="tasks-notification" />
  9. <span class="title">任务通知</span>
  10. </div>
  11. <div></div>
  12. </div>
  13. <div class="tasks-top-notification-container"></div>
  14. </div>
  15. </div>
  16. <div class="tasks-container">
  17. <div class="tasks-container-title">
  18. <div class="tasks-container-title-left">
  19. <svg-icon icon-class="clock" />
  20. <span class="title">时间轴</span>
  21. <span class="date">{{ dateTime }}</span>
  22. <i class="el-icon-arrow-left" @click="dateSkip(-1)" />
  23. <i class="el-icon-arrow-right" @click="dateSkip(1)" />
  24. </div>
  25. <div>
  26. <el-select v-model="selected"></el-select>
  27. </div>
  28. </div>
  29. <div class="tasks-container-main">
  30. <div v-for="(item, i) in task_group_list" :key="i" class="tasks-group">
  31. <div class="tasks-group-top">
  32. <span class="tasks-group-top-time">{{ item.begin_time_view_text }}</span>
  33. <span class="tasks-group-top-line"></span>
  34. </div>
  35. <div class="tasks-group-list">
  36. <div v-for="list in item.task_list" :key="list.id" class="tasks-group-list-info">
  37. <div class="tasks-group-list-info-name">
  38. {{ timeType(list.time_type) }}任务:{{ list.name }}
  39. </div>
  40. <div class="tasks-group-list-info-item-name">{{ list.cs_item_name }}</div>
  41. <div class="tasks-group-list-info-time">{{ list.time_space_view_txt }}</div>
  42. <div></div>
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. </template>
  50. <script>
  51. import { getMyTaskListDateTeacher } from '@/api/table';
  52. import { parseTime, formatDate } from '@/utils';
  53. export default {
  54. name: 'TaskList',
  55. data() {
  56. return {
  57. date: new Date(),
  58. selected: '',
  59. task_group_list: []
  60. };
  61. },
  62. computed: {
  63. dateTime: {
  64. get: function () {
  65. return parseTime(this.date, '{m}-{d}');
  66. },
  67. set: function (newValue) {
  68. this.date = newValue;
  69. this.getTaskList();
  70. }
  71. }
  72. },
  73. mounted() {
  74. this.getTaskList();
  75. },
  76. methods: {
  77. timeType(type) {
  78. switch (type) {
  79. case 0:
  80. return '课前';
  81. case 1:
  82. return '课中';
  83. case 2:
  84. return '课后';
  85. default:
  86. return '';
  87. }
  88. },
  89. dateSkip(num) {
  90. let day = 24 * 60 * 60 * 1000 * num;
  91. this.date = new Date(this.date.getTime() + day);
  92. },
  93. getTaskList() {
  94. getMyTaskListDateTeacher({ date_stamp: formatDate(this.date) }).then(response => {
  95. this.task_group_list = response.task_group_list;
  96. });
  97. },
  98. // 跳转到讲次详情
  99. routerPush(id) {
  100. this.$router.push({ path: `/cs_item_detail/index/${id}` });
  101. }
  102. }
  103. };
  104. </script>
  105. <style lang="scss">
  106. .tasks {
  107. &-top {
  108. display: flex;
  109. justify-content: space-between;
  110. .el-calendar {
  111. width: 334px;
  112. height: 300px;
  113. &__header .el-button {
  114. padding: 7px 10px;
  115. }
  116. &-table div.el-calendar-day {
  117. height: 29px;
  118. }
  119. &__body {
  120. thead th {
  121. padding: 0 0 4px 0;
  122. }
  123. }
  124. }
  125. &-notification {
  126. background-color: #fff;
  127. flex: 1;
  128. height: 300px;
  129. margin-left: 16px;
  130. padding: 20px 24px;
  131. &-title {
  132. height: 56px;
  133. }
  134. }
  135. }
  136. &-container {
  137. margin: 16px 0;
  138. border-radius: 8px;
  139. width: 100%;
  140. min-height: calc(100vh - 515px);
  141. background-color: #fff;
  142. &-title {
  143. display: flex;
  144. justify-content: space-between;
  145. padding: 16px;
  146. &-left {
  147. line-height: 40px;
  148. .title {
  149. margin-left: 8px;
  150. }
  151. .date {
  152. margin-left: 24px;
  153. color: #a6a6a6;
  154. vertical-align: middle;
  155. }
  156. .el-icon-arrow-right {
  157. cursor: pointer;
  158. }
  159. .el-icon-arrow-left {
  160. @extend .el-icon-arrow-right;
  161. margin: 0 26px 0 33px;
  162. }
  163. }
  164. }
  165. &-main {
  166. margin: 0 24px 8px 40px;
  167. .tasks-group {
  168. margin-top: 8px;
  169. &-top {
  170. display: flex;
  171. justify-content: space-between;
  172. align-items: center;
  173. &-time {
  174. color: #808080;
  175. }
  176. &-line {
  177. width: calc(100% - 78px);
  178. height: 1px;
  179. background-color: #d9d9d9;
  180. }
  181. }
  182. &-list {
  183. margin-left: 78px;
  184. &-info {
  185. display: inline-block;
  186. padding: 16px 24px;
  187. border: 1px solid #ccc;
  188. border-radius: 8px;
  189. margin-right: 15px;
  190. background-color: #fff4e3;
  191. > div {
  192. margin: 8px 0;
  193. }
  194. &-item-name {
  195. font-size: 14px;
  196. color: #727280;
  197. }
  198. &-time {
  199. font-size: 14px;
  200. }
  201. }
  202. }
  203. }
  204. }
  205. }
  206. }
  207. </style>