curriculumList_gym.vue 9.9 KB

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