eight
2024-08-26 4138fa77375ab7e1750fd7de7d2627306a7959bc
src/components/RoomStatus/src/RoomStatus.vue
@@ -9,7 +9,7 @@
const  props = defineProps({
  title: {
    type: Number,
    type: String,
    required: true
  },
  bedList: {
@@ -18,27 +18,33 @@
  }
})
const onclick = (item) => {
  console.error(item);
  item.onstage = !item.onstage;
const onclick = async (item) => {
  item.status = !item.status;
  await RoomApi.updateRoom(item)
}
</script>
<template>
  <el-card style="width: 180px" shadow="hover" >
  <el-card style="width: 200px" shadow="hover" >
    <template #header>{{title}}</template>
    <div v-for="(bedItem, index) in bedList" :key="index">
    <img v-if="bedItem.onstage"
    <img v-if="bedItem.status === 0"
        src="@/assets/room/close.jpg"
        style="width: 100%"
         @click = onclick(bedItem)
    />
    <img v-else-if="bedItem.status === 10"
        src="@/assets/room/doctor.png"
        style="width: 100%"
         @click = onclick(bedItem)
    />
    <img v-if="!bedItem.onstage"
    <img v-else-if="bedItem.status === 20"
        src="@/assets/room/doctor-off.jpeg"
        style="width: 100%"
         @click = onclick(bedItem)
    />
      {{bedItem.bedNo}} - {{bedItem.doctor_name}}
    </div>
  </el-card>
</template>