修改bug

This commit is contained in:
张运江 2025-02-25 09:26:01 +08:00
parent b0dc4072f1
commit 3ae9c3bd8b

View File

@ -397,22 +397,28 @@ export default {
},
handleCommand(command) {
async handleCommand(command) {
console.log(command)
if (this.agentStatus === command) {
return
}
this.agentStatus = command
if (command === 'free') {
this.agentStatusName = '空闲'
} else if (command === 'arrange') {
this.agentStatusName = '话后整理'
} else if (command === 'notReady') {
this.agentStatusName = '示忙'
} else if (command === 'rest') {
this.agentStatusName = '小休'
try {
let res = await window.tccc.Agent.setStatus({status: command})
console.log('设置座席状态:', res)
this.agentStatus = command
if (command === 'free') {
this.agentStatusName = '空闲'
} else if (command === 'arrange') {
this.agentStatusName = '话后整理'
} else if (command === 'notReady') {
this.agentStatusName = '示忙'
} else if (command === 'rest') {
this.agentStatusName = '小休'
}
} catch (error) {
this.$message.error('设置座席状态失败' + error.message)
console.log('设置座席状态失败',error.message)
}
this.setStatus()
},
//
handleClose() {
@ -447,16 +453,6 @@ export default {
console.log('获取座席状态失败',error.message)
}
},
//
async setStatus() {
try {
let res = await window.tccc.Agent.setStatus({status: this.agentStatus})
console.log('设置座席状态:', res)
} catch (err) {
this.$message.error('设置座席状态失败' + err.message)
console.log('设置座席状态失败',err.message)
}
}
}
}
</script>