| | |
| | | <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' |
| | |
| | | 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) => { |
| | | console.error(item); |
| | | item.opStatus = !item.opStatus; |
| | | const onclick = async (item) => { |
| | | item.onstage = !item.onstage; |
| | | 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 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) |