eight
2024-08-27 d9e041b1020bebbfdaaa66141d94399340f88a17
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<script lang="ts" setup>
import { RoomApi, RoomVO } from '@/api/ecg/room'
import {PropType} from "vue";
import {useUserStore} from "@/store/modules/user";
 
defineComponent({
  name: 'RoomBedSelect'
})
 
const  props = defineProps({
  title: {
    type: String,
    required: true
  },
  bedList: {
    type: Array as PropType<RoomVO[]>,
    required: true
  },
  modelValue: {
    type: Object as PropType<RoomVO>,
    required: true
  }
})
 
const userStore = useUserStore()
const curUser = userStore.getUser
 
const emit = defineEmits<{
    (e: 'update:modelValue', message: string): void;
}>();
 
const onclick = (item) => {
  emit('update:modelValue', item);
}
 
</script>
 
<template>
  <el-card style="width: 200px" shadow="hover" >
    <template #header>{{title}}</template>
    <div v-for="(bedItem, index) in bedList" :key="index">
      <div class="deskwarp">
        <img v-if="modelValue.roomId !== bedItem.roomId || modelValue.bedNo !== bedItem.bedNo"
            src="@/assets/room/desk.png"
             style="width: 100%"
        />
        <img v-else
            src="@/assets/room/desk-doctor.jpeg"
             style="width: 100%"
        />
        <div>{{bedItem.bedNo}} - {{bedItem.docName}}</div>
        <el-button v-if="modelValue.docId === 0" @click = onclick(bedItem)>
           入座
        </el-button>
      </div>
    </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%);
  }
}
 
.deskwarp {
  display: flex;
  flex-direction: column;
  align-items: center;
}
 
</style>