|
@@ -242,14 +242,16 @@ export default {
|
|
|
|
|
|
onOperation({ type, data }) {
|
|
|
const newData = { ...data, examStudentName: data.name };
|
|
|
- if (["video", "answer"].includes(type)) {
|
|
|
+ if (["video"].includes(type)) {
|
|
|
this.operationStudent["talk"] = newData;
|
|
|
+ } else if (["answer"].includes(type)) {
|
|
|
+ const backSource = this.communicationList.find(
|
|
|
+ (talk) => talk.examRecordId == data.examRecordId
|
|
|
+ );
|
|
|
+ return backSource && this.onBackCall(backSource);
|
|
|
} else {
|
|
|
this.operationStudent[type] = newData;
|
|
|
}
|
|
|
- if (type === "answer") {
|
|
|
- this.onBackCall(newData);
|
|
|
- }
|
|
|
const operationMap = {
|
|
|
message: this.toSendTextMsg,
|
|
|
voice: this.toSendAudioMsg,
|
|
@@ -292,6 +294,7 @@ export default {
|
|
|
|
|
|
/** 发起视频/语音通话 */
|
|
|
toTalk(isVideo = false) {
|
|
|
+ this.talking.isVideo = isVideo;
|
|
|
this.$refs.talkDialog.open(isVideo);
|
|
|
},
|
|
|
|
|
@@ -303,23 +306,27 @@ export default {
|
|
|
},
|
|
|
|
|
|
/** 通话中事件... */
|
|
|
- onTalking({ examRecordId, talking }) {
|
|
|
+ async onTalking({ examRecordId, talking }) {
|
|
|
if (this.operationStudent["back-call"]) {
|
|
|
/** 回拨类型 */
|
|
|
if (talking) {
|
|
|
- communicationCalling({
|
|
|
+ await communicationCalling({
|
|
|
recordId: this.operationStudent["back-call"].examRecordId,
|
|
|
source: this.operationStudent["back-call"].source,
|
|
|
});
|
|
|
} else {
|
|
|
- communicationOver({
|
|
|
+ await communicationOver({
|
|
|
recordId: this.operationStudent["back-call"].examRecordId,
|
|
|
source: this.operationStudent["back-call"].source,
|
|
|
});
|
|
|
this.operationStudent["back-call"] = {};
|
|
|
}
|
|
|
+ this.refreshList();
|
|
|
}
|
|
|
- this.talking.examRecordId = talking ? examRecordId : "";
|
|
|
+ this.talking = {
|
|
|
+ examRecordId: talking ? examRecordId : "",
|
|
|
+ isVideo: talking ? this.talking.isVideo : false,
|
|
|
+ };
|
|
|
},
|
|
|
|
|
|
/** 是否预警状态 */
|