eight
2024-08-15 74f8739cec76f5e33a4eda32e259ac92ed9a8ef9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<script lang="ts" setup>
import { RoomApi, RoomVO } from '@/api/ecg/room'
import {PropType} from "vue";
 
 
defineComponent({
  name: 'RoomStatus'
})
 
const  props = defineProps({
  title: {
    type: String,
    required: true
  },
  bedList: {
    type: Array as PropType<RoomVO[]>,
    required: true
  }
})
 
const onclick = async (item) => {
  item.onstage = !item.onstage;
  await RoomApi.updateRoom(item)
}
 
</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>