236 lines
5.9 KiB
Vue
236 lines
5.9 KiB
Vue
<template>
|
||
<div class="live-call">
|
||
<div class="header">
|
||
<div>
|
||
<span style="margin-right: 20px">{{ recordObj.name }}</span>
|
||
<span>电话号码:{{ recordObj.phone ||'--'}}</span>
|
||
</div>
|
||
<div><span>工单名称:{{ recordObj.orderName||'--' }}</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>
|
||
<el-scrollbar ref="scrollbarRef" class="scrollbar">
|
||
<el-empty v-if="!recordObj.content" description="暂无通话" />
|
||
<div class="chat-content" ref="innerRef" v-else>
|
||
<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>
|
||
<!-- 我的 -->
|
||
<div v-if="item.speaker==0" class="word-my">
|
||
<div class="info">
|
||
<!-- <p class="name">{{ item.speaker==0?recordObj.name:'运维助手' }} </p>-->
|
||
<p class="name">{{ item.speaker==0?recordObj.name:'运维助手' }} </p>
|
||
<div class="info-content">{{ item.message }}</div>
|
||
</div>
|
||
<el-avatar>{{ item.speaker==0?recordObj.name:'运维助手' }}</el-avatar>
|
||
</div>
|
||
|
||
<!-- 对方 -->
|
||
<div v-else class="word">
|
||
<el-avatar > {{ item.speaker==0?recordObj.name:'运维助手' }} </el-avatar>
|
||
<div class="info">
|
||
<p class="name">{{ item.speaker==0?recordObj.name:'运维助手' }} </p>
|
||
<div class="info-content">{{ item.message }}</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- <el-empty description="暂无通话记录~" v-else/>-->
|
||
|
||
</div>
|
||
</el-scrollbar>
|
||
</div>
|
||
</template>
|
||
|
||
<script setup>
|
||
import {defineProps} from "vue";
|
||
const scrollbarRef=ref()
|
||
const props = defineProps({
|
||
recordObj: {
|
||
type: Object,
|
||
default: {}
|
||
},
|
||
headData: {
|
||
type: Object,
|
||
default: {}
|
||
},
|
||
lineName: {
|
||
type: String,
|
||
default: ''
|
||
},
|
||
})
|
||
|
||
const getScrollbarRef=()=>{
|
||
return scrollbarRef.value
|
||
}
|
||
const handleShowDeadLine=(recordObj)=>{
|
||
console.info("🚀 ~method:'recordObj' -----", recordObj)
|
||
let flag=false
|
||
if(recordObj.content&&recordObj.content.length>1){
|
||
let indices = recordObj.content.reduce(function (r, v, i) {
|
||
return r.concat(v === 'a' ? i : []);
|
||
}, []);
|
||
|
||
console.log(indices);
|
||
|
||
recordObj.content.forEach((item,index)=>{
|
||
console.info("🚀 ~method:.callIdNumber -----",recordObj.content.findIndex(item=>item.callIdNumber), item.callIdNumber)
|
||
flag=recordObj.content[recordObj.content.length-2]?.callIdNumber!=recordObj.content[recordObj.content.length-1].callIdNumber
|
||
|
||
})
|
||
}
|
||
return flag;
|
||
}
|
||
defineExpose({
|
||
getScrollbarRef
|
||
})
|
||
</script>
|
||
|
||
<style lang="scss" scoped>
|
||
.live-call {
|
||
width: 48%;
|
||
height: 47vh;
|
||
margin-bottom: 20px;
|
||
overflow: hidden;
|
||
border: 1px solid #d5d4d4;
|
||
border-radius: 10px;
|
||
|
||
.header {
|
||
display: flex;
|
||
justify-content: space-around;
|
||
align-items: center;
|
||
height: 40px;
|
||
border-bottom: 1px solid #d5d4d4;
|
||
}
|
||
|
||
.scrollbar {
|
||
padding: 10px 10px 0 10px;
|
||
height: 42vh;
|
||
|
||
.el-scrollbar__wrap {
|
||
height: 100%;
|
||
overflow: scroll;
|
||
overflow-x: auto;
|
||
}
|
||
|
||
// 聊天内容样式
|
||
.chat-content {
|
||
width: 100%;
|
||
|
||
.time-grap {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
|
||
> span {
|
||
font-size: 13px;
|
||
padding: 5px 10px;
|
||
border: 1px solid #d7d9da;
|
||
border-radius: 25px;
|
||
}
|
||
|
||
margin-bottom: 10px;
|
||
}
|
||
|
||
.word {
|
||
display: flex;
|
||
margin-bottom: 20px;
|
||
|
||
img {
|
||
width: 40px;
|
||
height: 40px;
|
||
border-radius: 50%;
|
||
}
|
||
|
||
.info {
|
||
margin-left: 10px;
|
||
|
||
.name {
|
||
font-size: 12px;
|
||
color: rgba(51, 51, 51, 0.8);
|
||
margin: 0;
|
||
height: 20px;
|
||
line-height: 20px;
|
||
margin-top: -5px;
|
||
}
|
||
|
||
.info-content {
|
||
padding: 10px;
|
||
font-size: 14px;
|
||
background: #f5f5f5;
|
||
position: relative;
|
||
margin-top: 8px;
|
||
border: 1px solid #f5f5f5;
|
||
}
|
||
|
||
//小三角形
|
||
.info-content::before {
|
||
position: absolute;
|
||
left: -8px;
|
||
top: 8px;
|
||
content: '';
|
||
border-right: 10px solid #f5f5f5;
|
||
border-top: 8px solid transparent;
|
||
border-bottom: 8px solid transparent;
|
||
}
|
||
}
|
||
}
|
||
|
||
.word-my {
|
||
display: flex;
|
||
justify-content: flex-end;
|
||
margin-bottom: 20px;
|
||
|
||
img {
|
||
width: 40px;
|
||
height: 40px;
|
||
border-radius: 50%;
|
||
}
|
||
|
||
.info {
|
||
width: 90%;
|
||
margin-left: 10px;
|
||
text-align: right;
|
||
|
||
.name {
|
||
font-size: 12px;
|
||
color: rgba(51, 51, 51, 0.8);
|
||
height: 20px;
|
||
line-height: 20px;
|
||
margin-top: -5px;
|
||
margin-right: 10px;
|
||
}
|
||
|
||
.info-content {
|
||
max-width: 70%;
|
||
padding: 10px;
|
||
font-size: 14px;
|
||
float: right;
|
||
margin-right: 10px;
|
||
position: relative;
|
||
margin-top: 8px;
|
||
background: #A3C3F6;
|
||
text-align: left;
|
||
}
|
||
|
||
//小三角形
|
||
.info-content::after {
|
||
position: absolute;
|
||
right: -8px;
|
||
top: 8px;
|
||
content: '';
|
||
border-left: 10px solid #A3C3F6;
|
||
border-top: 8px solid transparent;
|
||
border-bottom: 8px solid transparent;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
}
|
||
|
||
}
|
||
</style>
|