eight
2024-09-29 22ffadf5996aa0748cac9c206ccceb57e569da45
src/store/modules/user.ts
@@ -23,7 +23,7 @@
  // 医生诊室选择
  isSetRoom: boolean
  room: RoomVO | null
  room: RoomVO
}
export const useUserStore = defineStore('admin-user', {
@@ -40,11 +40,13 @@
    // 医生诊室选择
    isSetRoom: false,
    room: {
      id: 0,
      roomId: 0,
      roomName: "",
      bedNo: "",
      onstage: true
      id: null,
      roomId: null,
      roomName: null,
      bedNo: null,
      status: null,
      docId: null,
      docName: null
    }
  }),
  getters: {
@@ -64,7 +66,7 @@
    getIsSetRoom(): boolean {
      return this.isSetRoom
    },
    getRoom(): RoomVO {
    getRoom(): RoomVO | null {
      return this.room
    }
  },
@@ -88,7 +90,13 @@
    // 医生入座
    async setRoomInfoAction(room: RoomVO) {
      // 更新 store
      this.room = room
      this.room!.id = room.id
      this.room!.roomId = room.roomId
      this.room!.roomName = room.roomName
      this.room!.bedNo = room.bedNo
      this.room!.status = room.status
      this.room!.docId = room.docId
      this.room!.docName = room.docName
      this.isSetRoom = true
      // 更新 cache
@@ -102,7 +110,14 @@
    // 医生离座
    async clearRoomInfoAction() {
      // 清 store
      this.room = null
      this.room.id = null
      this.room.roomId = null
      this.room.roomName = null
      this.room.bedNo = null
      this.room.status = null
      this.room.docId = null
      this.room.docName = null
      this.isSetRoom = false
      // 更新 cache
@@ -151,7 +166,9 @@
        roomId: 0,
        roomName: "",
        bedNo: "",
        onstage: true
        status: null,
        docId: null,
        docName: null
      }
    }
  }