fix : 区分工作台实时数据新旧对话
This commit is contained in:
@@ -55,6 +55,13 @@ const handleLogout = () => {
|
||||
permisstionStore.removeMenu()
|
||||
router.push('/login')
|
||||
}
|
||||
const handleShowDeadLine=(recordObj,data)=>{
|
||||
let flag=false
|
||||
if(recordObj.content&&recordObj.content.length>0){
|
||||
flag=recordObj.content[recordObj.content.length-1]?.callIdNumber!=data.callIdNumber
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
const initWebSocket = () => {
|
||||
try {
|
||||
// const wsUrl=setWsUrl(`/ws/text/${token}`)
|
||||
@@ -93,6 +100,19 @@ const initWebSocket = () => {
|
||||
recordLeftObj.value.phone=data.phone
|
||||
recordLeftObj.value.type=data.type
|
||||
recordLeftObj.value.orderName=data.orderName
|
||||
let flag=handleShowDeadLine(recordLeftObj.value,data)
|
||||
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)
|
||||
// console.info("🚀 ~method:onmessage -----", recordLeftObj.value)
|
||||
nextTick(() => {
|
||||
@@ -103,6 +123,19 @@ const initWebSocket = () => {
|
||||
recordRightObj.value.phone=data.phone
|
||||
recordRightObj.value.type=data.type
|
||||
recordRightObj.value.orderName=data.orderName
|
||||
let flag=handleShowDeadLine(recordRightObj.value,data)
|
||||
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
|
||||
})
|
||||
}
|
||||
recordRightObj.value.content.push(data.content)
|
||||
// console.info("🚀 ~method:onmessage -----", recordRightObj.value)
|
||||
nextTick(() => {
|
||||
|
||||
Reference in New Issue
Block a user