From a8063f9e99ab6dff53b6e88c858545399e4f9154 Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期三, 14 八月 2024 22:49:28 +0800
Subject: [PATCH] update

---
 src/components/RoomStatus/src/RoomStatus.vue |   24 +++++++++++-------------
 1 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/src/components/RoomStatus/src/RoomStatus.vue b/src/components/RoomStatus/src/RoomStatus.vue
index 471bf9f..c94a17e 100644
--- a/src/components/RoomStatus/src/RoomStatus.vue
+++ b/src/components/RoomStatus/src/RoomStatus.vue
@@ -1,29 +1,27 @@
 <script lang="ts" setup>
-import {BedStatusVO} from "@/views/ecg/room/index";
+import { RoomApi, RoomVO } from '@/api/ecg/room'
 import {PropType} from "vue";
+
 
 defineComponent({
   name: 'RoomStatus'
 })
 
-defineProps({
+const  props = defineProps({
   title: {
     type: String,
     required: true
   },
-  doctorNum: {
-    type: Number,
-    required: true
-  },
-  modelValue: {
-    type: Array as PropType<BedStatusVO[]>,
+  bedList: {
+    type: Array as PropType<RoomVO[]>,
     required: true
   }
 })
 
-const onclick = (item) => {
+const onclick = async (item) => {
   console.error(item);
-  item.opStatus = !item.opStatus;
+  item.onstage = !item.onstage;
+  await RoomApi.updateRoom(item)
 }
 
 </script>
@@ -31,13 +29,13 @@
 <template>
   <el-card style="width: 180px" shadow="hover" >
     <template #header>{{title}}</template>
-    <div v-for="(bedItem, index) in modelValue" :key="index">
-    <img v-if="bedItem.opStatus"
+    <div v-for="(bedItem, index) in bedList" :key="index">
+    <img v-if="bedItem.onstage"
         src="@/assets/room/doctor.png"
         style="width: 100%"
          @click = onclick(bedItem)
     />
-    <img v-if="!bedItem.opStatus"
+    <img v-if="!bedItem.onstage"
         src="@/assets/room/doctor-off.jpeg"
         style="width: 100%"
          @click = onclick(bedItem)

--
Gitblit v1.9.3