Commit 39eacbea by liimin

feat(reception): 优化接待详情页功能并修复对话组件问题

- 修改取消按钮文本为"开始新的"
- 移除无用代码并优化数据结构处理
- 新增接待相关API接口
- 重构标签组件改为接收props数据
- 优化对话组件时间轴渲染逻辑
- 修复接待详情页数据加载和展示问题
- 使用Object.freeze优化性能
- 完善错误处理和日志记录
1 parent 0bb37a0c
......@@ -5,5 +5,11 @@ module.exports = {
},
getList (data) {
return http.shukeRequest('linkwe-gateway/reception/reception/page', data, 'POST',false)
},
findCheckResultListByReceptionId (data) {
return http.shukeRequest('linkwe-gateway/reception/reception/findCheckResultListByReceptionId', data, 'GET',false)
},
findConversationDetailByReceptionId (data) {
return http.shukeRequest('linkwe-gateway/reception/reception/findConversationDetailByReceptionId', data, 'GET',false)
}
}
\ No newline at end of file
......@@ -267,7 +267,7 @@ export default {
// "receptionCustomerMaterialPointList": null,
// "carPurchaseMethod": null,
// "checkHistoryFlag": 0,
// "batchId": 62377,
// "batchId": 72,
// "score": 35,
// "recordingUrl": "https://glsk-oss.oss-cn-shenzhen.aliyuncs.com/quality/176544865331017654474319060.mp3",
// "recordId": null,
......@@ -296,12 +296,12 @@ export default {
// "totalDuration": 1975
// }
if (this.tabIndex == 0) { // 已上传 && 新质检
const { sceneType } = uni.$storage.get("userInfo");
if (sceneType == 1 || item.checkHistoryFlag != 0 || item.score == null) return uni.showToast({
title: '该接待尚不支持复盘',
icon: "none"
})
this.tabIndex = -1
// const { sceneType } = uni.$storage.get("userInfo");
// if (sceneType == 1 || item.checkHistoryFlag != 0 || item.score == null) return uni.showToast({
// title: '该接待尚不支持复盘',
// icon: "none"
// })
// this.tabIndex = -1
uni.navigateTo({
url: `/pages/common/receptionDetail/index`,
success (res) {
......
......@@ -26,7 +26,7 @@
title="恢复接待"
content="检测到您有上次未完成的接待,是否继续接待?"
confirmBtnText="继续接待"
cancelBtnText="不再提示"
cancelBtnText="开始新的"
:showCancelBtn="true"
:popupW="704"
@confirm="resumeConfirm"
......
......@@ -84,7 +84,6 @@
class="progress-bar"
:style="[{height:`${progress}%`}]"
></view>
<template v-if="true">
<template v-for="(item,index) in axisList">
<block :key="index">
<view
......@@ -112,15 +111,14 @@
v-for="(item,index) in axisList"
:key="index"
>
<block v-if="item.inspectionConversationDetailId">
<block v-if="item.checkResultId">
<view
:class="['axis-line']"
:style="[{height:`${item.height + 20 + 'px'}`},{top:`${item.docTop - 10 + 'px'}`}]"
:style="[{top:`${item.docTop - 10 + 'px'}`}]"
></view>
</block>
</block>
</view>
</template>
</view>
</view>
</view>
......@@ -150,7 +148,7 @@ export default {
batchId: {
handler (n) {
const data = {
batchId: n,
receptionId: n,
};
this.findConversationDetailByBatchIdNew(data)
},
......@@ -195,14 +193,13 @@ export default {
i.detailClassName = i.detailClassName == 'up' ? 'down' : 'up'
},
async findConversationDetailByBatchIdNew (params) {
const res = await uni.$api.receptionApi.findConversationDetailByBatchIdNew(params)
const res = await uni.$api.reception.findConversationDetailByReceptionId(params)
res.map(e => {
e.time = this.formatTime(e.mergedOffset)
e.text_id = `text_${e.mergedOffset}`
if (e?.recordingCheckResultList && e.recordingCheckResultList.length) {
e.recordingCheckResultList.map(i => {
i.detailClassName = 'down'
console.log(i.scriptRec)
let [scriptRec] = JSON.parse(i.scriptRec)
if (scriptRec) i.scriptRec = scriptRec.replace(/\n/g, '<br>')
else i.scriptRec = ''
......@@ -214,7 +211,7 @@ export default {
async findCbByBatchId () {
let data = JSON.parse(JSON.stringify(this.qualityData))
let { totalDuration } = this,
margin = 20
margin = 20
utils.getViewInfo('.axis-bar', ({
height: containerHeight,
top: barTop
......@@ -227,27 +224,25 @@ export default {
this.barTop = barTop
this.containerHeight = containerHeight
let axisList = []
data?.sort((a, b) => a.offset - b.offset).forEach(e => {
const {
offset: mergedOffset,
id
} = e
e.top = mergedOffset / totalDuration * containerHeight
e.docTop = mergedOffset / totalDuration * containerHeight
e.text_id = `text_${mergedOffset}`
e.mergedOffset = mergedOffset
if (mergedOffset != null) axisList.push(e)
})
axisList.map((e, index) => {
// 检查并调整 top 值,避免重叠
for (let i = 0; i < index; i++) {
if (e.top < axisList[i].top + margin &&
e.top + margin > axisList[i].top) {
// 如果重叠,将当前元素的 top 设置为前一个元素的底部加上 margin
e.top = axisList[i].top + margin;
data.filter(e => e.offset != null)
.sort((a, b) => a.offset - b.offset)
.forEach(e => {
const mergedOffset = e.offset / 1000
let top = mergedOffset / totalDuration * containerHeight
e.docTop = top
e.text_id = `text_${mergedOffset}`
e.mergedOffset = mergedOffset
// 检查并调整 top 值,避免重叠
// 由于数据已按 offset (时间)排序,我们只需要检查当前元素是否与 上一个已放置的元素 重叠即可。如果重叠,直接将当前元素放置在上一个元素的下方( prevTop + margin )
if (axisList.length > 0) {
const prevTop = axisList[axisList.length - 1].top
if (top < prevTop + margin) {
top = prevTop + margin
}
}
}
})
e.top = top
axisList.push(e)
})
this.axisList = axisList
})
},
......
......@@ -12,14 +12,6 @@ export default {
icon: String
},
name: '',
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
......
......@@ -21,34 +21,10 @@ export default {
components: {
ReceptionTitle
},
data () {
return {
tags: []
}
},
props: {
batchId: [String, Number]
},
watch: {
batchId: {
handler (val) {
if (val) this.getTags(val)
},
immediate: true
}
},
mounted () {
},
methods: {
async getTags (batchId) {
const res = await uni.$api.receptionApi.findRecordingTagByBatchId({
batchId
})
let tags = []
res.map(e =>{
tags.push(`${e.tagGroupName}-${e.tagName}`)
})
this.tags = tags
tags: {
type: Array,
default: () => []
}
}
}
......
......@@ -106,7 +106,7 @@ export default {
typeCode,
status: 0
})
this.folderList = Array.isArray(first_res?.data) ? first_res.data : []
this.folderList = Object.freeze(Array.isArray(first_res?.data) ? first_res.data : [])
if (!this.folderList.length) return this.resetLists()
// 并行请求所有文件夹内容
......@@ -133,7 +133,7 @@ export default {
},
processMaterials(materials) {
this.moduleList = materials.map(item => ({
this.moduleList = Object.freeze(materials.map(item => ({
...item,
thumbnail: item.materialUrl,
title: item.materialName,
......@@ -145,14 +145,14 @@ export default {
receptionSourceDetailList: {
detailUrl: item.materialUrl
}
}))
})))
this.toolList = materials.map(item => ({
this.toolList = Object.freeze(materials.map(item => ({
...item,
shortTitle: item.materialName,
title: item.materialName,
shortTitleUrl: item.materialUrl
}))
})))
},
// 获取首页素材
......@@ -162,7 +162,7 @@ export default {
status: 0,
showOnHomepage: 1
})
this.homeList = Array.isArray(res?.data) ? res.data : []
this.homeList = Object.freeze(Array.isArray(res?.data) ? res.data : [])
},
changeType () {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!