From 3ae9c3bd8b1267c4d5fd897e35bbf85dbb78e123 Mon Sep 17 00:00:00 2001 From: tangchengming <445785772@qq.com> Date: Tue, 25 Feb 2025 09:26:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/layout/components/LayoutHeader.vue | 38 +++++++++----------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/src/pages/layout/components/LayoutHeader.vue b/src/pages/layout/components/LayoutHeader.vue index aaeccb3..63724f6 100644 --- a/src/pages/layout/components/LayoutHeader.vue +++ b/src/pages/layout/components/LayoutHeader.vue @@ -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) - } - } } }