eight
2024-08-14 0a55b20bafb4190ad9a7702821ebf142cdf524dd
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
66
67
68
<script lang="ts" setup>
import {BedStatusVO} from "@/views/ecg/room/index";
import {PropType} from "vue";
 
defineComponent({
  name: 'RoomStatus'
})
 
defineProps({
  title: {
    type: String,
    required: true
  },
  doctorNum: {
    type: Number,
    required: true
  },
  modelValue: {
    type: Array as PropType<BedStatusVO[]>,
    required: true
  }
})
 
const onclick = (item) => {
  console.error(item);
  item.opStatus = !item.opStatus;
}
 
</script>
 
<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"
        src="@/assets/room/doctor.png"
        style="width: 100%"
         @click = onclick(bedItem)
    />
    <img v-if="!bedItem.opStatus"
        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>