单应用项目,可以创建很多独立工具类页面 ,不用登录 初始化的页面
zhangchen
2025-07-18 fcd455b10a7f40d39a55c5182dc76646ecd7a7bb
src/store/bedsideAuxiliaryScreen.ts
@@ -2,6 +2,9 @@
import { ref } from "vue";
import cache from "../utils/cache";
import { EventSourcePolyfill } from "event-source-polyfill";
import type { BedsideAuxiliaryScreen } from './type/bedsideAuxiliaryScreen.type';
import { defaultDeviceData, defaultconsumablesCollection, formatDeviceData } from './type/bedsideAuxiliaryScreen.type';
export const useBedsideAuxiliaryScreenStore = defineStore(
  "bedsideAuxiliaryScreen",
@@ -17,6 +20,9 @@
      dbp: '',
      zuihouTime: '',
    });
    /** 设备信息数据 */
    const deviceData = ref<BedsideAuxiliaryScreen>(defaultDeviceData());
    /**
     * 设置设备编号
@@ -62,14 +68,11 @@
        if (beng !== -1 && end !== -1 && dif !== -1) {
          const datax = msg.slice(beng, end + 1);
          const dataBody = JSON.parse(datax);
          console.log('dataBody: ', dataBody)
          // 倒计时提示文本
          if (dataBody.倒计时?.提示文本) {}
          // 床旁血压计
          if (dataBody.推送类型 === '床旁血压计') {}
          // 中央监控大屏信息
          else if (dataBody.推送类型 === '中央监控大屏信息') {}
          deviceData.value = formatDeviceData(dataBody)
        }
      };
    };
@@ -85,8 +88,11 @@
        console.log("[SSE] 连接已关闭");
      }
    };
    return {
      deviceCode,
      deviceData,
      setDeviceCode,
      source,
      message,