Procházet zdrojové kódy

reactor:呼叫中心重连机制调整;

zhangchong před 10 měsíci
rodič
revize
d8beb853cb
1 změnil soubory, kde provedl 9 přidání a 9 odebrání
  1. 9 9
      src/layout/navBars/breadcrumb/telControl.vue

+ 9 - 9
src/layout/navBars/breadcrumb/telControl.vue

@@ -729,7 +729,7 @@ const RestApplyPassFn = (data: any) => {
 	});
 	//不需要审核直接开始小休
 	ola.go_break(state.restForm.reason); //设置忙碌
-	console.log('调用示忙审核',data);
+	console.log('调用示忙审核', data);
 };
 // 查询所有分机
 const getTelsLists = async () => {
@@ -954,7 +954,6 @@ const onMessage = async (event: any) => {
 					await onEndAcw(); // 挂机后整理结束
 				}
 				console.log('呼叫中心:示闲中');
-        isReconnect.value = true; // 签入重置需要是否重连
 				sendMsg('ready');
 			}
 		} else if (data.state == 'unready') {
@@ -1034,8 +1033,8 @@ const onMessage = async (event: any) => {
 						clearTimeout(talkDealTimer.value); // 清除话后整理定时器
 					}, time);
 					console.log('呼叫中心:话后整理中');
-						// 如果不是话后整理中
-						await onBeginAcw(); // 挂机后整理开始
+					// 如果不是话后整理中
+					await onBeginAcw(); // 挂机后整理开始
 					sendMsg('acw');
 				} else {
 					// 呼出直接调用示闲
@@ -1241,12 +1240,14 @@ const submitLogFn = async (event: any) => {
 	}
 };
 // 呼叫中心链接关闭
-const isReconnect = ref(true); // 呼叫中心是否需要重连
 const onClose = async (event: any) => {
-	console.log('呼叫中心断开链接', isReconnect.value ? '需要重连' : '不需要重连');
-	resetState();
-	if (isReconnect.value) {
+	const { result } = await getTelStatus();
+	console.log('呼叫中心断开链接', result ? '需要重连' : '不需要重连');
+	if (result) {
+		// 签入状态需要重连
 		await reConnect(); // 重新链接呼叫中心
+	} else {
+		resetState();
 	}
 	await submitLogFn(event);
 };
@@ -1279,7 +1280,6 @@ const reConnect = async () => {
 };
 // 链接成功 停止重连
 const stopReconnect = () => {
-	isReconnect.value = false;
 	clearTimeout(reconnectTimeout.value);
 	console.log('停止重连');
 };