From ee5ec5321a466c6d5613ab2ad28777d8d890bc9b Mon Sep 17 00:00:00 2001
From: zhangchen <1652267879@qq.com>
Date: 星期一, 04 八月 2025 16:30:20 +0800
Subject: [PATCH] ID1918-添加自定义配置项
---
src/store/bedsideAuxiliaryScreen.ts | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/src/store/bedsideAuxiliaryScreen.ts b/src/store/bedsideAuxiliaryScreen.ts
index b93d6cc..63a739c 100644
--- a/src/store/bedsideAuxiliaryScreen.ts
+++ b/src/store/bedsideAuxiliaryScreen.ts
@@ -1,7 +1,6 @@
import { defineStore } from "pinia";
import { ref } from "vue";
import dayjs from "dayjs";
-import cache from "../utils/cache";
import { EventSourcePolyfill } from "event-source-polyfill";
import type { BedsideAuxiliaryScreen, SseMsgData } from "./type/bedsideAuxiliaryScreen.type";
import type { Task } from "./type/task.type";
@@ -11,12 +10,13 @@
formatDeviceData,
} from "./type/bedsideAuxiliaryScreen.type";
import { ElMessage } from "element-plus/es";
+import { Local } from "@/utils/storage";
export const useBedsideAuxiliaryScreenStore = defineStore(
"bedsideAuxiliaryScreen",
() => {
/** 设备编号 */
- const deviceCode = ref<string>(cache.get("devcieCode") || "");
+ const deviceCode = ref<string>(Local.get("devcieCode") || "");
/** 设备信息数据 */
const deviceData = ref<BedsideAuxiliaryScreen>(defaultDeviceData());
@@ -30,7 +30,7 @@
*/
const setDeviceCode = (code: string) => {
deviceCode.value = code;
- cache.set("devcieCode", code);
+ Local.set("devcieCode", code);
};
/**
@@ -134,14 +134,19 @@
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 {
--
Gitblit v1.8.0