RealtimeMonitoringFullHeader.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <template>
  2. <div class="full-view-header">
  3. <div class="esc-back" @click="$emit('back')">
  4. <span class="icon icon-back"></span>
  5. <span class="esc">ESC返回</span>
  6. </div>
  7. <div class="filter-form">
  8. <el-form inline>
  9. <el-form-item class="exam-select">
  10. <div @click="$refs.ExamBatchDialog.open()">
  11. <el-input
  12. v-model="curExamBatch.label"
  13. placeholder="请选择批次"
  14. suffix-icon="el-icon-arrow-down"
  15. readonly
  16. ></el-input>
  17. </div>
  18. </el-form-item>
  19. <el-form-item class="exam-room-select">
  20. <el-select v-model="filter.roomCode" placeholder="考场">
  21. <el-option
  22. v-for="item in examRooms"
  23. :key="item.roomCode"
  24. :label="item.roomName"
  25. :value="item.roomCode"
  26. >
  27. <span>{{ item.roomName }}</span>
  28. </el-option>
  29. </el-select>
  30. </el-form-item>
  31. <el-form-item v-if="viewingAngles.length" class="media-source-select">
  32. <el-select v-model="filter.monitorVideoSource" placeholder="视频源">
  33. <el-option
  34. v-for="item in viewingAngles"
  35. :key="item.code"
  36. :label="item.name"
  37. :value="item.code"
  38. >
  39. <span>{{ item.name }}</span>
  40. </el-option>
  41. </el-select>
  42. </el-form-item>
  43. </el-form>
  44. </div>
  45. <div class="current-date-time">
  46. <TextClock :showIcon="false" :showApm="false" />
  47. </div>
  48. <!-- 考试批次选择 -->
  49. <exam-batch-dialog
  50. @confirm="examChange"
  51. ref="ExamBatchDialog"
  52. ></exam-batch-dialog>
  53. </div>
  54. </template>
  55. <script>
  56. import { examActivityRoomList } from "@/api/invigilation";
  57. import { VIDEO_SOURCE_TYPE } from "@/constant/constants";
  58. import ExamBatchDialog from "../ExamBatchDialog";
  59. import TextClock from "../../common/TextClock";
  60. export default {
  61. name: "RealtimeMonitoringFullHeader",
  62. components: {
  63. TextClock,
  64. ExamBatchDialog,
  65. },
  66. data() {
  67. return {
  68. /** 筛选条件 */
  69. filter: {
  70. examId: "",
  71. roomCode: "",
  72. monitorVideoSource: "",
  73. monitorStatus: "",
  74. },
  75. /** 考场列表 */
  76. examRooms: [],
  77. /** 视频源 */
  78. viewingAngles: [],
  79. /** 当前考试批次 */
  80. curExamBatch: {},
  81. };
  82. },
  83. watch: {
  84. filter: {
  85. handler() {
  86. this.$emit("filterChange", this.filter);
  87. },
  88. deep: true,
  89. },
  90. "filter.examId": {
  91. handler: "getExamRooms",
  92. immediate: true,
  93. },
  94. },
  95. methods: {
  96. examChange(examBatch) {
  97. if (!examBatch) return;
  98. this.curExamBatch = examBatch;
  99. if (examBatch.monitorVideoSource) {
  100. this.viewingAngles = examBatch.monitorVideoSource
  101. .split(",")
  102. .map((item) => {
  103. return {
  104. code: item,
  105. name: VIDEO_SOURCE_TYPE[item],
  106. };
  107. });
  108. } else {
  109. this.viewingAngles = [];
  110. }
  111. this.filter.examId = examBatch.id;
  112. this.filter.monitorStatus = examBatch.monitorStatus;
  113. this.filter.monitorVideoSource = this.viewingAngles?.[0]?.code ?? "";
  114. },
  115. async getExamRooms() {
  116. this.examRooms = [];
  117. if (!this.curExamBatch.id) return;
  118. const res = await examActivityRoomList(this.curExamBatch.id);
  119. this.examRooms = res.data.data.examRooms ?? [];
  120. this.filter.roomCode = this.examRooms[0]?.roomCode;
  121. },
  122. },
  123. };
  124. </script>
  125. <style lang="scss" scoped>
  126. .full-view-header {
  127. display: flex;
  128. align-items: center;
  129. justify-content: space-between;
  130. padding: 14px 20px;
  131. .esc-back {
  132. display: flex;
  133. align-items: center;
  134. cursor: pointer;
  135. &:hover {
  136. filter: brightness(1.2);
  137. }
  138. .icon {
  139. width: 24px;
  140. height: 24px;
  141. }
  142. .esc {
  143. font-size: 14px;
  144. color: #fff;
  145. font-weight: bold;
  146. margin-left: 10px;
  147. }
  148. }
  149. ::v-deep .filter-form {
  150. .exam-select {
  151. .el-input {
  152. min-width: 450px;
  153. .el-input__icon {
  154. line-height: 40px;
  155. }
  156. }
  157. }
  158. .exam-room-select {
  159. width: 200px;
  160. }
  161. .media-source-select {
  162. width: 160px;
  163. }
  164. .el-form-item {
  165. margin-bottom: 0;
  166. }
  167. .el-input {
  168. .el-input__icon {
  169. line-height: 32px;
  170. }
  171. .el-input__inner {
  172. height: 36px;
  173. background: rgba(66, 66, 69, 0);
  174. color: #a1a8b3;
  175. border-radius: 10px;
  176. border: 2px solid #3f444d;
  177. }
  178. }
  179. }
  180. .current-date-time {
  181. font-size: 12px;
  182. font-weight: bold;
  183. color: #a1a8b3;
  184. }
  185. }
  186. </style>