diff --git a/src/layout/components/AppHeader.vue b/src/layout/components/AppHeader.vue index 14e8286..0d2256d 100644 --- a/src/layout/components/AppHeader.vue +++ b/src/layout/components/AppHeader.vue @@ -31,7 +31,7 @@ import ResetPwd from '@/views/system/user/resetPwd' import { getProject } from '@/utils/baseConfig' import IvrBar from './ivr/ivrBar' - +import { isReceiver } from '@/utils/permission' export default { name: 'AppHeader', components: { IvrBar, ResetPwd }, @@ -55,9 +55,14 @@ this.$store.dispatch('ToggleSideBar') }, logout() { - this.$store.dispatch('LogOut').then(() => { - location.reload() // 为了重新实例化vue-router对象 避免bug - }) + // 判断签入签出状态,如果已签入提醒先签出 + if (isReceiver() && this.$store.getters.online === '1') { + this.$message.warning('请先签出!') + } else { + this.$store.dispatch('LogOut').then(() => { + location.reload() // 为了重新实例化vue-router对象 避免bug + }) + } }, resetPwd() { this.showSetPwd = true diff --git a/src/layout/components/AppHeader.vue b/src/layout/components/AppHeader.vue index 14e8286..0d2256d 100644 --- a/src/layout/components/AppHeader.vue +++ b/src/layout/components/AppHeader.vue @@ -31,7 +31,7 @@ import ResetPwd from '@/views/system/user/resetPwd' import { getProject } from '@/utils/baseConfig' import IvrBar from './ivr/ivrBar' - +import { isReceiver } from '@/utils/permission' export default { name: 'AppHeader', components: { IvrBar, ResetPwd }, @@ -55,9 +55,14 @@ this.$store.dispatch('ToggleSideBar') }, logout() { - this.$store.dispatch('LogOut').then(() => { - location.reload() // 为了重新实例化vue-router对象 避免bug - }) + // 判断签入签出状态,如果已签入提醒先签出 + if (isReceiver() && this.$store.getters.online === '1') { + this.$message.warning('请先签出!') + } else { + this.$store.dispatch('LogOut').then(() => { + location.reload() // 为了重新实例化vue-router对象 避免bug + }) + } }, resetPwd() { this.showSetPwd = true diff --git a/src/layout/components/ivr/ivrBar.vue b/src/layout/components/ivr/ivrBar.vue index b89ad5f..b4fdfca 100644 --- a/src/layout/components/ivr/ivrBar.vue +++ b/src/layout/components/ivr/ivrBar.vue @@ -260,6 +260,7 @@ this.btnStatus.btnHangUp = false this.status = '已签入' this.call = '空闲' + this.$store.commit('SET_ONLINE', '1') // TODO: 通知后台已签入 // 心跳监测定时器 // if (this.webVariable.web_heartbeatInterval > 0) { @@ -306,6 +307,7 @@ this.btnStatus.btnIdle = true this.btnStatus.btnMeeting = true this.btnStatus.btnHangUp = true + this.$store.commit('SET_ONLINE', '0') this.resetWs() // TODO: 通知后台已签出 // 清除定时器