| | |
| | | // 医生诊室选择 |
| | | isSetRoom: false, |
| | | room: { |
| | | id: 0, |
| | | roomId: 0, |
| | | roomName: "", |
| | | bedNo: "", |
| | | onstage: true |
| | | id: null, |
| | | roomId: null, |
| | | roomName: null, |
| | | bedNo: null, |
| | | ip: null, |
| | | status: null, |
| | | docId: null, |
| | | docName: null, |
| | | checkTypes: null, |
| | | opType: null |
| | | } |
| | | }), |
| | | getters: { |
| | |
| | | getIsSetRoom(): boolean { |
| | | return this.isSetRoom |
| | | }, |
| | | getRoom(): RoomVO { |
| | | getRoom(): RoomVO | null { |
| | | return this.room |
| | | } |
| | | }, |
| | |
| | | wsCache.set(CACHE_KEY.USER, userInfo) |
| | | wsCache.set(CACHE_KEY.ROLE_ROUTERS, userInfo.menus) |
| | | }, |
| | | // 医生诊室选择 |
| | | // 医生入座 |
| | | async setRoomInfoAction(room: RoomVO) { |
| | | if (!getAccessToken()) { |
| | | this.resetState() |
| | | return null |
| | | } |
| | | |
| | | // 更新 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.room!.checkTypes = room.checkTypes |
| | | this.room!.opType = room.opType |
| | | this.isSetRoom = true |
| | | |
| | | // 更新 cache |
| | |
| | | if (userInfo2) { |
| | | userInfo2.room = room |
| | | userInfo2.isSetRoom = true |
| | | wsCache.set(CACHE_KEY.USER, userInfo2) |
| | | } |
| | | }, |
| | | // 医生离座 |
| | | async clearRoomInfoAction() { |
| | | // 清 store |
| | | 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 |
| | | const userInfo2 = wsCache.get(CACHE_KEY.USER) |
| | | if (userInfo2) { |
| | | userInfo2.room = null |
| | | userInfo2.isSetRoom = false |
| | | wsCache.set(CACHE_KEY.USER, userInfo2) |
| | | } |
| | | }, |
| | |
| | | roomId: 0, |
| | | roomName: "", |
| | | bedNo: "", |
| | | onstage: true |
| | | ip: "", |
| | | status: null, |
| | | docId: null, |
| | | docName: null, |
| | | checkTypes: null, |
| | | opType: null |
| | | } |
| | | } |
| | | } |