curriculumList_gyt.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  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, item.applyStatus)">
  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, item.applyStatus)">
  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 useDialogConfirm from "@/hooks/useDialogConfirm"
  53. import { format } from "@/libs/tools"
  54. import { useCurriculumDetail, useSetUpCourseware } from "@/views/curriculum"
  55. import { handleStartClass_gyt } from "@/views/curriculum/hooks/useStartClass"
  56. import { ElMessage } from "element-plus"
  57. const emits = defineEmits<{
  58. (e: "update"): void
  59. }>()
  60. const props = defineProps<{
  61. curriculumData: any[]
  62. }>()
  63. // 开始上课
  64. function handleStartClass(id: string) {
  65. handleStartClass_gyt(id)
  66. }
  67. //查看详情
  68. function handleClickDetail(id: string, applyStatus: boolean) {
  69. if (!applyStatus) {
  70. useDialogConfirm({
  71. headImg: require("@/img/curriculum/ts4.png"),
  72. text: `该资源已失效`,
  73. btnShow: [true]
  74. })
  75. return
  76. }
  77. useCurriculumDetail(id)
  78. }
  79. // 配置课表
  80. function handleSetUpCourseware(id: string) {
  81. useSetUpCourseware(id, () => {
  82. emits("update")
  83. })
  84. }
  85. </script>
  86. <style lang="scss" scoped>
  87. .curriculumList_gyt {
  88. background: #ffffff;
  89. border-radius: 35px;
  90. padding: 0 30px;
  91. margin-bottom: 18px;
  92. cursor: pointer;
  93. &:last-child {
  94. margin-bottom: 0;
  95. }
  96. .head {
  97. padding: 20px 0 16px 0;
  98. border-bottom: 1px solid #eaeaea;
  99. display: flex;
  100. justify-content: space-between;
  101. align-items: center;
  102. .timeBox {
  103. display: flex;
  104. align-items: center;
  105. .timeImg {
  106. width: 24px;
  107. height: 24px;
  108. }
  109. .time {
  110. margin-left: 6px;
  111. font-weight: 500;
  112. font-size: 22px;
  113. color: #777777;
  114. }
  115. }
  116. .operateBox {
  117. display: flex;
  118. align-items: center;
  119. .dangerImg {
  120. width: 22px;
  121. height: 22px;
  122. }
  123. .operateBtn {
  124. margin-left: 8px;
  125. font-weight: 500;
  126. font-size: 20px;
  127. color: #f44541;
  128. cursor: pointer;
  129. &:hover {
  130. opacity: $opacity-hover;
  131. }
  132. }
  133. .noStart {
  134. font-weight: 500;
  135. font-size: 20px;
  136. color: #777777;
  137. }
  138. .ing {
  139. font-weight: 500;
  140. font-size: 20px;
  141. color: #f67146;
  142. }
  143. .end {
  144. font-weight: 500;
  145. font-size: 20px;
  146. color: #aaaaaa;
  147. }
  148. }
  149. }
  150. .curriculumName {
  151. margin-top: 24px;
  152. display: flex;
  153. justify-content: space-between;
  154. align-items: center;
  155. .leftCon {
  156. flex-grow: 1;
  157. font-family: DINAlternate, DINAlternate;
  158. font-weight: bold;
  159. font-size: 38px;
  160. color: #333333;
  161. overflow: hidden;
  162. }
  163. .rightCon {
  164. display: flex;
  165. align-items: center;
  166. flex-shrink: 0;
  167. & > img {
  168. width: 22px;
  169. height: 22px;
  170. }
  171. & > div {
  172. margin-left: 6px;
  173. font-weight: 500;
  174. font-size: 20px;
  175. color: #aaaaaa;
  176. &.signIn,
  177. &.signOut {
  178. color: #01c199;
  179. }
  180. }
  181. .qtImg {
  182. margin-left: 34px;
  183. }
  184. }
  185. }
  186. .endCon {
  187. margin-top: 18px;
  188. display: flex;
  189. justify-content: space-between;
  190. align-items: center;
  191. padding-bottom: 22px;
  192. .addressCon {
  193. flex-grow: 1;
  194. overflow: hidden;
  195. & > div {
  196. font-weight: 500;
  197. font-size: 16px;
  198. color: #777777;
  199. }
  200. & > div:nth-child(2) {
  201. margin-right: 116px;
  202. overflow: hidden;
  203. margin-top: 12px;
  204. }
  205. .adressBox {
  206. margin-right: 56px;
  207. overflow: hidden;
  208. font-weight: 600;
  209. font-size: 20px;
  210. color: #333333;
  211. }
  212. }
  213. .btnGoClass {
  214. flex-shrink: 0;
  215. font-weight: 500;
  216. font-size: 20px;
  217. color: #ffffff;
  218. padding: 11px 14px;
  219. background: #ff8057;
  220. border-radius: 21px;
  221. text-align: center;
  222. cursor: pointer;
  223. &:hover {
  224. opacity: $opacity-hover;
  225. }
  226. }
  227. .btnDetail {
  228. flex-shrink: 0;
  229. display: flex;
  230. align-items: center;
  231. cursor: pointer;
  232. &:hover {
  233. opacity: $opacity-hover;
  234. }
  235. & > div {
  236. font-weight: 500;
  237. font-size: 20px;
  238. color: #f67146;
  239. }
  240. .jtImg {
  241. margin-left: 6px;
  242. width: 6px;
  243. height: 13px;
  244. }
  245. }
  246. }
  247. }
  248. </style>