| | |
| | | { |
| | | path: '/test2', |
| | | name: 'test2', |
| | | component: deviceWindows2, |
| | | component: bedsideAuxiliaryScreen, |
| | | }, |
| | | { |
| | | path: '/test', |
| | |
| | | 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); |
| | | }; |
| | | |
| | | /** |
| | |
| | | import { tryConvertToInt, deepClone } from "@/utils/utils"; |
| | | import cache from "@/utils/cache"; |
| | | import { Local } from "@/utils/storage"; |
| | | export interface IotInfo { |
| | | 属性历史列表: any[]; |
| | | 床号: string; |
| | |
| | | }; |
| | | |
| | | export const defaultDeviceData = (): BedsideAuxiliaryScreen => { |
| | | const pageType = cache.get("devcieCode") |
| | | const pageType = Local.get("devcieCode") |
| | | ? EPageType.LOADING |
| | | : EPatForm.OUTPATIENT_SERVICE; |
| | | return { |
| | |
| | | <template #footer> |
| | | <div class="my-button cancel" @click="handleCancel">取消</div> |
| | | <div class="my-button confirm" @click="handleConfirm">确认</div> |
| | | <div class="my-button refresh" @click="handleRefresh">刷新</div> |
| | | <div class="my-button refresh" @click="handleRefresh">检查更新</div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | |
| | | |
| | | const handleConfirm = () => { |
| | | bedsideAuxiliaryScreenStore.setDeviceCode(devcieCode.value + ""); |
| | | handleRefresh(); |
| | | bedsideAuxiliaryScreenStore.refresh( |
| | | `${import.meta.env.VITE_SSE_BASE_URL}${devcieCode.value}` |
| | | ); |
| | | handleCancel(); |
| | | }; |
| | | |
| | | const handleRefresh = () => { |
| | | bedsideAuxiliaryScreenStore.refresh( |
| | | `${import.meta.env.VITE_SSE_BASE_URL}${devcieCode.value}` |
| | | ); |
| | | window.location.reload(); |
| | | ElMessage.success('已更新至最新版本') |
| | | }; |
| | | |
| | | defineExpose({ |