From f3b1dd339c98b063e6311e0b07367c8d11fdc8cf Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期三, 28 八月 2024 16:34:55 +0800
Subject: [PATCH] auto refresh doctor page
---
src/views/ecg/doctor/index.vue | 32 ++++++++++++++++++++++++--------
1 files changed, 24 insertions(+), 8 deletions(-)
diff --git a/src/views/ecg/doctor/index.vue b/src/views/ecg/doctor/index.vue
index 7d61372..26536e9 100644
--- a/src/views/ecg/doctor/index.vue
+++ b/src/views/ecg/doctor/index.vue
@@ -23,6 +23,7 @@
const list = ref<QueueVO[]>([])
+let timerRunFlag : boolean = false
const bedControlFlag = ref<boolean>(true);
const finishFlag = ref<boolean>(true);
const passFlag = ref<boolean>(true);
@@ -42,9 +43,6 @@
}
const initLoad = async () => {
- bedControlFlag.value = true
- finishFlag.value = true
- passFlag.value = true
list.value = await DoctorApi.getPatientList(roomBedVO)
patientStat.value = await DoctorApi.getPatientStatistic(roomBedVO)
const queueVO2 = await queueApi.bedDoctorGet(roomBedVO)
@@ -52,10 +50,6 @@
state.value = true
else if (queueVO2.status === 30)
state.value = false
-
- bedControlFlag.value = false
- finishFlag.value = false
- passFlag.value = false
}
const bedControl = async () => {
@@ -70,9 +64,31 @@
bedControlFlag.value = false
}
+const doctorTimer = () => {
+ console.log('doctor ...')
+ initLoad()
+ if (timerRunFlag)
+ setTimeout(doctorTimer, 5000) // five seconds
+}
+
/** 鍒濆鍖� **/
onMounted(() => {
- initLoad()
+ console.info("onMounted - doctor")
+ bedControlFlag.value = true
+ finishFlag.value = true
+ passFlag.value = true
+
+ timerRunFlag = true
+ doctorTimer()
+
+ bedControlFlag.value = false
+ finishFlag.value = false
+ passFlag.value = false
+})
+
+onUnmounted( () =>{
+ console.info("onUnmounted - doctor")
+ timerRunFlag = false
})
</script>
--
Gitblit v1.9.3