InvigilationStudent.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. <template>
  2. <div :class="classes">
  3. <div class="student-video" title="点击放大播放" @click="toLargeView">
  4. <flv-media
  5. ref="ThirdViewVideo"
  6. :live-url="data.liveUrl"
  7. v-if="data.liveUrl"
  8. ></flv-media>
  9. </div>
  10. <div class="student-info">
  11. <div class="student-info-header">
  12. <h6 class="student-info-name">
  13. <span>{{ data.name }}</span
  14. ><i class="icon icon-net-break"></i>
  15. </h6>
  16. <div class="student-info-tips">
  17. <div
  18. :class="['student-info-audio', { 'is-active': !this.muted }]"
  19. @click="toMuted"
  20. >
  21. <i class="icon icon-audio"></i>
  22. </div>
  23. <div class="student-info-time">
  24. <i class="icon icon-alarm-clock"></i>
  25. <span>{{ data.remainTime }}</span>
  26. </div>
  27. </div>
  28. </div>
  29. <div class="student-info-body">
  30. <div class="student-info-content">
  31. <p>证件号:{{ data.identity }}</p>
  32. <p>答题进度:{{ data.progress || 0 }}%</p>
  33. </div>
  34. <div class="student-info-detail">
  35. <el-button type="primary" size="mini" round @click="toDetail"
  36. >详情</el-button
  37. >
  38. </div>
  39. </div>
  40. </div>
  41. <!-- InvigilationStudentMediaDialog -->
  42. <InvigilationStudentMediaDialog
  43. ref="InvigilationStudentMediaDialog"
  44. :data="data"
  45. destroy-on-close
  46. @close="dialogClose"
  47. />
  48. </div>
  49. </template>
  50. <script>
  51. import FlvMedia from "./FlvMedia";
  52. import InvigilationStudentMediaDialog from "./InvigilationStudentMediaDialog.vue";
  53. export default {
  54. name: "invigilation-student",
  55. components: { FlvMedia, InvigilationStudentMediaDialog },
  56. props: {
  57. data: {
  58. type: Object,
  59. default() {
  60. return {};
  61. },
  62. },
  63. },
  64. data() {
  65. return {
  66. muted: true,
  67. };
  68. },
  69. computed: {
  70. classes() {
  71. return [
  72. "invigilation-student",
  73. {
  74. "invigilation-student-breach": !this.data.breachStatus,
  75. "invigilation-student-netbreak": this.data.statusCode === "BREAK_OFF",
  76. },
  77. ];
  78. },
  79. },
  80. methods: {
  81. toDetail() {
  82. this.$router.push({
  83. name: "WarningDetail",
  84. params: { recordId: this.data.examRecordId },
  85. });
  86. },
  87. toLargeView() {
  88. this.muted = true;
  89. this.$emit("muted", false);
  90. this.$refs.ThirdViewVideo.destroyPlayer();
  91. this.$refs.InvigilationStudentMediaDialog.open();
  92. },
  93. toMuted() {
  94. console.log(this.muted);
  95. const nextMuted = !this.muted;
  96. this.$emit("muted", nextMuted);
  97. const res = this.mutedPlayer(nextMuted);
  98. if (res) this.muted = nextMuted;
  99. },
  100. mutedPlayer(muted) {
  101. return this.$refs.ThirdViewVideo.mutedPlayer(muted);
  102. },
  103. dialogClose() {
  104. this.$refs.ThirdViewVideo.reloadVideo();
  105. },
  106. },
  107. };
  108. </script>
  109. <style lang="scss" scoped>
  110. .invigilation-student {
  111. padding: 10px;
  112. position: relative;
  113. margin-bottom: 20px;
  114. border: 1px solid #f0f4f9;
  115. border-radius: 10px;
  116. &-breach {
  117. &::before {
  118. content: "";
  119. display: block;
  120. position: absolute;
  121. top: 0;
  122. left: 0;
  123. width: 50px;
  124. height: 50px;
  125. background-image: url(../../../assets/bg-discipline.png);
  126. background-size: 100% 100%;
  127. z-index: 99;
  128. }
  129. &::after {
  130. content: "";
  131. display: block;
  132. position: absolute;
  133. top: 4px;
  134. right: 4px;
  135. width: 12px;
  136. height: 12px;
  137. border: 2px solid #fff;
  138. border-radius: 50%;
  139. background: #fe5863;
  140. z-index: 99;
  141. }
  142. }
  143. &-netbreak {
  144. .icon-net-break {
  145. display: inline-block !important;
  146. }
  147. .student-time {
  148. background-color: #fe5863 !important;
  149. }
  150. }
  151. &-none {
  152. height: 100%;
  153. background: #606060;
  154. border-radius: 6px;
  155. font-size: 50px;
  156. text-align: center;
  157. padding-top: 90px;
  158. color: #202b4b;
  159. }
  160. }
  161. .student-video {
  162. height: 150px;
  163. border-radius: 6px;
  164. background: #626a82;
  165. margin-bottom: 15px;
  166. position: relative;
  167. cursor: pointer;
  168. // &::before {
  169. // content: "";
  170. // display: block;
  171. // position: absolute;
  172. // top: 50%;
  173. // left: 50%;
  174. // width: 32px;
  175. // height: 20px;
  176. // margin-left: -16px;
  177. // margin-top: -10px;
  178. // background-image: url(../../../assets/icon-video.png);
  179. // background-size: 100% 100%;
  180. // }
  181. }
  182. .student-info {
  183. position: relative;
  184. padding: 0 10px 10px;
  185. &-header {
  186. display: flex;
  187. justify-content: space-between;
  188. align-items: center;
  189. margin-bottom: 5px;
  190. }
  191. &-audio {
  192. display: inline-block;
  193. vertical-align: middle;
  194. width: 24px;
  195. height: 24px;
  196. text-align: center;
  197. line-height: 24px;
  198. background: #abb8c9;
  199. border-radius: 50%;
  200. margin-right: 5px;
  201. cursor: pointer;
  202. &:hover {
  203. background: #1886fe;
  204. }
  205. &.is-active {
  206. background: #1886fe;
  207. }
  208. .icon {
  209. width: 14px;
  210. height: 12px;
  211. margin-top: -2px;
  212. }
  213. }
  214. &-time {
  215. display: inline-block;
  216. vertical-align: middle;
  217. height: 24px;
  218. padding: 4px 12px;
  219. border-radius: 12px;
  220. background: #abb8c9;
  221. color: #fff;
  222. line-height: 16px;
  223. font-size: 12px;
  224. > i {
  225. margin-right: 5px;
  226. width: 12px;
  227. height: 12px;
  228. }
  229. > span {
  230. display: inline-block;
  231. vertical-align: middle;
  232. }
  233. }
  234. &-name {
  235. font-size: 18px;
  236. margin-bottom: 0;
  237. > .icon {
  238. margin-top: -4px;
  239. margin-left: 8px;
  240. display: none;
  241. }
  242. }
  243. &-body {
  244. display: flex;
  245. justify-content: space-between;
  246. align-items: center;
  247. }
  248. &-content {
  249. flex-grow: 2;
  250. overflow: hidden;
  251. > p {
  252. font-size: 14px;
  253. font-weight: 400;
  254. color: #626a82;
  255. line-height: 20px;
  256. margin: 0;
  257. white-space: nowrap;
  258. overflow: hidden;
  259. text-overflow: ellipsis;
  260. }
  261. }
  262. &-detail {
  263. margin-left: 5px;
  264. flex-grow: 0;
  265. flex-shrink: 0;
  266. }
  267. }
  268. </style>