Merge pull request 'dd' (#142) from dd into master
Reviewed-on: http://git.feashow.cn/feashow/SmartOpsWeb/pulls/142
This commit is contained in:
@@ -1,11 +1,16 @@
|
|||||||
import request from '@/utils/request.js'
|
import request from '@/utils/request.js'
|
||||||
import { method } from 'lodash'
|
|
||||||
|
|
||||||
//获取历史通话文本记录
|
//获取历史通话文本记录
|
||||||
|
|
||||||
export const getHistoryCallContent=(params)=>{
|
export const getHistoryCallContent=(params)=>{
|
||||||
return request({
|
return request({
|
||||||
url:`/text/history/list/${params}`,
|
url:`/text/history/list/${params}`,
|
||||||
method:'get'
|
method:'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//获取工作台当前线路记录
|
||||||
|
export const getCurrentContent=(line)=>{
|
||||||
|
return request({
|
||||||
|
url:`/text/records/${line}`,
|
||||||
|
method:'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -6,12 +6,14 @@
|
|||||||
<span>电话号码:{{ recordObj.phone ||'--'}}</span>
|
<span>电话号码:{{ recordObj.phone ||'--'}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div><span>工单名称:{{ recordObj.orderName||'--' }}</span></div>
|
<div><span>工单名称:{{ recordObj.orderName||'--' }}</span></div>
|
||||||
<!-- <div><span>{{ recordObj.type=='1'?'线路一':recordObj.type=='2'?'线路二':'' }}</span></div>-->
|
<div v-if="recordObj.type"><el-tag>{{ recordObj.type=='1'?'线路一':recordObj.type=='2'?'线路二':'' }}</el-tag></div>
|
||||||
<div><span>{{ lineName }}</span></div>
|
<div v-else><el-tag>{{ lineName }}</el-tag></div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- {{recordObj.content}}-->
|
||||||
<el-scrollbar ref="scrollbarRef" class="scrollbar">
|
<el-scrollbar ref="scrollbarRef" class="scrollbar">
|
||||||
<div class="chat-content" ref="innerRef">
|
<div class="chat-content" ref="innerRef">
|
||||||
<div v-for="(item,index) in recordObj.content" :key="index">
|
<div v-for="(item,index) in recordObj.content" :key="index">
|
||||||
|
|
||||||
<el-divider border-style="dotted" v-if="item.isLine">{{item.lineMsg}}</el-divider>
|
<el-divider border-style="dotted" v-if="item.isLine">{{item.lineMsg}}</el-divider>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<div class="time-grap"><span>{{ item.conversationTimestamp || '6月5日 12:05' }}</span></div>
|
<div class="time-grap"><span>{{ item.conversationTimestamp || '6月5日 12:05' }}</span></div>
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
import {useAuthStore} from '@/stores/userstore.js'
|
import {useAuthStore} from '@/stores/userstore.js'
|
||||||
import {getToken} from '@/utils/auth'
|
import {getToken} from '@/utils/auth'
|
||||||
import {usePermisstionStroe} from '@/stores/permisstion'
|
import {usePermisstionStroe} from '@/stores/permisstion'
|
||||||
|
import {getCurrentContent} from "@/api/workbench";
|
||||||
|
|
||||||
const permisstionStore = usePermisstionStroe()
|
const permisstionStore = usePermisstionStroe()
|
||||||
const authStore = useAuthStore()
|
const authStore = useAuthStore()
|
||||||
@@ -37,6 +38,24 @@ let token = getToken();
|
|||||||
let send = {
|
let send = {
|
||||||
type: "ping",
|
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) => {
|
const scrollToBottom = (scrollbarRef) => {
|
||||||
if (scrollbarRef) {
|
if (scrollbarRef) {
|
||||||
@@ -48,7 +67,7 @@ const scrollToBottom = (scrollbarRef) => {
|
|||||||
|
|
||||||
|
|
||||||
const setWsUrl = (url) => {
|
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 = () => {
|
const handleLogout = () => {
|
||||||
authStore.userLogout()
|
authStore.userLogout()
|
||||||
@@ -65,8 +84,8 @@ const handleShowDeadLine=(recordObj,data)=>{
|
|||||||
const initWebSocket = () => {
|
const initWebSocket = () => {
|
||||||
try {
|
try {
|
||||||
// const wsUrl=setWsUrl(`/ws/text/${token}`)
|
// const wsUrl=setWsUrl(`/ws/text/${token}`)
|
||||||
// const wsUrl = `ws://frp.feashow.cn:31800/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://112.19.165.99:20002/api/ws/text/${token}`
|
||||||
socket = new WebSocket(wsUrl)
|
socket = new WebSocket(wsUrl)
|
||||||
// 2. ws.send()给服务器发送信息
|
// 2. ws.send()给服务器发送信息
|
||||||
//连接发生错误的回调方法
|
//连接发生错误的回调方法
|
||||||
@@ -104,16 +123,13 @@ const initWebSocket = () => {
|
|||||||
console.info("🚀 ~method:flag -----", flag)
|
console.info("🚀 ~method:flag -----", flag)
|
||||||
if(flag){
|
if(flag){
|
||||||
recordLeftObj.value.content.push({
|
recordLeftObj.value.content.push({
|
||||||
// callIdNumber: "17282197782048",
|
|
||||||
// conversationId:0,
|
|
||||||
// conversationTimestamp: "",
|
|
||||||
// createTime: "2024-10-08",
|
|
||||||
isLine:true,
|
isLine:true,
|
||||||
lineMsg: "一轮通话结束~~",
|
lineMsg: "一轮通话结束~~",
|
||||||
speaker: data.content.speaker
|
speaker: data.content.speaker
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
recordLeftObj.value.content.push(data.content)
|
recordLeftObj.value.content.push(data.content)
|
||||||
|
localStorage.setItem('recordLeftObj',JSON.stringify(recordLeftObj.value))
|
||||||
// console.info("🚀 ~method:onmessage -----", recordLeftObj.value)
|
// console.info("🚀 ~method:onmessage -----", recordLeftObj.value)
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
scrollToBottom(recordLeftRef.value)
|
scrollToBottom(recordLeftRef.value)
|
||||||
@@ -127,10 +143,6 @@ const initWebSocket = () => {
|
|||||||
console.info("🚀 ~method:flag -----", flag)
|
console.info("🚀 ~method:flag -----", flag)
|
||||||
if(flag){
|
if(flag){
|
||||||
recordRightObj.value.content.push({
|
recordRightObj.value.content.push({
|
||||||
// callIdNumber: "17282197782048",
|
|
||||||
// conversationId:0,
|
|
||||||
// conversationTimestamp: "",
|
|
||||||
// createTime: "2024-10-08",
|
|
||||||
isLine:true,
|
isLine:true,
|
||||||
lineMsg: "一轮通话结束~~",
|
lineMsg: "一轮通话结束~~",
|
||||||
speaker: data.content.speaker
|
speaker: data.content.speaker
|
||||||
@@ -138,6 +150,7 @@ const initWebSocket = () => {
|
|||||||
}
|
}
|
||||||
recordRightObj.value.content.push(data.content)
|
recordRightObj.value.content.push(data.content)
|
||||||
// console.info("🚀 ~method:onmessage -----", recordRightObj.value)
|
// console.info("🚀 ~method:onmessage -----", recordRightObj.value)
|
||||||
|
localStorage.setItem('recordRightObj',JSON.stringify(recordRightObj.value))
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
scrollToBottom(recordRightRef.value);
|
scrollToBottom(recordRightRef.value);
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -22,4 +22,4 @@ export const setAuthInfo = (info) => {
|
|||||||
|
|
||||||
export const removeAuthInfo = () => {
|
export const removeAuthInfo = () => {
|
||||||
return Cookies.remove('authinfo')
|
return Cookies.remove('authinfo')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,8 +51,9 @@ serveice.interceptors.response.use(response=>{
|
|||||||
}).then(()=>{
|
}).then(()=>{
|
||||||
removeToken()
|
removeToken()
|
||||||
window.location = '/login'
|
window.location = '/login'
|
||||||
|
return Promise.reject('会话已过期,请重新登录')
|
||||||
})
|
})
|
||||||
return Promise.reject('会话已过期,请重新登录')
|
break;
|
||||||
case 402:
|
case 402:
|
||||||
break;
|
break;
|
||||||
case 403:
|
case 403:
|
||||||
|
|||||||
@@ -87,6 +87,30 @@ const verbalTrickTableConfig = reactive({
|
|||||||
label: '内容',
|
label: '内容',
|
||||||
align: 'center'
|
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',
|
prop: 'createTime',
|
||||||
label: '创建时间',
|
label: '创建时间',
|
||||||
|
|||||||
Reference in New Issue
Block a user