From 55503c0be0e66ba68ee9a36cb8dc83468f97896f Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期三, 04 九月 2024 18:20:55 +0800
Subject: [PATCH] 诊间屏
---
src/api/ecg/room/index.ts | 5 ++
src/views/ecg/callingscreen/roomscreen.vue | 53 +++++++++++++++++++++++---
src/api/ecg/queue/index.ts | 5 +-
3 files changed, 54 insertions(+), 9 deletions(-)
diff --git a/src/api/ecg/queue/index.ts b/src/api/ecg/queue/index.ts
index fe191c8..2618825 100644
--- a/src/api/ecg/queue/index.ts
+++ b/src/api/ecg/queue/index.ts
@@ -71,9 +71,8 @@
},
//
- getRoomScreenData: async (params) => {
- return await request.get({ url: `/ecg/queue/room-screen-data`, params })
+ getRoomScreenData: async () => {
+ return await request.get({ url: `/ecg/queue/room-screen-data` })
}
-
}
diff --git a/src/api/ecg/room/index.ts b/src/api/ecg/room/index.ts
index b68a677..b1b83c0 100644
--- a/src/api/ecg/room/index.ts
+++ b/src/api/ecg/room/index.ts
@@ -30,6 +30,11 @@
return await request.get({ url: `/clinic/room/get?id=` + id })
},
+ // 鏌ヨ璇婂鍜岃瘖鐤楀簥璇︽儏
+ getRoomByIP: async () => {
+ return await request.get({ url: `/clinic/room/get-room-by-ip`})
+ },
+
// 鏂板璇婂鍜岃瘖鐤楀簥
createRoom: async (data: RoomVO) => {
return await request.post({ url: `/clinic/room/create`, data })
diff --git a/src/views/ecg/callingscreen/roomscreen.vue b/src/views/ecg/callingscreen/roomscreen.vue
index b4993fa..3d9f039 100644
--- a/src/views/ecg/callingscreen/roomscreen.vue
+++ b/src/views/ecg/callingscreen/roomscreen.vue
@@ -2,21 +2,46 @@
import {QueueApi, QueueVO} from "@/api/ecg/queue";
import {RoomBedVO} from "@/api/ecg/doctor";
+import {DICT_TYPE} from "@/utils/dict";
+import {RoomApi} from "@/api/ecg/room";
defineOptions({ name: 'roomscreen' })
const list = ref<QueueVO[]>([]) // 鍒楄〃鐨勬暟鎹�
-const roomBed : RoomBedVO = {
+const roomBed : RoomBedVO = ref<RoomBedVO>({
roomId : null,
roomName: null,
bedNo: null
-}
+})
+
+const statusMap = new Map([
+ [20, "鍑嗗涓�"],
+ [30, "灏辫瘖涓�"],
+ [50, "杩囧彿"]
+]);
const getList = async () => {
- const data = await QueueApi.getRoomScreenData(queryParams)
- list.value = data.list
+ const data = await QueueApi.getRoomScreenData()
+ list.value = data
}
+
+const getRoomByIp = async () => {
+ const data = await RoomApi.getRoomByIP()
+ roomBed.value = data
+}
+
+const startScrolling = () => {
+ setInterval(() => {
+ // console.info("...")
+ getList()
+ }, 3000); // 姣忎袱绉掓粴鍔ㄤ竴娆�
+}
+
+onMounted( () => {
+ getRoomByIp()
+ startScrolling()
+})
</script>
@@ -24,8 +49,24 @@
<el-container>
<el-aside width="200px">Aside</el-aside>
<el-container>
- <el-header>Header</el-header>
- <el-main>Main</el-main>
+ <el-header>{{ roomBed.roomName }}</el-header>
+ <el-main>
+ <el-table
+ :data="list"
+ stripe
+ :show-header="false"
+ style="width: 100%">
+ <el-table-column
+ prop="patName"
+ label="鎮h�呭鍚�"
+ width="80"/>
+ <el-table-column label="鐘舵��" align="center" :prop="status" width="80">
+ <template #default="scope">
+ {{ statusMap.get(scope.row.status) }}
+ </template>
+ </el-table-column>
+ </el-table>
+ </el-main>
<el-footer>Footer</el-footer>
</el-container>
</el-container>
--
Gitblit v1.9.3