From 9bcb10b07e3c8d3a001500298ce793b4ff2af55f Mon Sep 17 00:00:00 2001
From: zhangchen <1652267879@qq.com>
Date: 星期六, 26 七月 2025 15:12:20 +0800
Subject: [PATCH] ID1625-已签到页面添加最大脱水量的时长

---
 src/store/bedsideAuxiliaryScreen.ts |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/store/bedsideAuxiliaryScreen.ts b/src/store/bedsideAuxiliaryScreen.ts
index 11ff7fa..1424463 100644
--- a/src/store/bedsideAuxiliaryScreen.ts
+++ b/src/store/bedsideAuxiliaryScreen.ts
@@ -110,7 +110,7 @@
         if (retryCount < maxRetryCount) {
           const delay = baseRetryDelay * Math.pow(2, retryCount); // 指数退避
           retryCount++;
-          console.log(`[SSE] 第${retryCount}次重连,延迟${delay}ms`);
+          console.log(`[SSE] 第${retryCount}次重连,延迟${baseRetryDelay}ms`);
           ElMessage.warning(
             `链接服务失败, 第${retryCount}次重连,请耐心等待重连。。`
           );
@@ -134,21 +134,26 @@
           const dataBody = JSON.parse(datax) as SseMsgData;
           console.log("dataBody: ", dataBody);
           // 倒计时提示文本
-          if (dataBody.倒计时?.提醒文本) {
-            const taskTime = dayjs(dataBody.倒计时?.当前服务器时间).add(dataBody.倒计时?.设定提醒倒计时, 'minute')
+          if (dataBody.倒计时?.提醒文本 && Number(dataBody.倒计时?.设定提醒倒计时 > 0)) {
+            const serverTimeRaw = dataBody.倒计时?.当前服务器时间;
+            const reminderMinutes = Number(dataBody.倒计时?.设定提醒倒计时 ?? 0);
+            const serverTimeFormatted = serverTimeRaw.replace(' ', 'T');
+
+            const taskTime = dayjs(serverTimeFormatted).add(reminderMinutes, 'second');
             setSyncTask({
               deviceCode: dataBody.IOT信息.设备唯一编号,
               recordCode: dataBody.透析状态?.透析单编号,
               taskDate: taskTime.format('YYYY-MM-DD HH:mm'),
               taskName: dataBody.倒计时?.提醒文本,
               overdue: false,
+              sync: true,
               countdown: dataBody.倒计时?.设定提醒倒计时
             })
           } else {
             clearTask();
           }
 
-          deviceData.value = formatDeviceData(dataBody);
+          deviceData.value = formatDeviceData(deviceData.value, dataBody);
         }
       };
     };

--
Gitblit v1.8.0