|
|
@@ -105,7 +105,7 @@
|
|
|
<div v-else class="avatar" :class="agent.gender"></div>
|
|
|
<div class="gender-icon" :class="agent.gender">{{ agent.gender === 'female' ? '♀' : '♂' }}</div>
|
|
|
<div class="status-badge" :class="'status-' + agent.status">
|
|
|
- {{ agent.status === '0' ? '正常' : agent.status === '1' ? '停用' : '对话中' }}
|
|
|
+ {{ agent.status === '0' ? '空闲中' : agent.status === '1' ? '停用' : '工作中' }}
|
|
|
</div>
|
|
|
<div class="agent-name">{{ agent.name }}</div>
|
|
|
</div>
|
|
|
@@ -432,14 +432,14 @@ watch(showChat, async (newVal) => {
|
|
|
isMicMuted.value = false
|
|
|
currentConversationId.value = null
|
|
|
|
|
|
- // 对话结束,将客服状态改回正常
|
|
|
+ // 对话结束,将客服状态改回空闲中
|
|
|
if (selectedAgent.value) {
|
|
|
try {
|
|
|
await fetch(`http://localhost:8080/talk/agent/${selectedAgent.value}/hangup`, {
|
|
|
method: 'POST',
|
|
|
headers: getHeaders()
|
|
|
})
|
|
|
- console.log('客服状态已恢复为正常')
|
|
|
+ console.log('客服状态已恢复为空闲中')
|
|
|
|
|
|
// 立即刷新客服列表,让用户看到状态变化
|
|
|
await fetchAgents(true)
|
|
|
@@ -568,7 +568,7 @@ const fetchAgents = async (silent = false) => {
|
|
|
})
|
|
|
const result = await response.json()
|
|
|
if (result.code === 200 && result.rows) {
|
|
|
- // 只显示状态为0(正常)或2(对话中)的客服
|
|
|
+ // 只显示状态为0(空闲中)或2(工作中)的客服
|
|
|
const previousSelectedAgent = selectedAgent.value
|
|
|
agents.value = result.rows
|
|
|
.filter(agent => agent.status === '0' || agent.status === '2')
|
|
|
@@ -682,7 +682,7 @@ const startChat = async () => {
|
|
|
}
|
|
|
|
|
|
if (selectedAgentData.status === '2') {
|
|
|
- ElMessage.warning('该客服正在对话中,请选择其他客服')
|
|
|
+ ElMessage.warning('该客服正在工作中,请选择其他客服')
|
|
|
return
|
|
|
}
|
|
|
|
|
|
@@ -715,7 +715,7 @@ const startChat = async () => {
|
|
|
})
|
|
|
})
|
|
|
|
|
|
- console.log('客服状态已更新为对话中')
|
|
|
+ console.log('客服状态已更新为工作中')
|
|
|
|
|
|
// 先切换到对话界面,确保音频可以播放
|
|
|
showChat.value = true
|