Commit 2885fa32 by 胡悦

提交新之间规则

1 parent aba9cc40
...@@ -523,3 +523,21 @@ export function getStaffAttendanceDetailAPI(data) { ...@@ -523,3 +523,21 @@ export function getStaffAttendanceDetailAPI(data) {
data.method = `${path2}clock.in.staff.attendance.detail` data.method = `${path2}clock.in.staff.attendance.detail`
return request(data, "post") return request(data, "post")
} }
// 查询录音标签
export function getRecordTagList(data) {
data.method = `${path2}reception.findRecordingTagByBatchId`
return request(data, "post")
}
// 查询质检列表|侧边栏
export function getQualityList(data) {
data.method = `${path2}reception.findCheckResultByBatchId`
return request(data, "post")
}
// 查询对话内容
export function getConversationDetail(data) {
data.method = `${path2}reception.findConversationDetailByBatchIdNew`
return request(data, "post")
}
\ No newline at end of file \ No newline at end of file
<template>
<div class="div">
<div class="classify-container">
<div class="scroll-arrow left" v-show="showLeftArrow" @click="handleScroll('left')">
<i class="el-icon-arrow-left"></i>
</div>
<div class="classify-wrap" ref="classifyWrap">
<template v-for="(item,index) in classifyList">
<div
:class="['classify-item flex',{active: index == activeIndex}]"
:key="index"
@click="activeIndex = index"
>
<div class="title">{{item.tagGroupName}}</div>
<div class="score"><span>{{item.score||item.score===0?item.score:'-'}}</span>/{{item.sumScore||item.sumScore===0?item.sumScore :'-'}}</div>
</div>
</template>
</div>
<div class="scroll-arrow right" v-show="showRightArrow" @click="handleScroll('right')">
<i class="el-icon-arrow-right"></i>
</div>
</div>
<div
class="scroll-view"
:style="{ height: `${dialogueBoxHeight - 56}px` }"
>
<template v-if="qualityData[activeIndex]">
<div class="quality-block" >
<div class="title flex">
{{qualityData[activeIndex].tagGroupName}}
<div :class="['matched-btn flex', qualityData[activeIndex].matchedClass]">{{qualityData[activeIndex].matchedText}}</div>
</div>
<template v-for="(item,index) in qualityData[activeIndex].conversationDetailDTOList">
<div :key="index">
<div
v-if="item.text_id"
:id="item.text_id"
:class="['quality-item flex',{active:item.text_id == activeId}]"
@click="seekPlay(item)"
>
<div class="avatar-box">
<img :src="require(`@/assets/role-${item.role}.png`)" class="sprite-icon" />
<div class="time">{{item.time}}</div>
</div>
<div class="text flex">{{item.content}}</div>
</div>
<template v-if="item.scriptRec">
<div class="script-rec">
<div class="suggestions-box">
<div class="suggestions-title">
<div class="sprite-icon icon-suggestions-icon"></div>
话术推荐
</div>
<div class="text">
<div v-html="item.scriptRec"></div>
</div>
</div>
</div>
</template>
</div>
</template>
</div>
</template>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import { getQualityList } from '@/api/resident'
export default {
name: '',
props: {
batchId: [String, Number],
qualityData: {
type: Array,
default: () => []
},
qualityAudio: {
type: [Object, HTMLElement],
required: true
},
dialogueBoxHeight: {
type: Number,
default: 0
}
},
data () {
return {
classifyList: [],
activeIndex: 0,
showLeftArrow: false,
showRightArrow: false,
activeId: ''
}
},
mounted () {
this.getQualityList()
this.$nextTick(() => {
this.checkScrollArrows()
window.addEventListener('resize', this.checkScrollArrows)
})
},
beforeDestroy() {
window.removeEventListener('resize', this.checkScrollArrows)
},
methods: {
async getQualityList() {
this.classifyList = await getQualityList({
batchId: this.batchId
})
this.$nextTick(() => {
this.checkScrollArrows()
})
},
checkScrollArrows() {
const wrap = this.$refs.classifyWrap
if (!wrap) return
this.showLeftArrow = wrap.scrollLeft > 0
this.showRightArrow = wrap.scrollLeft < (wrap.scrollWidth - wrap.clientWidth)
},
handleScroll(direction) {
const wrap = this.$refs.classifyWrap
if (!wrap) return
const scrollAmount = 200 // 每次滚动的距离
const newScrollLeft = direction === 'left'
? wrap.scrollLeft - scrollAmount
: wrap.scrollLeft + scrollAmount
wrap.scrollTo({
left: newScrollLeft,
behavior: 'smooth'
})
// 滚动结束后检查箭头状态
setTimeout(() => {
this.checkScrollArrows()
}, 300)
},
onTimeUpdate () {
const {
mergedOffset
} = this.setProgress()
this.activeId = `text_${mergedOffset}`
},
setProgress () {
const {
currentTime
} = this.qualityAudio,
mergedOffset = Math.ceil(currentTime)
return {
currentTime,
mergedOffset
}
},
seekPlay (item) {
let { activeId } = this
this.$emit('seek', item.mergedOffset)
if (item.text_id == activeId) {
const {
paused
} = this.qualityAudio
if (paused) this.$emit('onPlay')
else this.$emit('onPause')
this.$emit('changeOperate', !paused)
} else {
this.$emit('onPlay')
this.$emit('changeOperate', false)
}
}
}
}
</script>
<style scoped lang='scss'>
.flex {
display: flex;
align-items: center;
}
.div {
height: 100%;
width: 100%;
position: relative;
.classify-container {
position: relative;
display: flex;
align-items: center;
width: 100%;
height: 56px;
background: #F7F9FA;
}
.classify-wrap {
width: 100%;
height: 48px;
display: flex;
flex-wrap: nowrap;
overflow-x: auto;
scroll-behavior: smooth;
padding: 0 4px;
&::-webkit-scrollbar {
display: none;
}
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
.classify-item {
box-sizing: border-box;
min-width: 80px;
height: 100%;
padding: 6px 12px;
flex-shrink: 0;
justify-content: center;
flex-direction: column;
line-height: 20px;
font-size: 14px;
transition: all .15s;
background: #F7F9FA;
text-align: center;
.title {
color: #666;
}
.score {
color: #999;
}
}
.active {
border-radius: 8px;
background: #ffffff;
.title {
color: #2A58AD;
font-weight: 500;
}
}
}
.scroll-arrow {
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 24px;
height: 56px;
display: flex;
align-items: center;
justify-content: center;
background: #F7F9FA;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
cursor: pointer;
z-index: 1;
&.left {
left: 0;
}
&.right {
right: 0;
}
i {
font-size: 16px;
color: #808285;
}
}
.scroll-view {
// height: calc(100% - 56px);
height: 100%;
width: 100%;
// border-radius: 14px;
background: #F0F3F8;
overflow-y: auto;
}
.quality-block {
margin-top: 10px;
.title {
height: 36px;
background: linear-gradient(119.9deg, #e1f7fc 0%, #f3f7ff 27%, #f7f2ff 41%, #e8f1ff 66%, #f7f2ff 100%);
font-size: 14px;
font-weight: 600;
padding: 0 10px;
&::before {
content: '';
width: 4px;
height: 4px;
background: #000000;
border-radius: 100%;
display: block;
margin-right: 8px;
}
.matched-btn {
margin-left: auto;
height: 28px;
border-radius: 14px;
background: #ffffff;
padding: 0 18px;
color: #eb4e4e;
font-size: 12px;
font-weight: 600;
}
.hit {
color: #35c376;
}
}
.quality-item {
padding: 10px 12px;
background: #fff;
.avatar-box {
position: relative;
width: 34px;
width: 34px;
height: 48px;
flex-shrink: 0;
display: flex;
align-items: center;
flex-direction: column;
.sprite-icon {
width: 34px;
height: 34px;
border-radius: 100%;
overflow: hidden;
flex-shrink: 0;
}
.time {
width: 35px;
height: 14px;
background: #ffffff;
border: 1px solid #f0f6ff;
border-radius: 14px;
font-size: 10px;
color: #999ea8;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
}
}
.text {
width: 361px;
min-height: 40px;
color: #292d33;
font-size: 13px;
margin-left: 8px;
line-height: 22px;
}
}
.active {
background: #f0f6ff;
.text {
font-weight: 500;
}
}
.script-rec {
padding: 12px;
.suggestions-box {
background: #ffffff;
border-radius: 8px;
padding: 12px 14px;
box-sizing: border-box;
.suggestions-title {
display: flex;
align-items: center;
font-weight: 500;
font-size: 14px;
color: #333333;
margin-bottom: 10px;
.sprite-icon {
margin-right: 6px;
}
}
.text {
color: #292d33;
font-size: 13px;
line-height: 22px;
}
.suggestions-text {
padding-bottom: 11px;
border-bottom: 1px solid #f0f6ff;
margin-bottom: 12px;
}
}
}
.active {
background: #f0f6ff;
.text {
font-weight: 500;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="quality-table-box">
<div class="title">话术标签</div>
<div class="tag-box" ref="tagBox">
<div class="tag-item" v-for="item in tagList" :key="item.tagId">
{{ item.tagGroupName }} - {{ item.tagName }}
</div>
</div>
<div class="title">质检明细</div>
<div class="quality-table">
<div class="quality-content">
<el-table
:data="processedQualityList"
border
style="width: 100%"
:height="tableHeight"
:max-height="tableHeight">
<el-table-column type="index" label="序号" align="center" width="80">
</el-table-column>
<el-table-column prop="tagGroupName" label="一级分类" align="center" width="120">
</el-table-column>
<el-table-column label="质检得分" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.score }}/{{ scope.row.sumScore }}
</template>
</el-table-column>
<el-table-column prop="scriptRec" label="命中文本" align="center">
<template slot-scope="scope">
<el-tooltip :content="scope.row.processedScriptRec" placement="top" effect="light">
<div class="text-ellipsis">{{ scope.row.processedScriptRec }}</div>
</el-tooltip>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import {getRecordTagList, getQualityList} from '@/api/resident'
export default {
props: ['batchId', 'qualityData'],
data() {
return {
qualityList: [],
tagList: [],
tableHeight: 430
}
},
computed: {
processedQualityList() {
return this.qualityData.map(item => ({
...item,
processedScriptRec: item.scriptRec?.replace(/[\[\]"]/g, '') || ''
}))
}
},
mounted() {
this.getRecordTagList()
this.calculateTableHeight()
// this.getQualityList()
},
methods: {
async getRecordTagList() {
this.tagList = await getRecordTagList({
batchId: this.batchId
})
this.$nextTick(() => {
this.calculateTableHeight()
})
},
calculateTableHeight() {
// 获取屏幕高度
const screenHeight = window.innerHeight
// 获取话术标签box的高度
const tagBoxHeight = this.$refs.tagBox ? this.$refs.tagBox.offsetHeight : 0
// 其他固定元素的高度(标题、间距等)
const otherHeight = 260 // 标题高度 + 间距
// 计算表格高度 = 屏幕高度 - 话术标签box高度 - 其他固定元素高度
this.tableHeight = screenHeight - tagBoxHeight - otherHeight
},
// async getQualityList() {
// this.qualityList = await getQualityList({
// batchId: this.batchId
// })
// }
}
}
</script>
<style scoped lang='scss'>
.quality-table-box {
font-size: 16px;
color: #1D1D1D;
.title {
font-size: 16px;
color: #1D1D1D;
font-weight: 500;
margin-bottom: 10px;
}
.tag-box {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-bottom: 20px;
.tag-item {
padding: 8px 12px;
border-radius: 4px;
background-color: #EAEEF7;
border: 1px solid #2A58AD;
color: #333;
font-size: 14px;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -182,12 +182,21 @@ ...@@ -182,12 +182,21 @@
@closeDialog="closeDialog" @closeDialog="closeDialog"
ref="qualityDetail" ref="qualityDetail"
></quality-detail> ></quality-detail>
<new-quality-detail
:is-quality-visible="isNewQualityVisible"
v-if="isNewQualityVisible"
:currentNum="currentNum"
:qualityDetailList="qualityDetailList"
@closeDialog="closeDialog"
ref="newQualityDetail"
></new-quality-detail>
</div> </div>
</template> </template>
<script> <script>
import { Util, deepClone } from "@/common/util" import { Util, deepClone } from "@/common/util"
import ElInputRange from "../el-input-range" import ElInputRange from "../el-input-range"
import QualityDetail from "./qualityDetail.vue" import QualityDetail from "./qualityDetail.vue"
import NewQualityDetail from "./newQualityDetail.vue"
import { conversationPage } from "@api/resident" import { conversationPage } from "@api/resident"
import reportTrackFunMixin from '@/mixins/reportTrackFunMixin' import reportTrackFunMixin from '@/mixins/reportTrackFunMixin'
export default { export default {
...@@ -199,6 +208,7 @@ export default { ...@@ -199,6 +208,7 @@ export default {
data () { data () {
return { return {
isQualityVisible: false, isQualityVisible: false,
isNewQualityVisible: false,
searchForm: { searchForm: {
recepTime: [], recepTime: [],
qualityTestScore: [], qualityTestScore: [],
...@@ -340,7 +350,8 @@ export default { ...@@ -340,7 +350,8 @@ export default {
}, },
components: { components: {
ElInputRange, ElInputRange,
QualityDetail QualityDetail,
NewQualityDetail
}, },
watch: { watch: {
show: { show: {
...@@ -396,8 +407,10 @@ export default { ...@@ -396,8 +407,10 @@ export default {
this.$refs.recepDetail.refreshTable() this.$refs.recepDetail.refreshTable()
}, },
closeDialog () { closeDialog () {
this.$refs.qualityDetail.onPageHide() if(this.$refs.qualityDetail) this.$refs.qualityDetail.onPageHide()
if(this.$refs.newQualityDetail) this.$refs.newQualityDetail.onPageHide()
this.isQualityVisible = false this.isQualityVisible = false
this.isNewQualityVisible = false
this.onPageShow() this.onPageShow()
}, },
qualitDetail (row) { qualitDetail (row) {
...@@ -405,7 +418,11 @@ export default { ...@@ -405,7 +418,11 @@ export default {
currentNum = list.findIndex((e) => e.id == row.id) currentNum = list.findIndex((e) => e.id == row.id)
this.currentNum = currentNum this.currentNum = currentNum
this.qualityDetailList = list this.qualityDetailList = list
if (row.checkHistoryFlag === 0) {
this.isNewQualityVisible = true
} else {
this.isQualityVisible = true this.isQualityVisible = true
}
this.onPageHide() this.onPageHide()
}, },
beforeSearchFn () { beforeSearchFn () {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!