| | |
| | | }); |
| | | |
| | | const isLoginng = computed(() => { |
| | | return !!bedsideAuxiliaryScreenStore.userInfo.code; |
| | | return !!bedsideAuxiliaryScreenStore.userInfo?.code; |
| | | }); |
| | | |
| | | const qrCodeData = computed(() => { |
| | |
| | | deviceCode: bedsideAuxiliaryScreenStore.deviceCode, |
| | | deviceNo: bedsideAuxiliaryScreenStore.deviceData.devicdeNo, |
| | | }; |
| | | }); |
| | | |
| | | const userInfo = computed(() => { |
| | | const userInfo = bedsideAuxiliaryScreenStore.userInfo; |
| | | if (!userInfo) return null; |
| | | return { |
| | | ...userInfo, |
| | | 床号: bedsideAuxiliaryScreenStore.deviceData.devicdeNo, |
| | | 设备编号: bedsideAuxiliaryScreenStore.deviceCode |
| | | } |
| | | }); |
| | | |
| | | const openDialog = () => { |
| | |
| | | }; |
| | | |
| | | const onLogout = () => { |
| | | if (state.loading) return ElMessage.warning('正在退出中...') |
| | | ElMessageBox.confirm("是否确认退出当前登录用户?", "提示", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | bedsideAuxiliaryScreenStore.logout(); |
| | | .then(async() => { |
| | | state.loading = true |
| | | try { |
| | | await bedsideAuxiliaryScreenStore.logout(bedsideAuxiliaryScreenStore.deviceCode); |
| | | handleCancel(); |
| | | ElMessage.success('退出登录成功') |
| | | handleCancel(); |
| | | } catch (error) { |
| | | ElMessage.success('退出登录失败') |
| | | } finally { |
| | | state.loading = false; |
| | | } |
| | | ElMessage({ |
| | | type: "success", |
| | | message: "退出成功!", |
| | |
| | | handleCancel, |
| | | openDialog, |
| | | onLogout, |
| | | userInfo, |
| | | }; |
| | | }, |
| | | }; |