|
@@ -691,7 +691,6 @@ export default {
|
|
|
beforeDestroy() {
|
|
beforeDestroy() {
|
|
|
// 断开 WebSocket 连接
|
|
// 断开 WebSocket 连接
|
|
|
if (this.phoneBar) {
|
|
if (this.phoneBar) {
|
|
|
- console.log('[beforeDestroy] 断开 WebSocket 连接');
|
|
|
|
|
this.phoneBar.disconnect();
|
|
this.phoneBar.disconnect();
|
|
|
}
|
|
}
|
|
|
// 移除键盘事件监听
|
|
// 移除键盘事件监听
|
|
@@ -738,13 +737,11 @@ export default {
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
loadWebsocketParam(){
|
|
loadWebsocketParam(){
|
|
|
- console.log('开始用本地参数请求远端接口,分机号:', this.extNum + ",本地配置网关:" + this.myGateway);
|
|
|
|
|
getToolbarBasicParam({ extNum:this.extNum, myGateway: this.myGateway }).then(response => {
|
|
getToolbarBasicParam({ extNum:this.extNum, myGateway: this.myGateway }).then(response => {
|
|
|
if(response.code === 0) {
|
|
if(response.code === 0) {
|
|
|
//设置登陆账号和用户名
|
|
//设置登陆账号和用户名
|
|
|
this.opNum = response.data.opNum;
|
|
this.opNum = response.data.opNum;
|
|
|
this.userName = response.data.userName;
|
|
this.userName = response.data.userName;
|
|
|
- console.log('获取到远端 分机号:', this.extNum + ",登陆账号:" + this.opNum + ",用户名:" + this.userName);
|
|
|
|
|
// 构建配置对象
|
|
// 构建配置对象
|
|
|
const callConfig = {
|
|
const callConfig = {
|
|
|
useDefaultUi: true,
|
|
useDefaultUi: true,
|
|
@@ -755,7 +752,6 @@ export default {
|
|
|
extPassword: response.data.encryptPsw
|
|
extPassword: response.data.encryptPsw
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- console.log('初始化工具条基础配置参数:', callConfig);
|
|
|
|
|
this.phoneBar.initConfig(callConfig);
|
|
this.phoneBar.initConfig(callConfig);
|
|
|
// 建立 WebSocket 连接
|
|
// 建立 WebSocket 连接
|
|
|
this.phoneBar.connect();
|
|
this.phoneBar.connect();
|
|
@@ -778,7 +774,6 @@ export default {
|
|
|
// 监听 ESC 键挂机
|
|
// 监听 ESC 键挂机
|
|
|
this._escKeyHandler = (e) => {
|
|
this._escKeyHandler = (e) => {
|
|
|
if (e.which === 27) {
|
|
if (e.which === 27) {
|
|
|
- console.log('按下了 ESC 键,即将发送挂机指令.');
|
|
|
|
|
if (this.phoneBar && this.phoneBar.getIsConnected()) {
|
|
if (this.phoneBar && this.phoneBar.getIsConnected()) {
|
|
|
const hangUpBtn = document.getElementById('hangUpBtn');
|
|
const hangUpBtn = document.getElementById('hangUpBtn');
|
|
|
if (hangUpBtn && hangUpBtn.classList.contains('on')) {
|
|
if (hangUpBtn && hangUpBtn.classList.contains('on')) {
|
|
@@ -813,7 +808,6 @@ export default {
|
|
|
setupEventListeners() {
|
|
setupEventListeners() {
|
|
|
// websocket 通信对象断开事件
|
|
// websocket 通信对象断开事件
|
|
|
this.phoneBar.on(EventList.WS_DISCONNECTED, (msg) => {
|
|
this.phoneBar.on(EventList.WS_DISCONNECTED, (msg) => {
|
|
|
- console.log("websocket 通信对象断开事件:" + msg);
|
|
|
|
|
this.updatePhoneBar(msg, EventList.WS_DISCONNECTED);
|
|
this.updatePhoneBar(msg, EventList.WS_DISCONNECTED);
|
|
|
this.showTransferArea = false;
|
|
this.showTransferArea = false;
|
|
|
this.showConferenceArea = false;
|
|
this.showConferenceArea = false;
|
|
@@ -833,7 +827,6 @@ export default {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
this.phoneBar.on(EventList.OUTBOUND_START, (msg) => {
|
|
this.phoneBar.on(EventList.OUTBOUND_START, (msg) => {
|
|
|
- console.log('outbound_start 事件:' + msg);
|
|
|
|
|
this.showChatContainer = true;
|
|
this.showChatContainer = true;
|
|
|
this.showCustomerForm = true;
|
|
this.showCustomerForm = true;
|
|
|
this.loadCommunicationHistory();
|
|
this.loadCommunicationHistory();
|
|
@@ -841,7 +834,6 @@ export default {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
this.phoneBar.on(EventList.REQUEST_ARGS_ERROR, (msg) => {
|
|
this.phoneBar.on(EventList.REQUEST_ARGS_ERROR, (msg) => {
|
|
|
- console.log('request_args_error事件:' + msg);
|
|
|
|
|
this.updatePhoneBar(msg, EventList.REQUEST_ARGS_ERROR);
|
|
this.updatePhoneBar(msg, EventList.REQUEST_ARGS_ERROR);
|
|
|
this.callExecuteFailed = true;
|
|
this.callExecuteFailed = true;
|
|
|
this.callFailReason = '请求参数错误';
|
|
this.callFailReason = '请求参数错误';
|
|
@@ -891,35 +883,29 @@ export default {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
this.phoneBar.on(EventList.WS_CONNECTED, (msg) => {
|
|
this.phoneBar.on(EventList.WS_CONNECTED, (msg) => {
|
|
|
- console.log('WebSocket连接成功事件:' + msg);
|
|
|
|
|
this.loginTime = new Date().toLocaleTimeString();
|
|
this.loginTime = new Date().toLocaleTimeString();
|
|
|
this.callStatus = '已签入';
|
|
this.callStatus = '已签入';
|
|
|
this.agentStatus = '忙碌';
|
|
this.agentStatus = '忙碌';
|
|
|
this.updatePhoneBar(msg, EventList.WS_CONNECTED);
|
|
this.updatePhoneBar(msg, EventList.WS_CONNECTED);
|
|
|
this.onlineButtonText = '签出';
|
|
this.onlineButtonText = '签出';
|
|
|
if (this.allowAutoSignIn) {
|
|
if (this.allowAutoSignIn) {
|
|
|
- console.log('[自动签入] WebSocket 连接成功,自动签入完成');
|
|
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
this.phoneBar.on(EventList.CALLEE_RINGING, (msg) => {
|
|
this.phoneBar.on(EventList.CALLEE_RINGING, (msg) => {
|
|
|
- console.log('被叫振铃事件:' + msg.content);
|
|
|
|
|
this.updatePhoneBar(msg, EventList.CALLEE_RINGING);
|
|
this.updatePhoneBar(msg, EventList.CALLEE_RINGING);
|
|
|
this.markExecuteSuccess();
|
|
this.markExecuteSuccess();
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
this.phoneBar.on(EventList.CALLER_ANSWERED, (msg) => {
|
|
this.phoneBar.on(EventList.CALLER_ANSWERED, (msg) => {
|
|
|
- console.log('主叫接通事件:' + msg);
|
|
|
|
|
this.agentStatus = '通话中';
|
|
this.agentStatus = '通话中';
|
|
|
if (msg && msg.object && msg.object.uuid) {
|
|
if (msg && msg.object && msg.object.uuid) {
|
|
|
this.currentCallUuid = msg.object.uuid;
|
|
this.currentCallUuid = msg.object.uuid;
|
|
|
- console.log('[主叫接通] 获取到通话 UUID:', this.currentCallUuid);
|
|
|
|
|
}
|
|
}
|
|
|
this.updatePhoneBar(msg, EventList.CALLER_ANSWERED);
|
|
this.updatePhoneBar(msg, EventList.CALLER_ANSWERED);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
this.phoneBar.on(EventList.CALLER_HANGUP, (msg) => {
|
|
this.phoneBar.on(EventList.CALLER_HANGUP, (msg) => {
|
|
|
- console.log('主叫挂断事件:' + msg);
|
|
|
|
|
this.agentStatus = '通话结束';
|
|
this.agentStatus = '通话结束';
|
|
|
this.canSendVideoReInvite = false;
|
|
this.canSendVideoReInvite = false;
|
|
|
this.canSendVideoFile = false;
|
|
this.canSendVideoFile = false;
|
|
@@ -936,16 +922,13 @@ export default {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
this.phoneBar.on(EventList.CALLEE_ANSWERED, (msg) => {
|
|
this.phoneBar.on(EventList.CALLEE_ANSWERED, (msg) => {
|
|
|
- console.log('被叫接通事件:' + msg);
|
|
|
|
|
if (msg && msg.object && msg.object.uuid) {
|
|
if (msg && msg.object && msg.object.uuid) {
|
|
|
this.currentCallUuid = msg.object.uuid;
|
|
this.currentCallUuid = msg.object.uuid;
|
|
|
- console.log('[被叫接通] 获取到通话 UUID:', this.currentCallUuid);
|
|
|
|
|
}
|
|
}
|
|
|
this.updatePhoneBar(msg, EventList.CALLEE_ANSWERED);
|
|
this.updatePhoneBar(msg, EventList.CALLEE_ANSWERED);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
this.phoneBar.on(EventList.CALLEE_HANGUP, (msg) => {
|
|
this.phoneBar.on(EventList.CALLEE_HANGUP, (msg) => {
|
|
|
- console.log('被叫挂断事件:' + msg);
|
|
|
|
|
this.showTransferArea = false;
|
|
this.showTransferArea = false;
|
|
|
this.showConferenceArea = false;
|
|
this.showConferenceArea = false;
|
|
|
if (msg && msg.object && msg.object.uuid) {
|
|
if (msg && msg.object && msg.object.uuid) {
|
|
@@ -959,7 +942,6 @@ export default {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
this.phoneBar.on(EventList.STATUS_CHANGED, (msg) => {
|
|
this.phoneBar.on(EventList.STATUS_CHANGED, (msg) => {
|
|
|
- console.log('座席状态改变事件:' + msg);
|
|
|
|
|
|
|
|
|
|
// 确保 msg.object 存在才设置
|
|
// 确保 msg.object 存在才设置
|
|
|
if (msg && msg.object) {
|
|
if (msg && msg.object) {
|
|
@@ -971,58 +953,48 @@ export default {
|
|
|
|
|
|
|
|
// 当状态变为忙碌时,表示可以外呼了
|
|
// 当状态变为忙碌时,表示可以外呼了
|
|
|
if (msg.object && msg.object.status === AgentStatusEnum.BUSY) {
|
|
if (msg.object && msg.object.status === AgentStatusEnum.BUSY) {
|
|
|
- console.log('[状态就绪] 坐席已置忙,现在可以外呼了');
|
|
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
this.phoneBar.on(EventList.ACD_GROUP_QUEUE_NUMBER, (msg) => {
|
|
this.phoneBar.on(EventList.ACD_GROUP_QUEUE_NUMBER, (msg) => {
|
|
|
- console.log('当前排队人数消息事件:' + msg);
|
|
|
|
|
this.queueNumber = msg.object.queue_number;
|
|
this.queueNumber = msg.object.queue_number;
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
this.phoneBar.on(EventList.ON_AUDIO_CALL_CONNECTED, (msg) => {
|
|
this.phoneBar.on(EventList.ON_AUDIO_CALL_CONNECTED, (msg) => {
|
|
|
- console.log('音频通话已建立事件:' + msg);
|
|
|
|
|
this.canSendVideoReInvite = true;
|
|
this.canSendVideoReInvite = true;
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
this.phoneBar.on(EventList.CUSTOMER_CHANNEL_HOLD, (msg) => {
|
|
this.phoneBar.on(EventList.CUSTOMER_CHANNEL_HOLD, (msg) => {
|
|
|
- console.log('客户通话已保持事件:' + msg);
|
|
|
|
|
this.callStatus = '通话已保持';
|
|
this.callStatus = '通话已保持';
|
|
|
this.showHoldBtn = false;
|
|
this.showHoldBtn = false;
|
|
|
this.showUnHoldBtn = true;
|
|
this.showUnHoldBtn = true;
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
this.phoneBar.on(EventList.CUSTOMER_CHANNEL_UNHOLD, (msg) => {
|
|
this.phoneBar.on(EventList.CUSTOMER_CHANNEL_UNHOLD, (msg) => {
|
|
|
- console.log('客户通话已接回事件:' + msg);
|
|
|
|
|
this.callStatus = '客户通话已接回';
|
|
this.callStatus = '客户通话已接回';
|
|
|
this.showHoldBtn = true;
|
|
this.showHoldBtn = true;
|
|
|
this.showUnHoldBtn = false;
|
|
this.showUnHoldBtn = false;
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
this.phoneBar.on(EventList.CUSTOMER_ON_HOLD_HANGUP, (msg) => {
|
|
this.phoneBar.on(EventList.CUSTOMER_ON_HOLD_HANGUP, (msg) => {
|
|
|
- console.log('保持的通话已挂机事件:' + msg);
|
|
|
|
|
this.showHoldBtn = true;
|
|
this.showHoldBtn = true;
|
|
|
this.showUnHoldBtn = false;
|
|
this.showUnHoldBtn = false;
|
|
|
this.callStatus = '保持的通话已挂机.';
|
|
this.callStatus = '保持的通话已挂机.';
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
this.phoneBar.on(EventList.ON_VIDEO_CALL_CONNECTED, (msg) => {
|
|
this.phoneBar.on(EventList.ON_VIDEO_CALL_CONNECTED, (msg) => {
|
|
|
- console.log('视频通话已建立事件:' + msg);
|
|
|
|
|
this.canSendVideoFile = true;
|
|
this.canSendVideoFile = true;
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
this.phoneBar.on(EventList.INNER_CONSULTATION_START, (msg) => {
|
|
this.phoneBar.on(EventList.INNER_CONSULTATION_START, (msg) => {
|
|
|
- console.log('咨询开始事件:' + msg);
|
|
|
|
|
this.callStatus = '咨询开始.';
|
|
this.callStatus = '咨询开始.';
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
this.phoneBar.on(EventList.INNER_CONSULTATION_STOP, (msg) => {
|
|
this.phoneBar.on(EventList.INNER_CONSULTATION_STOP, (msg) => {
|
|
|
- console.log('咨询结束事件:' + msg);
|
|
|
|
|
this.callStatus = '咨询结束.';
|
|
this.callStatus = '咨询结束.';
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
this.phoneBar.on(EventList.TRANSFER_CALL_SUCCESS, (msg) => {
|
|
this.phoneBar.on(EventList.TRANSFER_CALL_SUCCESS, (msg) => {
|
|
|
- console.log('电话转接成功事件:' + msg);
|
|
|
|
|
// 转接成功后隐藏转接/咨询区域(与 source 一致)
|
|
// 转接成功后隐藏转接/咨询区域(与 source 一致)
|
|
|
this.showTransferArea = false;
|
|
this.showTransferArea = false;
|
|
|
this.callStatus = '电话转接成功.';
|
|
this.callStatus = '电话转接成功.';
|
|
@@ -1030,7 +1002,6 @@ export default {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
this.phoneBar.on(EventList.AGENT_STATUS_DATA_CHANGED, (msg) => {
|
|
this.phoneBar.on(EventList.AGENT_STATUS_DATA_CHANGED, (msg) => {
|
|
|
- console.log('agent_status_data_changed 事件:' + msg);
|
|
|
|
|
|
|
|
|
|
// 解析并更新坐席列表数据
|
|
// 解析并更新坐席列表数据
|
|
|
if (msg && msg.object) {
|
|
if (msg && msg.object) {
|
|
@@ -1040,7 +1011,6 @@ export default {
|
|
|
if (Array.isArray(agentList)) {
|
|
if (Array.isArray(agentList)) {
|
|
|
// 直接复制完整数据,保留所有字段 (包括姓名、工号、状态等)
|
|
// 直接复制完整数据,保留所有字段 (包括姓名、工号、状态等)
|
|
|
this.allMemberList = [...agentList];
|
|
this.allMemberList = [...agentList];
|
|
|
- console.log('[坐席列表更新] 当前坐席数量:', this.allMemberList.length);
|
|
|
|
|
}
|
|
}
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
|
console.error('解析坐席列表失败:', e);
|
|
console.error('解析坐席列表失败:', e);
|
|
@@ -1055,7 +1025,6 @@ export default {
|
|
|
|
|
|
|
|
// 客户通话等待相关事件
|
|
// 客户通话等待相关事件
|
|
|
this.phoneBar.on(EventList.CUSTOMER_CHANNEL_CALL_WAIT, (msg) => {
|
|
this.phoneBar.on(EventList.CUSTOMER_CHANNEL_CALL_WAIT, (msg) => {
|
|
|
- console.log('客户电话等待中事件:' + msg);
|
|
|
|
|
// 隐藏会议区域和客户信息表单(与 source 一致)
|
|
// 隐藏会议区域和客户信息表单(与 source 一致)
|
|
|
this.showConferenceArea = false;
|
|
this.showConferenceArea = false;
|
|
|
this.showCustomerForm = false;
|
|
this.showCustomerForm = false;
|
|
@@ -1067,7 +1036,6 @@ export default {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
this.phoneBar.on(EventList.CUSTOMER_CHANNEL_OFF_CALL_WAIT, (msg) => {
|
|
this.phoneBar.on(EventList.CUSTOMER_CHANNEL_OFF_CALL_WAIT, (msg) => {
|
|
|
- console.log('等待的电话已接回事件:' + msg);
|
|
|
|
|
// 隐藏转接/咨询区域
|
|
// 隐藏转接/咨询区域
|
|
|
this.showStopCallWait = false;
|
|
this.showStopCallWait = false;
|
|
|
this.showTransferCallWait = false;
|
|
this.showTransferCallWait = false;
|
|
@@ -1076,7 +1044,6 @@ export default {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
this.phoneBar.on(EventList.INNER_CONSULTATION_START, (msg) => {
|
|
this.phoneBar.on(EventList.INNER_CONSULTATION_START, (msg) => {
|
|
|
- console.log('咨询已开始事件:' + msg);
|
|
|
|
|
// 隐藏会议区域和客户信息表单(与 source 一致)
|
|
// 隐藏会议区域和客户信息表单(与 source 一致)
|
|
|
this.showConferenceArea = false;
|
|
this.showConferenceArea = false;
|
|
|
this.showCustomerForm = false;
|
|
this.showCustomerForm = false;
|
|
@@ -1087,7 +1054,6 @@ export default {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
this.phoneBar.on(EventList.INNER_CONSULTATION_STOP, (msg) => {
|
|
this.phoneBar.on(EventList.INNER_CONSULTATION_STOP, (msg) => {
|
|
|
- console.log('咨询已结束事件:' + msg);
|
|
|
|
|
// 隐藏转接/咨询区域
|
|
// 隐藏转接/咨询区域
|
|
|
this.showTransferCallWait = false;
|
|
this.showTransferCallWait = false;
|
|
|
this.showTransferArea = false;
|
|
this.showTransferArea = false;
|
|
@@ -1095,7 +1061,6 @@ export default {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
this.phoneBar.on(EventList.CUSTOMER_ON_CALL_WAIT_HANGUP, (msg) => {
|
|
this.phoneBar.on(EventList.CUSTOMER_ON_CALL_WAIT_HANGUP, (msg) => {
|
|
|
- console.log('等待的客户已挂机事件:' + msg);
|
|
|
|
|
// 隐藏转接/咨询区域
|
|
// 隐藏转接/咨询区域
|
|
|
this.showStopCallWait = false;
|
|
this.showStopCallWait = false;
|
|
|
this.showTransferCallWait = false;
|
|
this.showTransferCallWait = false;
|
|
@@ -1105,17 +1070,14 @@ export default {
|
|
|
|
|
|
|
|
// 会议相关事件
|
|
// 会议相关事件
|
|
|
this.phoneBar.on(EventList.CONFERENCE_MEMBER_ANSWERED, (msg) => {
|
|
this.phoneBar.on(EventList.CONFERENCE_MEMBER_ANSWERED, (msg) => {
|
|
|
- console.log('会议成员已经接通事件:' + msg);
|
|
|
|
|
this.updateConferenceMemberStatus(msg.object.phone, '通话中', 'green');
|
|
this.updateConferenceMemberStatus(msg.object.phone, '通话中', 'green');
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
this.phoneBar.on(EventList.CONFERENCE_MEMBER_HANGUP, (msg) => {
|
|
this.phoneBar.on(EventList.CONFERENCE_MEMBER_HANGUP, (msg) => {
|
|
|
- console.log('会议成员已经挂机事件:' + msg);
|
|
|
|
|
this.updateConferenceMemberHangup(msg.object.phone, msg.object);
|
|
this.updateConferenceMemberHangup(msg.object.phone, msg.object);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
this.phoneBar.on(EventList.CONFERENCE_MODERATOR_ANSWERED, (msg) => {
|
|
this.phoneBar.on(EventList.CONFERENCE_MODERATOR_ANSWERED, (msg) => {
|
|
|
- console.log('电话会议开始,主持人已接通事件:' + msg);
|
|
|
|
|
// 隐藏转接/咨询区域和客户信息表单(与 source 一致)
|
|
// 隐藏转接/咨询区域和客户信息表单(与 source 一致)
|
|
|
this.showTransferArea = false;
|
|
this.showTransferArea = false;
|
|
|
this.showCustomerForm = false;
|
|
this.showCustomerForm = false;
|
|
@@ -1123,13 +1085,11 @@ export default {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
this.phoneBar.on(EventList.CONFERENCE_MODERATOR_HANGUP, (msg) => {
|
|
this.phoneBar.on(EventList.CONFERENCE_MODERATOR_HANGUP, (msg) => {
|
|
|
- console.log('电话会议结束,主持人已挂机事件:' + msg);
|
|
|
|
|
// 会议结束后隐藏会议区域
|
|
// 会议结束后隐藏会议区域
|
|
|
this.onConferenceEnd();
|
|
this.onConferenceEnd();
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
this.phoneBar.on(EventList.CONFERENCE_MEMBER_MUTED_SUCCESS, (msg) => {
|
|
this.phoneBar.on(EventList.CONFERENCE_MEMBER_MUTED_SUCCESS, (msg) => {
|
|
|
- console.log('会议成员已被禁言事件:' + msg);
|
|
|
|
|
const memberPhone = msg.object.phone;
|
|
const memberPhone = msg.object.phone;
|
|
|
const member = this.conferenceMembers.find(m => m.phone === memberPhone);
|
|
const member = this.conferenceMembers.find(m => m.phone === memberPhone);
|
|
|
if (member) {
|
|
if (member) {
|
|
@@ -1138,7 +1098,6 @@ export default {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
this.phoneBar.on(EventList.CONFERENCE_MEMBER_UNMUTED_SUCCESS, (msg) => {
|
|
this.phoneBar.on(EventList.CONFERENCE_MEMBER_UNMUTED_SUCCESS, (msg) => {
|
|
|
- console.log('会议成员解除禁言成功事件:' + msg);
|
|
|
|
|
const memberPhone = msg.object.phone;
|
|
const memberPhone = msg.object.phone;
|
|
|
const member = this.conferenceMembers.find(m => m.phone === memberPhone);
|
|
const member = this.conferenceMembers.find(m => m.phone === memberPhone);
|
|
|
if (member) {
|
|
if (member) {
|
|
@@ -1147,7 +1106,6 @@ export default {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
this.phoneBar.on(EventList.CONFERENCE_MEMBER_VMUTED_SUCCESS, (msg) => {
|
|
this.phoneBar.on(EventList.CONFERENCE_MEMBER_VMUTED_SUCCESS, (msg) => {
|
|
|
- console.log('会议成员已被禁用视频事件:' + msg);
|
|
|
|
|
const memberPhone = msg.object.phone;
|
|
const memberPhone = msg.object.phone;
|
|
|
const member = this.conferenceMembers.find(m => m.phone === memberPhone);
|
|
const member = this.conferenceMembers.find(m => m.phone === memberPhone);
|
|
|
if (member) {
|
|
if (member) {
|
|
@@ -1156,7 +1114,6 @@ export default {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
this.phoneBar.on(EventList.CONFERENCE_MEMBER_UNVMUTED_SUCCESS, (msg) => {
|
|
this.phoneBar.on(EventList.CONFERENCE_MEMBER_UNVMUTED_SUCCESS, (msg) => {
|
|
|
- console.log('会议成员启用视频成功事件:' + msg);
|
|
|
|
|
const memberPhone = msg.object.phone;
|
|
const memberPhone = msg.object.phone;
|
|
|
const member = this.conferenceMembers.find(m => m.phone === memberPhone);
|
|
const member = this.conferenceMembers.find(m => m.phone === memberPhone);
|
|
|
if (member) {
|
|
if (member) {
|
|
@@ -1222,7 +1179,6 @@ export default {
|
|
|
msg.object.status === AgentStatusEnum.CONFERENCE) {
|
|
msg.object.status === AgentStatusEnum.CONFERENCE) {
|
|
|
// 通话中状态,不需要更新按钮状态,保持当前状态即可
|
|
// 通话中状态,不需要更新按钮状态,保持当前状态即可
|
|
|
} else if (msg.object.status === AgentStatusEnum.JUST_LOGIN) {
|
|
} else if (msg.object.status === AgentStatusEnum.JUST_LOGIN) {
|
|
|
- console.log('[DEBUG] Status is JUST_LOGIN');
|
|
|
|
|
// 刚登录,尚未就绪,自动设置为置忙状态以便外呼
|
|
// 刚登录,尚未就绪,自动设置为置忙状态以便外呼
|
|
|
this.agentStatus = '忙碌';
|
|
this.agentStatus = '忙碌';
|
|
|
this.callStatus = '忙碌';
|
|
this.callStatus = '忙碌';
|
|
@@ -1332,7 +1288,6 @@ export default {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- console.log('[开始外呼] 号码:', this.phoneNumber.trim(), '类型:', this.callType, '视频级别:', this.videoLevel);
|
|
|
|
|
|
|
|
|
|
this.currentCallUuid = '';
|
|
this.currentCallUuid = '';
|
|
|
this.callFinishedAt = '';
|
|
this.callFinishedAt = '';
|
|
@@ -1364,7 +1319,6 @@ export default {
|
|
|
|
|
|
|
|
async triggerSyncByUuid(status, source, msg, delayMs = 0, failReason = '') {
|
|
async triggerSyncByUuid(status, source, msg, delayMs = 0, failReason = '') {
|
|
|
if (this.callResultRecorded) {
|
|
if (this.callResultRecorded) {
|
|
|
- console.log('[syncByUuid] 已记录过,跳过。source =', source);
|
|
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1401,19 +1355,11 @@ export default {
|
|
|
roboticId: this.roboticId
|
|
roboticId: this.roboticId
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- console.log('[syncByUuid] 准备调用后端记录:', {
|
|
|
|
|
- source,
|
|
|
|
|
- status,
|
|
|
|
|
- failReason,
|
|
|
|
|
- req,
|
|
|
|
|
- callFinishedAt: this.callFinishedAt
|
|
|
|
|
- });
|
|
|
|
|
|
|
|
|
|
const res = await syncByUuid(req);
|
|
const res = await syncByUuid(req);
|
|
|
|
|
|
|
|
if (res && (res.code === 200 || res.code === 0)) {
|
|
if (res && (res.code === 200 || res.code === 0)) {
|
|
|
this.callResultRecorded = true;
|
|
this.callResultRecorded = true;
|
|
|
- console.log('[syncByUuid] 记录成功:', res);
|
|
|
|
|
this.$message.success(status === 2 ? '外呼执行成功已记录' : '外呼执行失败已记录');
|
|
this.$message.success(status === 2 ? '外呼执行成功已记录' : '外呼执行失败已记录');
|
|
|
} else {
|
|
} else {
|
|
|
console.error('[syncByUuid] 记录失败:', res);
|
|
console.error('[syncByUuid] 记录失败:', res);
|
|
@@ -1700,7 +1646,6 @@ export default {
|
|
|
if (btn && btn.classList.contains('on')) {
|
|
if (btn && btn.classList.contains('on')) {
|
|
|
if (this.phoneBar.getIsConnected()) {
|
|
if (this.phoneBar.getIsConnected()) {
|
|
|
// 已连接时执行签出操作
|
|
// 已连接时执行签出操作
|
|
|
- console.log('[手动签出] 用户主动点击签出按钮');
|
|
|
|
|
// 设置不允许自动签入
|
|
// 设置不允许自动签入
|
|
|
this.allowAutoSignIn = false;
|
|
this.allowAutoSignIn = false;
|
|
|
// 调用 SDK 的 disconnect 方法 (会自动关闭 WebSocket)
|
|
// 调用 SDK 的 disconnect 方法 (会自动关闭 WebSocket)
|
|
@@ -1711,7 +1656,6 @@ export default {
|
|
|
this.loginTime = '00:00:00';
|
|
this.loginTime = '00:00:00';
|
|
|
} else {
|
|
} else {
|
|
|
// 未连接时执行签入操作
|
|
// 未连接时执行签入操作
|
|
|
- console.log('[手动签入] 用户主动点击签入按钮');
|
|
|
|
|
// 允许自动签入
|
|
// 允许自动签入
|
|
|
this.allowAutoSignIn = true;
|
|
this.allowAutoSignIn = true;
|
|
|
// 建立 WebSocket 连接
|
|
// 建立 WebSocket 连接
|