Преглед на файлове

feat: 回拨时要修改通话申请里面的状态

chenhao преди 2 години
родител
ревизия
ccc3de10ce

+ 22 - 4
src/features/invigilation/RealtimeMonitoring/RealtimeMonitoringFull.vue

@@ -84,6 +84,8 @@ import {
   invigilateExamFinish,
   invigilationWarningMessage,
   communicationList,
+  communicationCalling,
+  communicationOver,
 } from "@/api/invigilation";
 
 import { mapState, mapMutations, mapActions } from "vuex";
@@ -136,6 +138,7 @@ export default {
         message: {},
         voice: {},
         talk: {},
+        "back-call": {},
       },
       /** 通话中 */
       talking: {
@@ -237,15 +240,15 @@ export default {
     },
 
     onOperation({ type, data }) {
-      if (type === "video") {
+      if (type === "video" || type === "back-call") {
         this.operationStudent["talk"] = data;
-      } else {
-        this.operationStudent[type] = data;
       }
+      this.operationStudent[type] = data;
       const operationMap = {
         message: this.toSendTextMsg,
         voice: this.toSendAudioMsg,
         talk: () => this.toTalk(),
+        "back-call": () => this.toTalk(),
         video: () => this.toTalk(true),
       };
       this.$nextTick(() => {
@@ -289,11 +292,26 @@ export default {
 
     /** 回拨 */
     onBackCall(data) {
-      this.onOperation({ type: "talk", data });
+      this.onOperation({ type: "back-call", data });
     },
 
     /** 通话中事件... */
     onTalking({ examRecordId, talking }) {
+      if (this.operationStudent["back-call"]) {
+        /** 回拨类型 */
+        if (talking) {
+          communicationCalling({
+            recordId: this.operationStudent["back-call"].examRecordId,
+            source: this.operationStudent["back-call"].source,
+          });
+        } else {
+          communicationOver({
+            recordId: this.operationStudent["back-call"].examRecordId,
+            source: this.operationStudent["back-call"].source,
+          });
+          this.operationStudent["back-call"] = {};
+        }
+      }
       this.talking.examRecordId = talking ? examRecordId : "";
     },
 

+ 0 - 2
src/features/invigilation/RealtimeMonitoring/components/EarlyWarningList.vue

@@ -19,10 +19,8 @@
 </template>
 
 <script>
-import IntervalMixin from "../mixins/IntervalMixin";
 export default {
   name: "EarlyWarningList",
-  mixins: [IntervalMixin],
   props: {
     list: {
       type: Array,

+ 0 - 2
src/features/invigilation/RealtimeMonitoring/components/RequestCallList.vue

@@ -31,10 +31,8 @@
 
 <script>
 import { communicationOver } from "@/api/invigilation";
-import IntervalMixin from "../mixins/IntervalMixin";
 export default {
   name: "RequestCallList",
-  mixin: [IntervalMixin],
   props: {
     list: {
       type: Array,