单应用项目,可以创建很多独立工具类页面 ,不用登录 初始化的页面
zhangchen
2025-07-28 7fd770011e638950ef61edab1a8da176f45da77b
ID2690-缓存修改
4个文件已修改
23 ■■■■ 已修改文件
src/router/index.ts 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/bedsideAuxiliaryScreen.ts 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/type/bedsideAuxiliaryScreen.type.ts 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mobile/bedsideAuxiliaryScreen/components/SettingDeviceDialog.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.ts
@@ -18,7 +18,7 @@
  {
    path: '/test2',
    name: 'test2',
    component: deviceWindows2,
    component: bedsideAuxiliaryScreen,
  },
  {
    path: '/test',
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);
    };
    /**
src/store/type/bedsideAuxiliaryScreen.type.ts
@@ -1,5 +1,5 @@
import { tryConvertToInt, deepClone } from "@/utils/utils";
import cache from "@/utils/cache";
import { Local } from "@/utils/storage";
export interface IotInfo {
  属性历史列表: any[];
  床号: string;
@@ -402,7 +402,7 @@
};
export const defaultDeviceData = (): BedsideAuxiliaryScreen => {
  const pageType = cache.get("devcieCode")
  const pageType = Local.get("devcieCode")
    ? EPageType.LOADING
    : EPatForm.OUTPATIENT_SERVICE;
  return {
src/views/mobile/bedsideAuxiliaryScreen/components/SettingDeviceDialog.vue
@@ -54,7 +54,7 @@
      <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>
@@ -137,14 +137,15 @@
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({