eight
2024-09-01 b3080cd7524075f55e7fceed69c4f042f1ed12f2
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
87
88
89
90
91
92
93
94
95
96
97
98
99
<script lang="ts" setup>
import { RoomVO } from '@/api/ecg/room'
import {PropType} from "vue";
import {useUserStore} from "@/store/modules/user";
const emit = defineEmits(['event-haveseat', 'event-leaveseat'])
 
defineComponent({
  name: 'RoomBedSelect'
})
 
//const  props = defineProps({
defineProps({
  title: {
    type: String,
    required: true
  },
  bedList: {
    type: Array as PropType<RoomVO[]>,
    required: true
  },
  curBed: {
    type: Object as PropType<RoomVO>,
    required: true
  }
})
 
const userStore = useUserStore()
const curUser = userStore.getUser
 
const onHaveSeatclick = (newItem: RoomVO) => {
  emit('event-haveseat', newItem)
}
const onLeaveSeatclick = (curItem: RoomVO) => {
  emit('event-leaveseat', curItem)
}
 
/** 初始化 **/
onMounted(() => {
    //console.info(props.bedList)
})
 
</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="bedItem.docId === null"
            src="@/assets/room/desk.png"
            style="width: 100%"
            alt="无医生"
        />
        <img
            v-else
            src="@/assets/room/desk-doctor.jpeg"
            style="width: 100%"
            alt="有医生"
        />
        <div>{{bedItem.bedNo}} {{bedItem.docName}} {{bedItem.status === 30?"-暂停":""}}</div>
        <el-button v-if="bedItem.docId === null" @click = onHaveSeatclick(bedItem)>
           入座
        </el-button>
        <el-button v-if="bedItem.docId === curUser.id" @click = onLeaveSeatclick(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>