zhangjie преди 3 години
родител
ревизия
bfa57e54eb

+ 8 - 0
src/api/invigilation.js

@@ -120,6 +120,14 @@ export function examBatchList(userId) {
     : `?type=${type}`;
   return httpApp.post("/api/admin/sys/exam/query" + paramQuery);
 }
+// 批次下考场列表
+export function examRoomList(batchCode) {
+  return httpApp.post(
+    "/api/admin/exam/examroom/query",
+    {},
+    { params: { code: batchCode } }
+  );
+}
 // 监考老师::根据权限获取场次和考场接口
 export function examActivityRoomList(examId) {
   const data = pickBy({ examId }, paramFilter);

+ 36 - 8
src/features/invigilation/RealtimeMonitoring/RealtimeMonitoring.vue

@@ -36,11 +36,6 @@
     <div class="part-filter part-filter-realtime">
       <div class="part-filter-form">
         <el-form inline>
-          <el-form-item>
-            <div :title="curExamBatch.roomName">
-              <el-input v-model="curExamBatch.roomName" readonly></el-input>
-            </div>
-          </el-form-item>
           <el-form-item>
             <div @click="$refs.ExamBatchDialog.open()">
               <el-input
@@ -52,6 +47,23 @@
               ></el-input>
             </div>
           </el-form-item>
+          <el-form-item>
+            <el-select
+              v-model="filter.roomCode"
+              class="size-select"
+              placeholder="考场"
+              @change="examRoomChange"
+            >
+              <el-option
+                v-for="item in examRooms"
+                :key="item.roomCode"
+                :label="item.roomName"
+                :value="item.roomCode"
+              >
+                <span>{{ item.roomName }}</span>
+              </el-option>
+            </el-select>
+          </el-form-item>
         </el-form>
         <div class="part-filter-form-action">
           <text-clock></text-clock>
@@ -317,6 +329,7 @@
 <script>
 import {
   invigilateVideoList,
+  examRoomList,
   invigilateExamFinish,
   monitorCallCount,
   invigilationWarningMessage,
@@ -350,9 +363,9 @@ export default {
   data() {
     return {
       initExamid: this.$route.params.examId,
-      initRoomCode: this.$route.params.roomCode,
       filter: {
         examId: "",
+        roomCode: "",
         paperDownload: null,
         status: null,
         monitorStatusSource: null,
@@ -387,6 +400,7 @@ export default {
       subjects: [],
       pageType: "0",
       dataList: [],
+      examRooms: [],
       videoSourceStatusParams: {
         CLIENT_CAMERA: "cameraMonitorStatusSource",
         CLIENT_SCREEN: "screenMonitorStatusSource",
@@ -416,7 +430,7 @@ export default {
     },
     async timerUpdatePage() {
       this.clearLoopSetTs();
-      if (!this.loopRunning) return;
+      if (!this.loopRunning || !this.filter.examId) return;
 
       let fetchAll = [this.getList()];
       if (this.$refs.SummaryLine)
@@ -462,13 +476,26 @@ export default {
       this.curViewingAngle = this.viewingAngles[0] || {};
       this.filter.monitorVideoSource = this.curViewingAngle.code || "";
 
+      this.filter.roomCode = "";
+      this.getExamRooms();
+    },
+    async getExamRooms() {
+      this.examRooms = [];
+      if (!this.curExamBatch.code) return;
+      const res = await examRoomList(this.curExamBatch.code);
+      this.examRooms = res.data.data || [];
+
+      this.filter.roomCode = this.examRooms[0] && this.examRooms[0].roomCode;
+      this.examRoomChange();
+    },
+    examRoomChange() {
       this.toSearch();
 
       this.getMonitorCallCount();
       this.fetchWarningNotice();
 
       // 正在考试的考试,开启定时更新;
-      if (examBatch.isExaming) {
+      if (this.curExamBatch.isExaming) {
         this.loopRunning = true;
         this.clearLoopSetTs();
         this.loopSetTs.push(
@@ -617,6 +644,7 @@ export default {
         name: "VideoCommunication",
         params: {
           examId: this.filter.examId,
+          roomCode: this.filter.roomCode,
         },
       });
     },

+ 2 - 0
src/features/invigilation/RealtimeMonitoring/VideoCommunication.vue

@@ -84,6 +84,7 @@ export default {
   data() {
     return {
       examId: this.$route.params.examId,
+      roomCode: this.$route.params.roomCode,
       callStatus: "START",
       students: [],
       current: 1,
@@ -114,6 +115,7 @@ export default {
 
       const res = await communicationList({
         examId: this.examId,
+        roomCode: this.roomCode,
         callStatus: this.callStatus,
         pageNumber: this.current,
         pageSize: this.size,

+ 1 - 1
src/router/invigilation.js

@@ -60,7 +60,7 @@ const routes = [
       ),
   },
   {
-    path: "video-communication/:examId",
+    path: "video-communication/:examId/:roomCode?",
     name: "VideoCommunication",
     component: () =>
       import(

+ 5 - 1
src/views/Layout/components/NavBar.vue

@@ -48,7 +48,7 @@
     </div>
 
     <!-- ResetPwd -->
-    <reset-pwd ref="ResetPwd"></reset-pwd>
+    <reset-pwd ref="ResetPwd" @confirm="pwdModified"></reset-pwd>
   </div>
 </template>
 
@@ -123,6 +123,10 @@ export default {
     toResetPwd() {
       this.$refs.ResetPwd.open();
     },
+    pwdModified() {
+      this.$store.commit("invigilation/setSelectedExamId", null);
+      this.logout("?cause=重置密码");
+    },
     async toLogout() {
       const result = await this.$confirm("确定要退出登录吗?", "退出确认", {
         confirmButtonText: "确定",

+ 1 - 0
src/views/Layout/components/ResetPwd.vue

@@ -118,6 +118,7 @@ export default {
       this.isSubmit = false;
       this.$message.success("修改成功!");
       this.cancel();
+      this.$emit("confirm");
     },
   },
 };