From b3080cd7524075f55e7fceed69c4f042f1ed12f2 Mon Sep 17 00:00:00 2001 From: eight <641137800@qq.com> Date: 星期日, 01 九月 2024 21:31:04 +0800 Subject: [PATCH] fix bug, user store reference issue --- src/views/ecg/doctor/index.vue | 22 +++++++++++++--------- 1 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/views/ecg/doctor/index.vue b/src/views/ecg/doctor/index.vue index 2b0eb5b..a9454cc 100644 --- a/src/views/ecg/doctor/index.vue +++ b/src/views/ecg/doctor/index.vue @@ -4,7 +4,7 @@ import {DoctorApi, PatientStatisticVO, RoomBedVO} from '@/api/ecg/doctor'; import {useUserStore} from "@/store/modules/user"; import {QueueVO} from "@/api/ecg/queue"; -import {ElMessage} from "element-plus"; +import {ElNotification} from "element-plus"; const userStore = useUserStore(); @@ -51,6 +51,15 @@ } const initLoad = async () => { + if (roomBedVO.roomId == null) { + ElNotification.error({ + message: '璇烽噸鏂板氨搴�!', + type: 'info', + duration: 3000 // 鑷姩鍏抽棴鏃堕棿锛岄粯璁や负3000ms + }) + return + } + patientList.value = await DoctorApi.getPatientList(roomBedVO) patientStat.value = await DoctorApi.getPatientStatistic(roomBedVO) const queueVO2 = await DoctorApi.bedDoctorGet(roomBedVO) @@ -84,7 +93,8 @@ /** 鍒濆鍖� **/ onMounted(() => { - console.info("onMounted - doctor " + userStore.isSetRoom) + console.info("onMounted - doctor " + userStore.isSetRoom + " " + userStore.room.roomId) + timerRunFlag = false bedControlFlag.value = true finishFlag.value = true passFlag.value = true @@ -99,12 +109,6 @@ } else { roomBedVO.roomId = null roomBedVO.bedNo = null - - ElMessage({ - message: '璇峰厛鍏ュ骇!', - type: 'info', - duration: 3000 // 鑷姩鍏抽棴鏃堕棿锛岄粯璁や负3000ms - }) } bedControlFlag.value = false @@ -113,7 +117,7 @@ }) onUnmounted( () =>{ - console.info("onUnmounted - doctor") + console.info("onUnmounted - doctor " + userStore.isSetRoom + " " + userStore.room.roomId) timerRunFlag = false }) -- Gitblit v1.9.3