Forráskód Böngészése

reactor:坐席辅助缓存处理;

zhangchong 1 éve
szülő
commit
f21670b1d9

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

@@ -1513,7 +1513,7 @@ const callCenterConnect = async () => {
 };
 onMounted(async () => {
 	clearTimeout(talkDealTimer.value); // 清除话后整理定时器
-	await signalRStart(); //开启消息监听
+	signalRStart(); //开启消息监听
 	removeTimerOnDuty(); // 移除定时器
 	await getTelsLists(); // 查询所有分机
 	await callCenterConnect(); // 呼叫中心链接

+ 1 - 1
src/utils/request.ts

@@ -106,7 +106,7 @@ function httpErrorStatusHandle(error: any) {
 				if (!tokenAbnormal) {
 					tokenAbnormal = true;
 					// 弹出框
-					ElMessageBox.alert('你已被登出,请重新登录', '提示', { type: 'warning' })
+					ElMessageBox.alert('登录过期,请重新登录', '提示', { type: 'warning' })
 						.then(() => {
 							Session.clear(); // 清除浏览器全部临时缓存
 							Local.clear(); // 清除浏览器全部临时缓存

+ 16 - 5
src/views/todo/seats/accept/Voice-assistant.vue

@@ -21,7 +21,7 @@
 			</div>
 		</el-scrollbar>
 		<Empty v-else />
-		<el-button @click.stop="keepScroll" class="keep-scroll" title="回到底部" circle v-if="!isScrollBottom">
+		<el-button @click.stop="keepScroll" class="keep-scroll" title="回到底部" circle v-if="!isScrollBottom && !talkEnd">
 			<SvgIcon name="ele-ArrowDown" size="18px" />
 		</el-button>
 		<!-- 识别内容 通话结束才展示-->
@@ -105,14 +105,13 @@
 		</div>
 	</div>
 </template>
-<script setup lang="ts">
-import { nextTick, onMounted, ref, watch } from 'vue';
+<script setup lang="ts" name="orderAcceptVoiceAssistant">
+import { nextTick, onActivated, onBeforeMount, onBeforeUnmount, onDeactivated, onMounted, onUnmounted, ref, watch } from 'vue';
 import { ElMessageBox } from 'element-plus';
 import { getImageUrl } from '@/utils/tools';
 import axios from 'axios';
 import { useRoute } from 'vue-router';
 import { formatDate } from '@/utils/formatTime';
-import Empty from '@/components/Empty/index.vue';
 const emit = defineEmits(['orderOverwrite']);
 import mittBus from '@/utils/mitt';
 // 消息列表
@@ -149,11 +148,15 @@ const recognizeList = ref<EmptyObjectType>({}); // 识别信息
 onMounted(() => {
 	// 接受消息
 	mittBus.on('wsReceive', (message: any) => {
+		const data = JSON.parse(message.data);
+		console.log('wsReceive', data, route);
+
 		wsReceive(message);
 	});
 });
 const route = useRoute();
 const talkEnd = ref(false); // 通话结束
+// data.body.content.callId === route.params.callId
 const wsReceive = (message: any) => {
 	try {
 		const data = JSON.parse(message.data);
@@ -227,7 +230,8 @@ const scrollToBottom = async () => {
 	scrollbarRef.value?.setScrollTop(max);
 	isAutoScroll.value = true;
 };
-watch(messageList.value, () => {
+watch(messageList.value, (val) => {
+	console.log('messageList', val);
 	scrollToBottom();
 });
 // 继续滚动
@@ -274,6 +278,13 @@ watch(
 		});
 	}
 );
+onDeactivated(() => {
+	console.log('缓存离开');
+	mittBus.off('wsReceive');
+});
+onActivated(() => {
+	console.log('缓存进入');
+});
 </script>
 
 <style scoped lang="scss">