curriculumList_gyt.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. <!--
  2. * @FileDescription: 管乐团课表list
  3. * @Author: 黄琪勇
  4. * @Date:2024-03-29 15:29:06
  5. -->
  6. <template>
  7. <div class="curriculumList_gyt" v-for="item in props.curriculumData" :key="item.id" @click="handleClickDetail(item.id)">
  8. <div class="head">
  9. <div class="timeBox">
  10. <img class="timeImg" src="@/img/curriculum/sj.png" />
  11. <div class="time">{{ item.classDate && format(item.classDate) }}</div>
  12. </div>
  13. <div class="operateBox">
  14. <template v-if="item.coursewareFlag && !item.lessonCoursewareId && item.status !== 'COMPLETE'">
  15. <img class="dangerImg" src="@/img/curriculum/jg.png" />
  16. <div class="operateBtn" @click.stop="handleSetUpCourseware(item.id)">配置课件</div>
  17. </template>
  18. <template v-else-if="item.status === 'NOT_START'">
  19. <div class="noStart">未开始</div>
  20. </template>
  21. <template v-else-if="item.status === 'ING'">
  22. <div class="ing">进行中</div>
  23. </template>
  24. <template v-else>
  25. <div class="end">已结束</div>
  26. </template>
  27. </div>
  28. </div>
  29. <div class="curriculumName">
  30. <div class="leftCon">{{ item.startTime && format(item.startTime, "hh:ii") }}-{{ item.endTime && format(item.endTime, "hh:ii") }}</div>
  31. <div class="rightCon">
  32. <img :src="item.signIn ? require('@/img/curriculum/qd1.png') : require('@/img/curriculum/qd.png')" />
  33. <div :class="{ signIn: item.signIn }">{{ item.signIn ? "已签到" : "未签到" }}</div>
  34. <img class="qtImg" :src="item.signOut ? require('@/img/curriculum/qt1.png') : require('@/img/curriculum/qt.png')" />
  35. <div :class="{ signOut: item.signOut }">{{ item.signOut ? "已签退" : "未签退" }}</div>
  36. </div>
  37. </div>
  38. <div class="endCon">
  39. <div class="addressCon">
  40. <div class="adressBox"><ellipsisScroll :title="`${item.className}-${item.teacherName}`" /></div>
  41. <div><ellipsisScroll :title="item.orchestraName" /></div>
  42. </div>
  43. <div class="btnGoClass" v-if="item.status === 'ING'" @click.stop="handleStartClass(item.id)">开始上课</div>
  44. <div class="btnDetail" v-else @click.stop="handleClickDetail(item.id)">
  45. <div>查看详情</div>
  46. <img class="jtImg" src="@/img/curriculum/jt.png" />
  47. </div>
  48. </div>
  49. </div>
  50. </template>
  51. <script setup lang="ts">
  52. import { format } from "@/libs/tools"
  53. import { useCurriculumDetail, useSetUpCourseware } from "@/views/curriculum"
  54. import { handleStartClass_gyt } from "@/views/curriculum/hooks/useStartClass"
  55. const emits = defineEmits<{
  56. (e: "update"): void
  57. }>()
  58. const props = defineProps<{
  59. curriculumData: any[]
  60. }>()
  61. // 开始上课
  62. function handleStartClass(id: string) {
  63. handleStartClass_gyt(id)
  64. }
  65. //查看详情
  66. function handleClickDetail(id: string) {
  67. useCurriculumDetail(id)
  68. }
  69. // 配置课表
  70. function handleSetUpCourseware(id: string) {
  71. useSetUpCourseware(id, () => {
  72. emits("update")
  73. })
  74. }
  75. </script>
  76. <style lang="scss" scoped>
  77. .curriculumList_gyt {
  78. background: #ffffff;
  79. border-radius: 35px;
  80. padding: 0 30px;
  81. margin-bottom: 18px;
  82. cursor: pointer;
  83. &:last-child {
  84. margin-bottom: 0;
  85. }
  86. .head {
  87. padding: 20px 0 16px 0;
  88. border-bottom: 1px solid #eaeaea;
  89. display: flex;
  90. justify-content: space-between;
  91. align-items: center;
  92. .timeBox {
  93. display: flex;
  94. align-items: center;
  95. .timeImg {
  96. width: 24px;
  97. height: 24px;
  98. }
  99. .time {
  100. margin-left: 6px;
  101. font-weight: 500;
  102. font-size: 22px;
  103. color: #777777;
  104. }
  105. }
  106. .operateBox {
  107. display: flex;
  108. align-items: center;
  109. .dangerImg {
  110. width: 22px;
  111. height: 22px;
  112. }
  113. .operateBtn {
  114. margin-left: 8px;
  115. font-weight: 500;
  116. font-size: 20px;
  117. color: #f44541;
  118. cursor: pointer;
  119. &:hover {
  120. opacity: $opacity-hover;
  121. }
  122. }
  123. .noStart {
  124. font-weight: 500;
  125. font-size: 20px;
  126. color: #777777;
  127. }
  128. .ing {
  129. font-weight: 500;
  130. font-size: 20px;
  131. color: #f67146;
  132. }
  133. .end {
  134. font-weight: 500;
  135. font-size: 20px;
  136. color: #aaaaaa;
  137. }
  138. }
  139. }
  140. .curriculumName {
  141. margin-top: 24px;
  142. display: flex;
  143. justify-content: space-between;
  144. align-items: center;
  145. .leftCon {
  146. flex-grow: 1;
  147. font-family: DINAlternate, DINAlternate;
  148. font-weight: bold;
  149. font-size: 38px;
  150. color: #333333;
  151. overflow: hidden;
  152. }
  153. .rightCon {
  154. display: flex;
  155. align-items: center;
  156. flex-shrink: 0;
  157. & > img {
  158. width: 22px;
  159. height: 22px;
  160. }
  161. & > div {
  162. margin-left: 6px;
  163. font-weight: 500;
  164. font-size: 20px;
  165. color: #aaaaaa;
  166. &.signIn,
  167. &.signOut {
  168. color: #01c199;
  169. }
  170. }
  171. .qtImg {
  172. margin-left: 34px;
  173. }
  174. }
  175. }
  176. .endCon {
  177. margin-top: 18px;
  178. display: flex;
  179. justify-content: space-between;
  180. align-items: center;
  181. padding-bottom: 22px;
  182. .addressCon {
  183. flex-grow: 1;
  184. overflow: hidden;
  185. & > div {
  186. font-weight: 500;
  187. font-size: 16px;
  188. color: #777777;
  189. }
  190. & > div:nth-child(2) {
  191. margin-right: 116px;
  192. overflow: hidden;
  193. margin-top: 12px;
  194. }
  195. .adressBox {
  196. margin-right: 56px;
  197. overflow: hidden;
  198. font-weight: 600;
  199. font-size: 20px;
  200. color: #333333;
  201. }
  202. }
  203. .btnGoClass {
  204. flex-shrink: 0;
  205. font-weight: 500;
  206. font-size: 20px;
  207. color: #ffffff;
  208. padding: 11px 14px;
  209. background: #ff8057;
  210. border-radius: 21px;
  211. text-align: center;
  212. cursor: pointer;
  213. &:hover {
  214. opacity: $opacity-hover;
  215. }
  216. }
  217. .btnDetail {
  218. flex-shrink: 0;
  219. display: flex;
  220. align-items: center;
  221. cursor: pointer;
  222. &:hover {
  223. opacity: $opacity-hover;
  224. }
  225. & > div {
  226. font-weight: 500;
  227. font-size: 20px;
  228. color: #f67146;
  229. }
  230. .jtImg {
  231. margin-left: 6px;
  232. width: 6px;
  233. height: 13px;
  234. }
  235. }
  236. }
  237. }
  238. </style>