<script lang="ts" setup>
|
import { RoomApi, RoomVO } from '@/api/ecg/room'
|
import {PropType} from "vue";
|
|
|
defineComponent({
|
name: 'RoomStatus'
|
})
|
|
const props = defineProps({
|
title: {
|
type: Number,
|
required: true
|
},
|
bedList: {
|
type: Array as PropType<RoomVO[]>,
|
required: true
|
}
|
})
|
|
const onclick = (item) => {
|
console.error(item);
|
item.onstage = !item.onstage;
|
}
|
|
</script>
|
|
<template>
|
<el-card style="width: 180px" shadow="hover" >
|
<template #header>{{title}}</template>
|
<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.onstage"
|
src="@/assets/room/doctor-off.jpeg"
|
style="width: 100%"
|
@click = onclick(bedItem)
|
/>
|
</div>
|
</el-card>
|
</template>
|
|
<style scoped lang="scss">
|
.card-title {
|
font-size: 14px;
|
font-weight: 600;
|
|
&::before {
|
position: relative;
|
top: 8px;
|
left: -5px;
|
display: inline-block;
|
width: 3px;
|
height: 14px;
|
//background-color: #105cfb;
|
background: var(--el-color-primary);
|
border-radius: 5px;
|
content: '';
|
transform: translateY(-50%);
|
}
|
}
|
</style>
|