Commit 3b7ebc78 by zhangxw

Merge branch 'SAAS+V4.42' of http://192.168.3.233:8090/saas_plus/dj-car-life-system into SAAS+V4.42

2 parents 3002819b 9a3f0f86
<template> <template>
<div class="dialogue"> <div class="dialogue">
<!-- <div class="record">
<audio id="audio1">
<source :src="detailObj.fileUrl" type="audio/mpeg" />
<source :src="detailObj.fileUrl" type="audio/ogg" />
您的浏览器不支持 audio 标签。
</audio>
<div class="play" v-if="isPlay" @click="handleAudio">
<img src="@/assets/play.png" />
</div>
<div class="play" v-else @click="handleAudio">
<img src="@/assets/pause.png" />
</div>
<div class="times">{{ currentTime }}/{{ totalTime }}</div>
<div
id="progressBar"
@mousemove="isCircle = true"
@mouseout="isCircle = false">
<div id="progress">
<div
class="circle"
@mousemove="isCircle = true"
draggable="true"
v-if="isCircle"></div>
</div>
</div>
<div class="trumpet" @click="handleMute">
<img src="@/assets/trumpet.png" v-if="isMuted"/>
<img src="@/assets/mute.png" v-if="!isMuted" />
</div>
</div> -->
<div class="record-info"> <div class="record-info">
<div class="dialog"> <div class="dialog">
<template v-for="item in dialogList"> <template v-for="item in dialogList">
<div :class="{ 'dialog-detail': true, 'nth-child': item.role == '2' }" :key="item.id"> <div
:class="{ 'dialog-detail': true, 'nth-child': item.role == '2' }"
:key="item.id"
>
<div class="name"> <div class="name">
<img class="role" src="@/assets/role-one.png" v-if="item.role == '1'" /> <img
{{ item.role == '1' ? '客户' : '销售' }} class="role"
<img class="role" src="@/assets/role-two.png" v-if="item.role == '2'" /> src="@/assets/role-one.png"
v-if="item.role == '1'"
/>
{{ item.role == "1" ? "客户" : "销售" }}
<img
class="role"
src="@/assets/role-two.png"
v-if="item.role == '2'"
/>
</div> </div>
<div class="dig-content" @click="currentDialog(item)"> <div class="dig-content">
{{ item.content }} {{ item.content }}</br>
<template v-if="item.role == 2">
<div class="improve-btn" v-if="!item.isdown" @click="handleDown(item)">改进建议<i class="el-icon-arrow-down"></i></div>
<div class="suggest" v-if="item.isdown">
<div class="improve">
<img src="@/assets/improve.png" class="improve-img" />
改进建议
</div> </div>
<template v-if="item.suggestionsForImprovement">
<div
class="improve-text"
v-html="
regText(item.highlight, item.suggestionsForImprovement)
"
></div></template>
<div class="no-data" v-else>暂无数据</div>
<div class="line"></div>
<div class="improve">
<img src="@/assets/polish.png" class="improve-img" />
润色表达
</div> </div>
<template v-if="item.refineTheExpression">
<div
class="improve-text"
v-html="regText(item.highlight, item.refineTheExpression)"
></div>
</template> </template>
<div class="no-data" v-else>暂无数据</div>
<div class="improve-btn pack" v-if="item.isdown" @click="handleDown(item)">收起<i class="el-icon-arrow-down"></i></div>
</div> </div>
<div class="abstract"> </template>
<div class="title">
<img class="robot" src="@/assets/robot.png" />
AI对话摘要
</div>
<div class="abText" v-html="formatSrt(digest)">
</div> </div>
</div> </div>
</template>
</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -61,7 +64,7 @@ ...@@ -61,7 +64,7 @@
<script> <script>
import { getSparringDetail, getQualityResult } from "@api/exercise" import { getSparringDetail, getQualityResult } from "@api/exercise"
export default { export default {
name: 'PairDetail', name: "PairDetail",
props: { props: {
detailObj: { detailObj: {
type: Object, type: Object,
...@@ -77,7 +80,7 @@ export default { ...@@ -77,7 +80,7 @@ export default {
totalTime: "0:00", totalTime: "0:00",
currentTime: "0:00", currentTime: "0:00",
isCircle: false, isCircle: false,
digest: '' digest: ""
} }
}, },
mounted() { mounted() {
...@@ -86,8 +89,23 @@ export default { ...@@ -86,8 +89,23 @@ export default {
this.conversationDetailPage() this.conversationDetailPage()
}, },
methods: { methods: {
handleDown(data) {
data.isdown = !data.isdown
},
regText(highlight, value) {
highlight = highlight ? JSON.parse(highlight) : []
let replacedText = value
if (value) {
highlight.forEach((item) => {
replacedText = replacedText.replace(item, function (match) {
return '<span style="color: #FE9220;">' + match + "</span>"
})
})
}
return replacedText
},
formatSrt(str) { formatSrt(str) {
return str ? str.replace(/\n/g, "<br/>") : '' return str ? str.replace(/\n/g, "<br/>") : ""
}, },
currentDialog(data) { currentDialog(data) {
this.myAud.currentTime = data.mergedOffset this.myAud.currentTime = data.mergedOffset
...@@ -96,7 +114,8 @@ export default { ...@@ -96,7 +114,8 @@ export default {
let minutes = Math.floor(seconds / 60) let minutes = Math.floor(seconds / 60)
let remainingSeconds = parseInt(seconds % 60) let remainingSeconds = parseInt(seconds % 60)
minutes = minutes > 10 ? minutes : `0${minutes}` minutes = minutes > 10 ? minutes : `0${minutes}`
remainingSeconds = remainingSeconds > 10 ? remainingSeconds : `0${remainingSeconds}` remainingSeconds =
remainingSeconds > 10 ? remainingSeconds : `0${remainingSeconds}`
return `${minutes}:${remainingSeconds}` return `${minutes}:${remainingSeconds}`
}, },
handleprogress() { handleprogress() {
...@@ -158,11 +177,14 @@ export default { ...@@ -158,11 +177,14 @@ export default {
pageSize: 9999 pageSize: 9999
}).then((res) => { }).then((res) => {
console.log(res) console.log(res)
res.list.forEach((item) => {
item.isdown = false
})
this.dialogList = res.list this.dialogList = res.list
}) })
getQualityResult({ getQualityResult({
taskStaffId: this.detailObj.id taskStaffId: this.detailObj.id
}).then(res => { }).then((res) => {
this.digest = res.digest this.digest = res.digest
}) })
} }
...@@ -175,7 +197,7 @@ export default { ...@@ -175,7 +197,7 @@ export default {
margin: auto; margin: auto;
.record { .record {
width: 600px; width: 100%;
margin: 5px auto 0px; margin: 5px auto 0px;
height: 56px; height: 56px;
background: #f7f9fa; background: #f7f9fa;
...@@ -254,9 +276,9 @@ export default { ...@@ -254,9 +276,9 @@ export default {
.record-info { .record-info {
width: 100%; width: 100%;
float: left; // float: left;
position: relative; // position: relative;
padding-right: 354px; // padding-right: 354px;
box-sizing: border-box; box-sizing: border-box;
height: 544px; height: 544px;
margin: 20px 0; margin: 20px 0;
...@@ -292,8 +314,9 @@ export default { ...@@ -292,8 +314,9 @@ export default {
} }
.dig-content { .dig-content {
width: 404px; width: fit-content;
background: #EBEBFF; // min-width: 404px;
background: #e6eeff;
border-radius: 4px; border-radius: 4px;
font-size: 14px; font-size: 14px;
color: #333333; color: #333333;
...@@ -303,6 +326,30 @@ export default { ...@@ -303,6 +326,30 @@ export default {
margin-left: 50px; margin-left: 50px;
margin-top: -20px; margin-top: -20px;
line-height: 20px; line-height: 20px;
.improve-btn {
margin-top: 14px;
margin-left: 4px;
width: 100px;
height: 28px;
background: #f7f9fa;
border-radius: 4px;
line-height: 28px;
font-size: 14px;
color: #2a58ad;
display: flex;
align-items: center;
justify-content: center;
.el-icon-arrow-down {
color: #2a58ad;
margin-left: 7px;
}
}
.pack {
width: 70px !important;
.el-icon-arrow-down {
transform: rotate(180deg);
}
}
} }
} }
...@@ -311,7 +358,7 @@ export default { ...@@ -311,7 +358,7 @@ export default {
.dig-content { .dig-content {
display: inline-block; display: inline-block;
background: #FFFFFF; background: #ffffff;
margin-right: 58px; margin-right: 58px;
} }
} }
...@@ -357,4 +404,54 @@ export default { ...@@ -357,4 +404,54 @@ export default {
} }
} }
} }
.suggest {
width: 100%;
// width: fit-content;
// max-width: 100%;
background: #fff;
border-radius: 4px;
font-size: 14px;
color: #333333;
padding: 10px 4px;
white-space: pre-wrap;
text-align: left;
line-height: 20px;
margin-top: 12px;
margin-right: 40px;
display: inline-block;
.improve {
width: 94px;
height: 28px;
border-radius: 4px;
padding: 4px 8px;
display: flex;
align-items: center;
font-weight: 500;
font-size: 14px;
color: #333333;
margin-bottom: 6px;
box-sizing: border-box;
white-space: nowrap;
.improve-img {
width: 14px;
height: 14px;
margin-right: 8px;
}
}
.improve-text {
margin: 0 8px;
}
.no-data {
font-weight: 400;
font-size: 12px;
color: #999ea8;
text-align: center;
}
.line {
width: 100%;
height: 1px;
margin: 12px 8px;
background-color: #ebedff;
}
}
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!