| | |
| | | <script lang="ts" setup> |
| | | import { RoomApi, RoomVO } from '@/api/ecg/room' |
| | | 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({ |
| | | //const props = defineProps({ |
| | | defineProps({ |
| | | title: { |
| | | type: String, |
| | | required: true |
| | |
| | | type: Array as PropType<RoomVO[]>, |
| | | required: true |
| | | }, |
| | | modelValue: { |
| | | curBed: { |
| | | 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); |
| | | const onHaveSeatclick = (newItem: RoomVO) => { |
| | | emit('event-haveseat', newItem) |
| | | } |
| | | const onLeaveSeatclick = (curItem: RoomVO) => { |
| | | emit('event-leaveseat', curItem) |
| | | } |
| | | |
| | | /** 初始化 **/ |
| | | onMounted(() => { |
| | | //console.info(props.bedList) |
| | | }) |
| | | |
| | | </script> |
| | | |
| | |
| | | <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" |
| | | <img |
| | | v-if="bedItem.docId === null" |
| | | src="@/assets/room/desk.png" |
| | | style="width: 100%" |
| | | style="width: 100%" |
| | | alt="无医生" |
| | | /> |
| | | <img v-else |
| | | <img |
| | | v-else |
| | | src="@/assets/room/desk-doctor.jpeg" |
| | | style="width: 100%" |
| | | style="width: 100%" |
| | | alt="有医生" |
| | | /> |
| | | <div>{{bedItem.bedNo}} - {{bedItem.docName}}</div> |
| | | <el-button v-if="modelValue.docId === 0" @click = onclick(bedItem)> |
| | | <div>{{bedItem.bedNo}} {{bedItem.docName}}</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> |