fix: 更新API基础路径并优化SOP分析功能

- 将API基础路径从192.168.15.54更新为192.168.15.60
- 优化CustomerDetail组件中的SOP分析按钮状态控制
- 在SalesTimelineWithTaskList组件中添加直播发言展示功能
- 重构RawDataCards组件的查看原文逻辑,触发SOP分析并显示通话记录
This commit is contained in:
2025-08-20 15:20:51 +08:00
parent 5973039d4a
commit ae579d637f
4 changed files with 53 additions and 50 deletions

View File

@@ -116,6 +116,7 @@
<script setup>
import { ref, computed } from 'vue'
import axios from 'axios'
// Props
const props = defineProps({
@@ -137,6 +138,9 @@ const props = defineProps({
}
})
// Emits
const emit = defineEmits(['analyze-sop'])
// 当前激活的tab
const activeTab = ref('chat')
@@ -272,44 +276,18 @@ const downloadRecording = (call) => {
// 查看原文方法
const viewTranscript = async (call) => {
console.log('查看原文:', call)
// 触发SOP分析
emit('analyze-sop', {
type: 'call',
data: call,
content: call.record_context || ''
})
// 检查是否有录音文件地址
if (call.record_file_addr_list && call.record_file_addr_list.length > 0) {
const audioFileUrl = call.record_file_addr_list[0]
try {
// 创建FormData对象
const formData = new FormData()
formData.append('audio_file', audioFileUrl)
// 发送POST请求到ASR API
const response = await fetch('http://192.168.3.104:8000/api/asr/sync?priority=10', {
method: 'POST',
body: formData
})
if (response.ok) {
const result = await response.json()
console.log('ASR转录结果:', result)
// 显示转录结果
if (result.text || result.transcript) {
const transcriptText = result.text || result.transcript
alert(`通话原文:\n\n${transcriptText}`)
} else {
alert('转录完成,但未获取到文字内容')
}
} else {
console.error('ASR请求失败:', response.status, response.statusText)
alert('获取通话原文失败,请稍后重试')
}
} catch (error) {
console.error('ASR请求错误:', error)
alert('网络错误,无法获取通话原文')
}
// 显示通话记录内容
if (call.record_context) {
alert(call.record_context)
} else {
alert('该通话记录暂无录音文件')
alert('该通话记录暂无原文内容')
}
}
</script>