Commit ef88607f by 胡悦

AI对练联调

1 parent 80ba3133
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2024-04-19 11:02:02
* @LastEditors: huyue
* @LastEditTime: 2024-04-23 13:45:23
* @LastEditTime: 2024-04-23 16:16:52
*/
import request from "./request"
const path = 'dj.api.smartcarlife.ai.sparring.'
......@@ -50,3 +50,21 @@ export function getAllStore(data = {}) {
data.method = `dj.smartcarlife.api.yqMerchant.list`
return request(data)
}
// 获取质检结果
export function getQualityResult(data) {
data.method = `dj.api.carboutique.ai.sparring.detail.check.result`
return request(data)
}
// 查询对练详情
export function getSparringDetail(data) {
data.method = `${path}task.staff.detail.page`
return request(data)
}
// 更新任务提示词状态
export function updateTaskPromptStatus(data) {
data.method = `${path}task.updatePrompt`
return request(data)
}
......@@ -91,7 +91,7 @@ export default {
this.userInput[0] = event
},
handleEndInput (event) {
handleEndInput(event) {
const isNumber = /^\d+$/.test(event)
if (!isNumber) {
event = null
......@@ -130,15 +130,14 @@ export default {
this.$emit("focus", this)
}
},
handleBlur (index) {
handleBlur(index) {
this.pickerVisible = false
this.contrastValue()
},
contrastValue () {
const val = this.userInput
if (Array.isArray(val)) {
if (val[0] > val[1]) {
if (+val[0] > +val[1]) {
val[1] = null
}
}
......
......@@ -12,7 +12,7 @@
<el-tab-pane label="质检分析" name="analyse">
<quality-analyse v-if="activeName == 'analyse'" v-bind="$attrs" ref="analyseList" />
</el-tab-pane>
<el-tab-pane label="对话详情" name="dialogue">
<el-tab-pane label="对练详情" name="dialogue">
<dialogue-detail
v-if="activeName == 'dialogue'"
ref="dialogueDetail"
......
<template>
<div class="dialogue">
<div class="record">
<!-- <div class="record">
<audio id="audio1">
<source :src="detailObj.fileUrl" type="audio/mpeg" />
<source :src="detailObj.fileUrl" type="audio/ogg" />
......@@ -29,15 +29,15 @@
<img src="@/assets/trumpet.png" v-if="isMuted"/>
<img src="@/assets/mute.png" v-if="!isMuted" />
</div>
</div>
</div> -->
<div class="record-info">
<div class="dialog">
<template v-for="item in dialogList">
<div :class="{ 'dialog-detail': true, 'nth-child': item.role % 2 === 1 }" :key="item.id">
<div :class="{ 'dialog-detail': true, 'nth-child': item.role == 'b' }" :key="item.id">
<div class="name">
<img class="role" src="@/assets/role-one.png" v-if=" item.role % 2 === 0"/>
{{item.role % 2 === 0?'车主':'销售'}}
<img class="role" src="@/assets/role-two.png" v-if=" item.role % 2 === 1"/>
<img class="role" src="@/assets/role-one.png" v-if="item.role == 'a'" />
{{ item.role == 'b' ? '客户' : '销售' }}
<img class="role" src="@/assets/role-two.png" v-if="item.role == 'b'" />
</div>
<div class="dig-content" @click="currentDialog(item)">
{{ item.content }}
......@@ -50,8 +50,8 @@
<img class="robot" src="@/assets/robot.png" />
AI对话摘要
</div>
<div class="abText" v-html="formatSrt(detailObj.digest)">
<div class="abText" v-html="formatSrt(digest)">
</div>
</div>
</div>
......@@ -59,7 +59,7 @@
</template>
<script>
import { conversationDetailPage, getPointCategory } from "@api/resident"
import { getSparringDetail, getQualityResult } from "@api/exercise"
export default {
name: 'PairDetail',
props: {
......@@ -72,22 +72,22 @@ export default {
return {
myAud: "",
isPlay: true,
isMuted:true,
isMuted: true,
dialogList: [],
totalTime: "0:00",
currentTime: "0:00",
isCircle: false
isCircle: false,
digest: ''
}
},
mounted() {
this.myAud = document.getElementById("audio1")
this.handleprogress()
// this.myAud = document.getElementById("audio1")
// this.handleprogress()
this.conversationDetailPage()
},
methods: {
formatSrt(str) {
return str.replace(/\n/g, "<br/>")
return str ? str.replace(/\n/g, "<br/>") : ''
},
currentDialog(data) {
this.myAud.currentTime = data.mergedOffset
......@@ -148,18 +148,23 @@ export default {
},
handleMute() {
this.isMuted = !this.isMuted
this.myAud.muted=!this.isMuted
this.myAud.muted = !this.isMuted
},
conversationDetailPage() {
console.log(this.detailObj)
conversationDetailPage({
batchId: this.detailObj.id,
getSparringDetail({
taskStaffId: this.detailObj.id,
currentPage: 1,
pageSize: 9999
}).then((res) => {
console.log(res)
this.dialogList = res.list
})
getQualityResult({
taskStaffId: this.detailObj.id
}).then(res => {
this.digest = res.digest
})
}
}
}
......@@ -168,6 +173,7 @@ export default {
<style scoped lang="scss">
.dialogue {
margin: auto;
.record {
width: 600px;
margin: 5px auto 0px;
......@@ -176,6 +182,7 @@ export default {
border-radius: 32px;
display: flex;
align-items: center;
audio {
width: 600px;
height: 56px;
......@@ -183,22 +190,27 @@ export default {
border-radius: 32px;
}
}
.play {
width: 24px;
height: 24px;
margin: 0 20px 0 24px;
img {
width: 100%;
}
}
.trumpet {
width: 16px;
height: 16px;
margin-left: 24px;
img {
width: 100%;
}
}
.times {
font-size: 14px;
color: #666666;
......@@ -206,22 +218,28 @@ export default {
text-align: center;
margin-right: 19px;
}
#progressBar {
// position: absolute;
height: 6px;
width: 370px;
background-color: #e7e7e7; /* 进度条背景颜色 */
background-color: #e7e7e7;
/* 进度条背景颜色 */
border-radius: 6px;
}
#progress {
width: 0; /* 初始进度为0 */
width: 0;
/* 初始进度为0 */
height: 6px;
background-image: linear-gradient(90deg, #9662ff 0%, #5850ff 100%); /* 进度条颜色 */
transition: width 0.5s; /* 进度条宽度变化动画 */
background-image: linear-gradient(90deg, #9662ff 0%, #5850ff 100%);
/* 进度条颜色 */
transition: width 0.5s;
/* 进度条宽度变化动画 */
border-radius: 6px;
position: relative;
}
.circle {
width: 16px;
height: 16px;
......@@ -233,6 +251,7 @@ export default {
top: -4px;
box-sizing: border-box;
}
.record-info {
width: 100%;
float: left;
......@@ -241,6 +260,7 @@ export default {
box-sizing: border-box;
height: 544px;
margin: 20px 0;
// display: flex;
// align-items: center;
.dialog {
......@@ -252,14 +272,17 @@ export default {
overflow-y: scroll;
padding: 20px;
box-sizing: border-box;
.dialog-detail {
margin-bottom: 8px;
text-align: left;
.name {
font-size: 12px;
color: #666666;
letter-spacing: 0;
line-height: 16px;
.role {
width: 40px;
height: 40px;
......@@ -267,6 +290,7 @@ export default {
margin-right: 10px;
}
}
.dig-content {
width: 404px;
background: #EBEBFF;
......@@ -281,8 +305,10 @@ export default {
line-height: 20px;
}
}
.nth-child {
text-align: right;
.dig-content {
display: inline-block;
background: #FFFFFF;
......@@ -290,6 +316,7 @@ export default {
}
}
}
.abstract {
width: 334px;
height: 544px;
......@@ -301,10 +328,12 @@ export default {
border: 1px solid #5850ff80;
border-radius: 4px;
box-sizing: border-box;
.title {
font-weight: 700;
font-size: 16px;
color: #333333;
.robot {
width: 28px;
height: 28px;
......@@ -313,6 +342,7 @@ export default {
vertical-align: middle;
}
}
.abText {
margin-top: 14px;
width: 294px;
......
......@@ -67,14 +67,14 @@
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
:hasPage="false">
:has-page="false">
<div slot="scoreHtml" slot-scope="scope">
<template v-if="scope.scope.score || scope.scope.score === 0">
{{ scope.scope.score }}
</template>
<template v-else>--</template>
</div>
<template slot="suggestions" slot-scope="scope">
<template slot="suggestions" slot-scope="scope">
<div v-html="formatSrt(scope.scope.suggestions)"></div>
</template>
<template slot="hitResult" slot-scope="scope">
......@@ -88,7 +88,8 @@
<script>
import ElInputRange from "../../el-input-range"
import { Util, deepClone } from "@/common/util"
import { conversationCheckList, getPointCategory } from "@api/resident"
// import { conversationCheckList, getPointCategory } from "@api/resident"
import { getQualityResult } from "@api/exercise"
export default {
name: 'QualityInspectionAnalyse',
components: {
......@@ -114,23 +115,9 @@ export default {
{
text: '预计营销结果',
formatter: data => {
let classStr = data.estimatedResult == '成交' ? (data.estimatedResult == '战败' ? 'redStr' : 'greenStr') : 'grayStr'
const classStr = data.estimatedResult == '成交' ? (data.estimatedResult == '战败' ? 'redStr' : 'greenStr') : 'grayStr'
return `<span class="${classStr}" style="font-weight:700;font-size:20px;">${data.estimatedResult ? data.estimatedResult : '--'}</span>`
}
},
{
text: "开始录音时间",
formatter: (data) => {
return `<span style="font-weight:700;font-size:20px;">${
data.startTime ? data.startTime : "--"
}</span>`
}
},
{
text: '对话时长',
formatter: data => {
return `<span style="font-weight:700;font-size:20px;">${this.toMinutesAndSeconds(data.duration)}</span>`
},
}
],
searchForm: {
......@@ -158,10 +145,10 @@ export default {
}
],
select: "全部",
getListApi: conversationCheckList,
getListApi: getQualityResult,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "list",
listName: "checkDetailList",
tableOption: false,
tableColumns: [
{
......@@ -193,8 +180,8 @@ export default {
{
label: "话术建议",
prop: "suggestions",
addHtml:'suggestions',
align:'left'
addHtml: 'suggestions',
align: 'left'
}
]
},
......@@ -221,15 +208,15 @@ export default {
let formattedTime = ''
if (seconds < 60) return seconds + '秒'
else if (seconds > 3600) {
let hours = Math.floor(seconds / 3600),
minutes = Math.floor((seconds % 3600) / 60)
const hours = Math.floor(seconds / 3600)
const minutes = Math.floor((seconds % 3600) / 60)
if (hours > 0) formattedTime += hours + '小时'
if (minutes > 0 || hours > 0) formattedTime += minutes + '分'
return formattedTime
} else {
let hours = Math.floor(seconds / 3600),
minutes = Math.floor((seconds % 3600) / 60),
remainingSeconds = seconds % 60
const hours = Math.floor(seconds / 3600)
const minutes = Math.floor((seconds % 3600) / 60)
const remainingSeconds = seconds % 60
if (hours > 0) formattedTime += hours + '小时'
if (minutes > 0 || hours > 0) formattedTime += minutes + '分'
if (remainingSeconds > 0) formattedTime += remainingSeconds + '秒'
......@@ -263,9 +250,10 @@ export default {
beforeSearchFn() {
return new Promise((resolve) => {
this.searchFormSearch = deepClone(this.searchForm)
this.searchFormSearch.batchId = this.detailObj.id
this.searchFormSearch.pageSize = 99999
this.searchFormSearch.taskStaffId = this.detailObj.id
// this.searchFormSearch.pageSize = 99999
if (this.searchFormSearch.qualityTestScore) {
console.log(this.searchForm, '===')
this.searchFormSearch.qualityTestScoreBegin =
this.searchFormSearch.qualityTestScore[0]
this.searchFormSearch.qualityTestScoreEnd =
......@@ -361,4 +349,4 @@ export default {
.grayStr{
color: #999999;
}
</style>
\ No newline at end of file
</style>
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2024-04-16 17:54:27
* @LastEditors: huyue
* @LastEditTime: 2024-04-23 14:23:11
* @LastEditTime: 2024-04-24 15:02:34
-->
<template>
<div>
......@@ -76,17 +76,20 @@ export default {
{
label: "手机号",
name: "staffPhone",
type: "input"
type: "input",
isclear: true
},
{
label: "驻店名称",
name: "yqMerchantName",
type: "input"
type: "input",
isclear: true
},
{
label: "完成时间",
name: "completionTime",
type: "datePicker"
type: "datePicker",
isclear: true
}
],
// table 相关
......@@ -143,6 +146,7 @@ export default {
this.searchFormSearch = {}
this.$refs.exerciseDetailTable.refreshTable(true, true)
},
// 查询和导出的参数
getParams() {
var params = deepClone(this.searchForm)
const { activeName } = this
......@@ -152,7 +156,7 @@ export default {
params.endTime = Util.dateFormate(params.completionTime[1], 'YYYY-MM-DD HH:mm:ss')
delete params.completionTime
}
params.sparringStatus = activeName != 'all' ? v : ''
params.sparringStatus = activeName != 'all' ? activeName : ''
return params
},
beforeSearchFn() {
......@@ -167,10 +171,15 @@ export default {
this.activeName = tab.name
this.handleSearch()
},
// 查看结果和提醒
btnClick(scope) {
console.log(scope, '2222222')
const _row = scope.scope
if (!_row.sparringStatus) {
if (_row.sparringStatus == '1') {
// 查看结果
this.detailObj = _row
this.isQualityVisible = true
} else {
this.$confirm('是否确认发送提醒给驻店员工?', '发送提醒', {
confirmButtonText: '确定',
type: 'warning'
......@@ -184,9 +193,6 @@ export default {
this.$message.success('提醒成功')
})
})
} else {
this.detailObj = _row
this.isQualityVisible = true
}
},
closeDialog() {
......
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2024-04-15 16:26:57
* @LastEditors: huyue
* @LastEditTime: 2024-04-22 15:42:40
* @LastEditTime: 2024-04-24 14:43:49
-->
<template>
<div>
......@@ -56,7 +56,7 @@
<script>
import { mapActions, mapState } from 'vuex'
import { Util, deepClone } from '@/common/util'
import { getList } from '@api/exercise'
import { getList, updateTaskPromptStatus } from '@api/exercise'
export default {
data() {
return {
......@@ -67,39 +67,39 @@ export default {
name: 'taskName',
type: 'input'
},
{
label: '状态',
name: 'taskState',
type: 'select',
optionList: [
{
label: '全部',
value: ''
},
{
label: '进行中',
value: '1'
},
{
label: '已结束',
value: '2'
},
{
label: '未开始',
value: '0'
}
],
optionId: "value",
optionLabel: "label",
isClear: true
},
// {
// label: '状态',
// name: 'taskState',
// type: 'select',
// optionList: [
// {
// label: '全部',
// value: ''
// },
// {
// label: '进行中',
// value: '1'
// },
// {
// label: '已结束',
// value: '2'
// },
// {
// label: '未开始',
// value: '0'
// }
// ],
// optionId: "value",
// optionLabel: "label",
// isClear: true
// },
{
label: '业务场景',
name: 'businessScenario',
type: 'select',
isClear: true,
optionList: [{
label: '请选择',
label: '全部',
name: ''
}, {
label: '会员权益/升级',
......@@ -119,8 +119,8 @@ export default {
label: '任务时间',
name: 'taskTime',
type: 'datePicker',
isClear: true,
pickerOptions: 'rangePickerOptions'
isClear: true
// pickerOptions: 'rangePickerOptions'
}
],
statusTypeList: [
......@@ -175,7 +175,7 @@ export default {
label: '任务时间',
prop: 'startTime',
formatter: cellValue => {
return Util.dateFormate(cellValue.startTime, 'YYYY-MM-DD') + '-' + Util.dateFormate(cellValue.updatedDate, 'YYYY-MM-DD')
return Util.dateFormate(cellValue.startTime, 'YYYY-MM-DD') + '-' + Util.dateFormate(cellValue.endTime, 'YYYY-MM-DD')
}
}]
}
......@@ -233,22 +233,27 @@ export default {
// 状态改变
handleSwitch(scope, e) {
console.log(scope)
scope.scope.enabledFlag
? this.$confirm('是否确认开启提示词?', '提示', {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
console.log('dia开启')
scope.scope.enabledFlag = !scope.scope.enabledFlag
// this.$refs.employeeRef.refreshTable(false)
})
: this.$confirm('是否确认关闭提示词?', '提示', {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
console.log('dia关闭')
scope.enabledFlag = !scope.enabledFlag
const { promptOnOff, id } = scope.scope
this.$confirm(`是否确认${promptOnOff ? '关闭' : '开启'}提示词?`, '提示', {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
console.log('dia开启')
updateTaskPromptStatus({
id,
promptOnOff: !promptOnOff
}).then(res => {
if (res && res.id) {
this.$message.success('修改成功')
} else {
this.$message.error('修改失败')
}
this.$refs.exerciseTable.refreshTable(true)
}).catch(err => {
console.log(err)
this.$message.error('修改失败')
})
})
},
// 明细
handleToDetail(row) {
......
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2024-04-17 17:50:41
* @LastEditors: huyue
* @LastEditTime: 2024-04-23 09:56:53
* @LastEditTime: 2024-04-24 11:42:03
-->
<template>
<div>
......@@ -31,7 +31,7 @@
<span>{{ taskType[taskInfo.taskType] }}</span>
</el-form-item>
<el-form-item label="客户分类:">
<span>3个月</span>
<span>{{ aiType[taskInfo.aiType] }}</span>
</el-form-item>
<el-form-item label="提示词:">
<span>{{ taskInfo.promptOnOff == 1 ? '开' : '关' }}</span>
......@@ -52,24 +52,16 @@
:get-list-api="getListApi">
</d2-table>
</div>
<!-- <el-table style="width: 728px" :data="tableData" border stripe :row-style="{height: '50px'}" :header-cell-style="{background:'#F4F6FC'}">
<el-table-column label="序号" type="index" width="50">
</el-table-column>
<el-table-column label="门店名称" prop="staffName" align="center">
</el-table-column>
<el-table-column label="驻店员工名称" prop="phoneNumber" align="center">
</el-table-column>
<el-table-column label="手机号" prop="registerTime" align="center">
</el-table-column>
</el-table> -->
</el-form-item>
</div>
</div><el-form-item style="margin-top: 40px;text-align: center;">
<el-button class="width_100 cancel-btn" type="primary" plain @click="handleClose"> 返回 </el-button>
</el-form-item>
</el-form>
</d2-container>
</div>
</template>
<script>
import { mapActions } from 'vuex'
import { getTaskStaffList } from "@api/exercise"
export default {
data() {
......@@ -103,6 +95,17 @@ export default {
taskInfo: {},
taskType: {
1: '实战演练'
},
aiType: {
1: '独裁型',
2: '沉默型',
3: '理智型',
4: '人际型',
5: '犹豫型',
6: '新手司机',
7: '老手司机',
8: '女司机',
9: '价格型'
}
}
},
......@@ -110,6 +113,16 @@ export default {
this.taskInfo = this.$route.query.row
console.log(this.taskInfo)
this.searchForm.taskId = this.taskInfo.id
},
methods: {
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
handleClose() {
this.close({ tagName: '/exerciseView' })
this.$router.push({ name: 'exercise' })
}
}
}
</script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!