diff --git a/src/api/workbench/index.js b/src/api/workbench/index.js index ceedeca..9784551 100644 --- a/src/api/workbench/index.js +++ b/src/api/workbench/index.js @@ -1,11 +1,16 @@ import request from '@/utils/request.js' -import { method } from 'lodash' //获取历史通话文本记录 - export const getHistoryCallContent=(params)=>{ return request({ url:`/text/history/list/${params}`, method:'get' }) -} \ No newline at end of file +} +//获取工作台当前线路记录 +export const getCurrentContent=(line)=>{ + return request({ + url:`/text/records/${line}`, + method:'get' + }) +} diff --git a/src/components/liveCall/LiveCallItemHome.vue b/src/components/liveCall/LiveCallItemHome.vue index b6ee640..3ac1f11 100644 --- a/src/components/liveCall/LiveCallItemHome.vue +++ b/src/components/liveCall/LiveCallItemHome.vue @@ -6,12 +6,14 @@ 电话号码:{{ recordObj.phone ||'--'}}
工单名称:{{ recordObj.orderName||'--' }}
- -
{{ lineName }}
+
{{ recordObj.type=='1'?'线路一':recordObj.type=='2'?'线路二':'' }}
+
{{ lineName }}
+
+ {{item.lineMsg}}
{{ item.conversationTimestamp || '6月5日 12:05' }}
diff --git a/src/components/liveCall/index.vue b/src/components/liveCall/index.vue index c1c64db..3d3a8b5 100644 --- a/src/components/liveCall/index.vue +++ b/src/components/liveCall/index.vue @@ -10,6 +10,7 @@ import {useAuthStore} from '@/stores/userstore.js' import {getToken} from '@/utils/auth' import {usePermisstionStroe} from '@/stores/permisstion' +import {getCurrentContent} from "@/api/workbench"; const permisstionStore = usePermisstionStroe() const authStore = useAuthStore() @@ -37,6 +38,24 @@ let token = getToken(); let send = { type: "ping", }; +// if(localStorage.getItem('recordLeftObj')){ +// recordLeftObj.value=JSON.parse(localStorage.getItem('recordLeftObj')) +// } +// if(localStorage.getItem('recordRightObj')){ +// recordRightObj.value=JSON.parse(localStorage.getItem('recordRightObj')) +// } +const getCurrentMsg=(line)=>{ + getCurrentContent(line).then(res=>{ + // console.info("🚀 ~method:res -----", res) + if(line==1){ + recordLeftObj.value.content=res.data + }else if(line==2){ + recordRightObj.value.content=res.data + } + }) +} +getCurrentMsg(1) +getCurrentMsg(2) //滚动面板自动滑动到底部 const scrollToBottom = (scrollbarRef) => { if (scrollbarRef) { @@ -48,7 +67,7 @@ const scrollToBottom = (scrollbarRef) => { const setWsUrl = (url) => { - return (window.location.protocol === 'http:' ? "ws://" : "wss://") + window.location.host + import.meta.env.VITE_BASE_WSURL + url; + return (window.location.protocol === 'http:' ? "ws://" : "wss://") + window.location.host + import.meta.env.VITE_BASE_URL + url; } const handleLogout = () => { authStore.userLogout() @@ -65,8 +84,8 @@ const handleShowDeadLine=(recordObj,data)=>{ const initWebSocket = () => { try { // const wsUrl=setWsUrl(`/ws/text/${token}`) - // const wsUrl = `ws://frp.feashow.cn:31800/ws/text/${token}` - const wsUrl = `ws://112.19.165.99:20002/api/ws/text/${token}` + const wsUrl = `ws://frp.feashow.cn:31800/ws/text/${token}` + // const wsUrl = `ws://112.19.165.99:20002/api/ws/text/${token}` socket = new WebSocket(wsUrl) // 2. ws.send()给服务器发送信息 //连接发生错误的回调方法 @@ -104,16 +123,13 @@ const initWebSocket = () => { console.info("🚀 ~method:flag -----", flag) if(flag){ recordLeftObj.value.content.push({ - // callIdNumber: "17282197782048", - // conversationId:0, - // conversationTimestamp: "", - // createTime: "2024-10-08", isLine:true, lineMsg: "一轮通话结束~~", speaker: data.content.speaker }) } recordLeftObj.value.content.push(data.content) + localStorage.setItem('recordLeftObj',JSON.stringify(recordLeftObj.value)) // console.info("🚀 ~method:onmessage -----", recordLeftObj.value) nextTick(() => { scrollToBottom(recordLeftRef.value) @@ -127,10 +143,6 @@ const initWebSocket = () => { console.info("🚀 ~method:flag -----", flag) if(flag){ recordRightObj.value.content.push({ - // callIdNumber: "17282197782048", - // conversationId:0, - // conversationTimestamp: "", - // createTime: "2024-10-08", isLine:true, lineMsg: "一轮通话结束~~", speaker: data.content.speaker @@ -138,6 +150,7 @@ const initWebSocket = () => { } recordRightObj.value.content.push(data.content) // console.info("🚀 ~method:onmessage -----", recordRightObj.value) + localStorage.setItem('recordRightObj',JSON.stringify(recordRightObj.value)) nextTick(() => { scrollToBottom(recordRightRef.value); }) diff --git a/src/utils/auth.js b/src/utils/auth.js index 55243e8..a5e2d41 100644 --- a/src/utils/auth.js +++ b/src/utils/auth.js @@ -22,4 +22,4 @@ export const setAuthInfo = (info) => { export const removeAuthInfo = () => { return Cookies.remove('authinfo') -} \ No newline at end of file +} diff --git a/src/utils/request.js b/src/utils/request.js index 7bbbec3..6dec3dc 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -51,8 +51,9 @@ serveice.interceptors.response.use(response=>{ }).then(()=>{ removeToken() window.location = '/login' + return Promise.reject('会话已过期,请重新登录') }) - return Promise.reject('会话已过期,请重新登录') + break; case 402: break; case 403: diff --git a/src/views/voice-management/verbal-trick/index.vue b/src/views/voice-management/verbal-trick/index.vue index 3fa7e40..a94aa1c 100644 --- a/src/views/voice-management/verbal-trick/index.vue +++ b/src/views/voice-management/verbal-trick/index.vue @@ -87,6 +87,30 @@ const verbalTrickTableConfig = reactive({ label: '内容', align: 'center' }, + { + prop: 'calloff', + label: '是否挂断电话', + align: 'center', + currentRender: ({ row, index }) => { + if (row.calloff !== null) { + return () + } else { + return '--' + } + } + }, + { + prop: 'type', + label: '上下文类型', + align: 'center', + currentRender: ({ row, index }) => { + if (row.type !== null) { + return () + } else { + return '--' + } + } + }, { prop: 'createTime', label: '创建时间',