| | |
| | | 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"; |
| | |
| | | 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()); |
| | |
| | | */ |
| | | const setDeviceCode = (code: string) => { |
| | | deviceCode.value = code; |
| | | cache.set("devcieCode", code); |
| | | Local.set("devcieCode", code); |
| | | }; |
| | | |
| | | /** |