Quellcode durchsuchen

feat: 视频操作按钮控制

chenhao vor 2 Jahren
Ursprung
Commit
47a298eb3d

+ 19 - 14
src/features/invigilation/RealtimeMonitoring/RealtimeMonitoringFull.vue

@@ -101,6 +101,7 @@ import AudioRecordDialog from "./audioRecord/AudioRecordDialog";
 import { debounce } from "lodash-es";
 import IntervalMixin from "./mixins/IntervalMixin";
 import axios from "axios";
+
 const DESIGN_WIDTH = 1920;
 const DESIGN_HEIGHT = 1080;
 
@@ -311,26 +312,30 @@ export default {
 
     /** 通话中事件... */
     async onTalking({ examRecordId, talking }) {
-      if (this.operationStudent["back-call"]) {
+      if (this.operationStudent["back-call"]?.examRecordId) {
         /** 回拨类型 */
-        if (talking) {
-          await communicationCalling({
-            recordId: this.operationStudent["back-call"].examRecordId,
-            source: this.operationStudent["back-call"].source,
-          });
-        } else {
-          await communicationOver({
-            recordId: this.operationStudent["back-call"].examRecordId,
-            source: this.operationStudent["back-call"].source,
-          });
-          this.operationStudent["back-call"] = {};
+        try {
+          if (talking) {
+            await communicationCalling({
+              recordId: this.operationStudent["back-call"].examRecordId,
+              source: this.operationStudent["back-call"].source,
+            });
+          } else {
+            await communicationOver({
+              recordId: this.operationStudent["back-call"].examRecordId,
+              source: this.operationStudent["back-call"].source,
+            });
+            this.operationStudent["back-call"] = {};
+          }
+        } catch (error) {
+          console.error(error);
         }
         this.refreshList();
       }
-      this.talking = {
+      Object.assign(this.talking, {
         examRecordId: talking ? examRecordId : "",
         isVideo: talking ? this.talking.isVideo : false,
-      };
+      });
     },
 
     /** 是否预警状态 */

+ 4 - 1
src/features/invigilation/RealtimeMonitoring/components/InvigilationStudentFull.vue

@@ -129,7 +129,10 @@ export default {
       if (type === "sound") {
         return this.$refs.ThirdViewVideo?.videoMuted();
       }
-      if (["talk", "video", "answer"].includes(type) && this.disabled) {
+      if (
+        ["talk", "video", "answer"].includes(type) &&
+        (this.disabled || this.talkingType === type)
+      ) {
         return;
       }
       this.$emit("operation", { type, data: this.data });