OldTaskList.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <div>
  3. <ul v-for="({ task_list, date_stamp }, i) in taskGroupList" :key="i" class="task-list">
  4. <li v-if="timeUnit === 'MONTH'" class="date-stamp">
  5. {{ date_stamp }}
  6. </li>
  7. <li
  8. v-for="{
  9. id,
  10. cs_item_name,
  11. time_type,
  12. course_id: cid,
  13. course_name,
  14. teaching_type,
  15. time_space_view_txt,
  16. name
  17. } in task_list"
  18. :key="id"
  19. class="task-item"
  20. :style="getItemStyle(cid)"
  21. @click="taskLink_outside(id)"
  22. >
  23. <div class="task-item-top">
  24. <svg-icon icon-class="arrival" :style="getItemIconStyle(cid)" />
  25. <span class="cs-item-name">
  26. {{ cs_item_name }} - {{ name }}
  27. <span v-if="teaching_type === 10" class="enter-live" @click.stop="taskLink(teaching_type, id)">
  28. {{ $t('Key616') }} >
  29. </span>
  30. </span>
  31. <span
  32. class="task-button"
  33. :style="{ 'background-color': buttonColorList.get(time_type) }"
  34. @click.stop="taskLink(teaching_type, id)"
  35. >
  36. {{ $t(getTimeTypeName(time_type)) }}{{ $t('Key289') }}
  37. </span>
  38. </div>
  39. <div class="task-item-bottom">
  40. <div>
  41. {{ course_name }}
  42. </div>
  43. <div class="time-txt">
  44. {{ time_space_view_txt }}
  45. </div>
  46. </div>
  47. </li>
  48. </ul>
  49. </div>
  50. </template>
  51. <script setup>
  52. import { inject } from 'vue';
  53. import { useTaskItem, useTaskLink, buttonColorList, getTimeTypeName } from './TaskList';
  54. import { useRouter } from 'vue-router/composables';
  55. defineProps({
  56. timeUnit: {
  57. type: undefined,
  58. required: true
  59. },
  60. taskGroupList: {
  61. type: Array,
  62. required: true
  63. }
  64. });
  65. const $t = inject('$t');
  66. let { getItemStyle, getItemIconStyle } = useTaskItem();
  67. const router = useRouter();
  68. let { taskLink, taskLink_outside } = useTaskLink(router);
  69. </script>
  70. <style lang="scss" scoped>
  71. .task-list {
  72. li.date-stamp {
  73. margin-top: 16px;
  74. margin-bottom: -8px;
  75. font-weight: 700;
  76. }
  77. .task-item {
  78. padding: 16px 24px;
  79. margin-top: 16px;
  80. cursor: pointer;
  81. border-radius: 8px;
  82. &-top {
  83. display: flex;
  84. margin-bottom: 8px;
  85. .cs-item-name {
  86. flex: 1;
  87. margin-left: 10px;
  88. .enter-live {
  89. margin-left: 12px;
  90. color: #808080;
  91. }
  92. }
  93. .task-button {
  94. padding: 4px 8px;
  95. color: #fff;
  96. border-radius: 8px;
  97. }
  98. }
  99. &-bottom {
  100. font-size: 14px;
  101. color: #808080;
  102. .time-txt {
  103. margin-top: 8px;
  104. color: #000;
  105. }
  106. }
  107. }
  108. }
  109. </style>