curriculumList_gym.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. <!--
  2. * @FileDescription: 管乐迷课表list
  3. * @Author: 黄琪勇
  4. * @Date:2024-03-29 15:29:06
  5. -->
  6. <template>
  7. <div class="curriculumList_gym" v-for="item in props.curriculumData" :key="item.id" @click="handleClickDetail(item.id, item.teachMode)">
  8. <div class="head">
  9. <div class="timeBox">
  10. <img class="timeImg" src="@/img/curriculum/sj.png" />
  11. <div class="time">
  12. {{ item.classDate && format(item.classDate) }} {{ item.startClassTime && format(item.startClassTime, "hh:ii") }}-{{
  13. item.endClassTime && format(item.endClassTime, "hh:ii")
  14. }}
  15. </div>
  16. </div>
  17. <div class="operateBox">
  18. <template v-if="item.status === 'UNDERWAY' && !item.coursewareDetailId && item.teachMode !== 'ONLINE'">
  19. <img class="dangerImg" src="@/img/curriculum/jg.png" />
  20. <div class="operateBtn" @click.stop="handleSetUpCourseware(item.id, item.teachMode)">配置课件</div>
  21. </template>
  22. <template v-else-if="item.status === 'NOT_START'">
  23. <div class="noStart">未开始</div>
  24. </template>
  25. <template v-else-if="item.status === 'UNDERWAY'">
  26. <div class="ing">进行中</div>
  27. </template>
  28. <template v-else>
  29. <div class="end">已结束</div>
  30. </template>
  31. </div>
  32. </div>
  33. <div class="curriculumName">
  34. <div class="leftCon">
  35. <img class="xxImg" :src="item.teachMode === 'ONLINE' ? require('@/img/curriculum/xs.png') : require('@/img/curriculum/xx.png')" />
  36. <img class="typeImg" :src="require(`@/img/curriculum/${classImgType[item.type as keyof typeof classImgType]}.png`)" />
  37. <div class="className">
  38. <ellipsisScroll :title="`${classNameType[item.type as keyof typeof classNameType]}·${item.name}`" />
  39. </div>
  40. </div>
  41. <div class="rightCon">
  42. <img
  43. :src="
  44. item.signInStatusEnum === 1
  45. ? require('@/img/curriculum/qd1.png')
  46. : item.signInStatusEnum === 0
  47. ? require('@/img/curriculum/qd2.png')
  48. : require('@/img/curriculum/qd.png')
  49. "
  50. />
  51. <div :class="[item.signInStatusEnum === 1 ? 'signIn' : item.signInStatusEnum === 0 && 'abnormalSignIn']">
  52. {{ item.signInStatusEnum === 1 ? "正常签到" : item.signInStatusEnum === 0 ? "异常签到" : "未签到" }}
  53. </div>
  54. <img
  55. class="qtImg"
  56. :src="
  57. item.signOutStatusEnum === 1
  58. ? require('@/img/curriculum/qt1.png')
  59. : item.signOutStatusEnum === 0
  60. ? require('@/img/curriculum/qt2.png')
  61. : require('@/img/curriculum/qt.png')
  62. "
  63. />
  64. <div :class="[item.signOutStatusEnum === 1 ? 'signOut' : item.signOutStatusEnum === 0 && 'abnormalSignOut']">
  65. {{ item.signOutStatusEnum === 1 ? "正常签退" : item.signOutStatusEnum === 0 ? "异常签退" : "未签退" }}
  66. </div>
  67. </div>
  68. </div>
  69. <div class="endCon">
  70. <div class="addressCon">
  71. <div class="adressBox">
  72. <div>上课地点:</div>
  73. <div class="adress">
  74. <ellipsisScroll :title="item.teachMode === 'ONLINE' ? '网络教室' : item.schoolName" />
  75. </div>
  76. </div>
  77. <div class="adressBox">
  78. <div>上课学生:</div>
  79. <div class="adress">
  80. <ellipsisScroll :title="item.studentNames" />
  81. </div>
  82. </div>
  83. </div>
  84. <div class="btnGoClass" v-if="item.status === 'UNDERWAY'" @click.stop="handleStartClass(item.id, item.teachMode)">开始上课</div>
  85. <div class="btnDetail" v-else @click.stop="handleClickDetail(item.id, item.teachMode)">
  86. <div>查看详情</div>
  87. <img class="jtImg" src="@/img/curriculum/jt.png" />
  88. </div>
  89. </div>
  90. </div>
  91. </template>
  92. <script setup lang="ts">
  93. import { format } from "@/libs/tools"
  94. import { useCurriculumDetail, useSetUpCourseware } from "../../index"
  95. import { handleStartClass_gym, isONLINE_gym } from "@/views/curriculum/hooks/useStartClass"
  96. import { classImgType, classNameType } from "@/views/curriculum/type"
  97. const props = defineProps<{
  98. curriculumData: any[]
  99. }>()
  100. const emits = defineEmits<{
  101. (e: "update"): void
  102. }>()
  103. //查看详情
  104. function handleClickDetail(id: string, teachMode: string) {
  105. if (isONLINE_gym(teachMode)) {
  106. return
  107. }
  108. useCurriculumDetail(id)
  109. }
  110. // 开始上课
  111. function handleStartClass(id: string, teachMode: string) {
  112. if (isONLINE_gym(teachMode)) {
  113. return
  114. }
  115. handleStartClass_gym(id)
  116. }
  117. // 配置课表
  118. function handleSetUpCourseware(id: string, teachMode: string) {
  119. if (isONLINE_gym(teachMode)) {
  120. return
  121. }
  122. useSetUpCourseware(id, () => {
  123. emits("update")
  124. })
  125. }
  126. </script>
  127. <style lang="scss" scoped>
  128. .curriculumList_gym {
  129. background: #ffffff;
  130. border-radius: 35px;
  131. padding: 0 30px;
  132. margin-bottom: 18px;
  133. cursor: pointer;
  134. &:last-child {
  135. margin-bottom: 0;
  136. }
  137. .head {
  138. padding: 20px 0 16px 0;
  139. border-bottom: 1px solid #eaeaea;
  140. display: flex;
  141. justify-content: space-between;
  142. align-items: center;
  143. .timeBox {
  144. display: flex;
  145. align-items: center;
  146. .timeImg {
  147. width: 24px;
  148. height: 24px;
  149. }
  150. .time {
  151. margin-left: 6px;
  152. font-weight: 500;
  153. font-size: 22px;
  154. color: #777777;
  155. }
  156. }
  157. .operateBox {
  158. display: flex;
  159. align-items: center;
  160. .dangerImg {
  161. width: 22px;
  162. height: 22px;
  163. }
  164. .operateBtn {
  165. margin-left: 8px;
  166. font-weight: 500;
  167. font-size: 20px;
  168. color: #f44541;
  169. cursor: pointer;
  170. &:hover {
  171. opacity: $opacity-hover;
  172. }
  173. }
  174. .noStart {
  175. font-weight: 500;
  176. font-size: 20px;
  177. color: #777777;
  178. }
  179. .ing {
  180. font-weight: 500;
  181. font-size: 20px;
  182. color: #f67146;
  183. }
  184. .end {
  185. font-weight: 500;
  186. font-size: 20px;
  187. color: #aaaaaa;
  188. }
  189. }
  190. }
  191. .curriculumName {
  192. margin-top: 30px;
  193. display: flex;
  194. justify-content: space-between;
  195. align-items: center;
  196. .leftCon {
  197. flex-grow: 1;
  198. display: flex;
  199. align-items: center;
  200. overflow: hidden;
  201. .xxImg {
  202. flex-shrink: 0;
  203. width: 46px;
  204. height: 24px;
  205. }
  206. .typeImg {
  207. flex-shrink: 0;
  208. margin-left: 6px;
  209. width: 55px;
  210. height: 24px;
  211. }
  212. .className {
  213. flex-grow: 1;
  214. overflow: hidden;
  215. margin-left: 6px;
  216. font-weight: 600;
  217. font-size: 24px;
  218. color: #333333;
  219. }
  220. }
  221. .rightCon {
  222. display: flex;
  223. align-items: center;
  224. flex-shrink: 0;
  225. & > img {
  226. width: 22px;
  227. height: 22px;
  228. }
  229. & > div {
  230. margin-left: 6px;
  231. font-weight: 500;
  232. font-size: 20px;
  233. color: #aaaaaa;
  234. &.signIn,
  235. &.signOut {
  236. color: #01c199;
  237. }
  238. &.abnormalSignIn,
  239. &.abnormalSignOut {
  240. color: #ff0000;
  241. }
  242. }
  243. .qtImg {
  244. margin-left: 34px;
  245. }
  246. }
  247. }
  248. .endCon {
  249. margin-top: 26px;
  250. display: flex;
  251. justify-content: space-between;
  252. align-items: center;
  253. padding-bottom: 22px;
  254. .addressCon {
  255. flex-grow: 1;
  256. overflow: hidden;
  257. padding-right: 56px;
  258. & > div {
  259. font-weight: 500;
  260. font-size: 16px;
  261. color: #777777;
  262. }
  263. & > div:nth-child(2) {
  264. margin-top: 16px;
  265. }
  266. .adressBox {
  267. display: flex;
  268. align-items: center;
  269. & > div:nth-child(1) {
  270. flex-shrink: 0;
  271. }
  272. .adress {
  273. flex-grow: 1;
  274. overflow: hidden;
  275. }
  276. }
  277. }
  278. .btnGoClass {
  279. flex-shrink: 0;
  280. font-weight: 500;
  281. font-size: 20px;
  282. color: #ffffff;
  283. padding: 11px 14px;
  284. background: #ff8057;
  285. border-radius: 21px;
  286. text-align: center;
  287. cursor: pointer;
  288. &:hover {
  289. opacity: $opacity-hover;
  290. }
  291. }
  292. .btnDetail {
  293. flex-shrink: 0;
  294. display: flex;
  295. align-items: center;
  296. cursor: pointer;
  297. &:hover {
  298. opacity: $opacity-hover;
  299. }
  300. & > div {
  301. font-weight: 500;
  302. font-size: 20px;
  303. color: #f67146;
  304. }
  305. .jtImg {
  306. margin-left: 6px;
  307. width: 6px;
  308. height: 13px;
  309. }
  310. }
  311. }
  312. }
  313. </style>