From b7210b2a365f5131ac5a3c26807d16a39425f039 Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期二, 26 十一月 2024 22:46:53 +0800
Subject: [PATCH] 排队界面 可以多状态搜索
---
src/store/modules/user.ts | 84 +-----------------------------------------
1 files changed, 2 insertions(+), 82 deletions(-)
diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts
index a857eb2..379eb10 100644
--- a/src/store/modules/user.ts
+++ b/src/store/modules/user.ts
@@ -3,11 +3,10 @@
import { getAccessToken, removeToken } from '@/utils/auth'
import { CACHE_KEY, useCache, deleteUserCache } from '@/hooks/web/useCache'
import { getInfo, loginOut } from '@/api/login'
-import {RoomVO} from "@/api/ecg/room";
const { wsCache } = useCache()
-interface UserVO {
+export interface UserVO {
id: number
avatar: string
nickname: string
@@ -20,10 +19,6 @@
roles: string[]
isSetUser: boolean
user: UserVO
-
- // 鍖荤敓璇婂閫夋嫨
- isSetRoom: boolean
- room: RoomVO
}
export const useUserStore = defineStore('admin-user', {
@@ -35,21 +30,8 @@
id: 0,
avatar: '',
nickname: '',
- deptId: 0
+ deptId: 0,
},
- // 鍖荤敓璇婂閫夋嫨
- isSetRoom: false,
- room: {
- id: null,
- roomId: null,
- roomName: null,
- bedNo: null,
- status: null,
- docId: null,
- docName: null,
- checkTypes: null,
- opType: null
- }
}),
getters: {
getPermissions(): string[] {
@@ -64,13 +46,6 @@
getUser(): UserVO {
return this.user
},
- // 鍖荤敓璇婂閫夋嫨
- getIsSetRoom(): boolean {
- return this.isSetRoom
- },
- getRoom(): RoomVO | null {
- return this.room
- }
},
actions: {
async setUserInfoAction() {
@@ -89,50 +64,6 @@
wsCache.set(CACHE_KEY.USER, userInfo)
wsCache.set(CACHE_KEY.ROLE_ROUTERS, userInfo.menus)
},
- // 鍖荤敓鍏ュ骇
- async setRoomInfoAction(room: RoomVO) {
- // 鏇存柊 store
- 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
- const userInfo2 = wsCache.get(CACHE_KEY.USER)
- 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)
- }
- },
-
async setUserAvatarAction(avatar: string) {
const userInfo = wsCache.get(CACHE_KEY.USER)
// NOTE: 鏄惁闇�瑕佸儚`setUserInfoAction`涓�鏍峰垽鏂璥userInfo != null`
@@ -162,17 +93,6 @@
avatar: '',
nickname: '',
deptId: 0
- }
- // 鍖荤敓璇婂閫夋嫨
- this.isSetRoom = false
- this.room = {
- id: 0,
- roomId: 0,
- roomName: "",
- bedNo: "",
- status: null,
- docId: null,
- docName: null
}
}
}
--
Gitblit v1.9.3