curriculum_gyt.vue 6.5 KB

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