Merge pull request 'master' (#143) from master into test

Reviewed-on: http://git.feashow.cn/feashow/SmartOpsWeb/pulls/143
This commit is contained in:
2024-10-13 07:57:43 +00:00
4 changed files with 59 additions and 15 deletions

View File

@@ -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'
})
}
}
//获取工作台当前线路记录
export const getCurrentContent=(line)=>{
return request({
url:`/text/records/${line}`,
method:'get'
})
}

View File

@@ -6,12 +6,14 @@
<span>电话号码{{ recordObj.phone ||'--'}}</span>
</div>
<div><span>工单名称{{ recordObj.orderName||'--' }}</span></div>
<!-- <div><span>{{ recordObj.type=='1'?'线路一':recordObj.type=='2'?'线路二':'' }}</span></div>-->
<div><span>{{ lineName }}</span></div>
<div v-if="recordObj.type"><el-tag>{{ recordObj.type=='1'?'线路一':recordObj.type=='2'?'线路二':'' }}</el-tag></div>
<div v-else><el-tag>{{ lineName }}</el-tag></div>
</div>
<!-- {{recordObj.content}}-->
<el-scrollbar ref="scrollbarRef" class="scrollbar">
<div class="chat-content" ref="innerRef">
<div v-for="(item,index) in recordObj.content" :key="index">
<el-divider border-style="dotted" v-if="item.isLine">{{item.lineMsg}}</el-divider>
<div v-else>
<div class="time-grap"><span>{{ item.conversationTimestamp || '6月5日 12:05' }}</span></div>

View File

@@ -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) {
@@ -64,8 +83,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=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}`
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);
})

View File

@@ -87,6 +87,30 @@ const verbalTrickTableConfig = reactive({
label: '内容',
align: 'center'
},
{
prop: 'calloff',
label: '是否挂断电话',
align: 'center',
currentRender: ({ row, index }) => {
if (row.calloff !== null) {
return (<Tag dictType={'yes_no'} value={row.calloff} />)
} else {
return '--'
}
}
},
{
prop: 'type',
label: '上下文类型',
align: 'center',
currentRender: ({ row, index }) => {
if (row.type !== null) {
return (<Tag dictType={'context_type'} value={row.type} />)
} else {
return '--'
}
}
},
{
prop: 'createTime',
label: '创建时间',