| | |
| | | <script lang="ts" setup> |
| | | import { RoomVO } from '@/api/ecg/room' |
| | | import {PropType} from "vue"; |
| | | import {useUserStore} from "@/store/modules/user"; |
| | | import {DICT_TYPE, getIntDictOptions} from "@/utils/dict"; |
| | | import {useCheckTypeStore} from "@/store/modules/checkType"; |
| | | const emit = defineEmits(['event-haveseat', 'event-leaveseat']) |
| | | import {UserVO} from "@/store/modules/user"; |
| | | |
| | | const emit = defineEmits(['event-haveseat', 'event-leaveseat', 'event-setcurseat']) |
| | | |
| | | defineComponent({ |
| | | name: 'RoomBedSelect' |
| | | }) |
| | | |
| | | //const props = defineProps({ |
| | | defineProps({ |
| | | const props = defineProps({ |
| | | // defineProps({ |
| | | title: { |
| | | type: String, |
| | | required: true |
| | |
| | | curBed: { |
| | | type: Object as PropType<RoomVO>, |
| | | required: true |
| | | }, |
| | | curUser: { |
| | | type: Object as PropType<UserVO>, |
| | | required: true |
| | | } |
| | | }) |
| | | |
| | | const checkTypeStore = useCheckTypeStore(); |
| | | const userStore = useUserStore() |
| | | const curUser = userStore.getUser |
| | | |
| | | const onHaveSeatclick = (newItem: RoomVO) => { |
| | | emit('event-haveseat', newItem) |
| | |
| | | const onLeaveSeatclick = (curItem: RoomVO) => { |
| | | emit('event-leaveseat', curItem) |
| | | } |
| | | |
| | | const onSetCurSeatclick = (curItem: RoomVO) => { |
| | | emit('event-setcurseat', curItem) |
| | | } |
| | | |
| | | /** 初始化 **/ |
| | | onMounted(() => { |
| | | //console.info(props.bedList) |
| | | console.info(props.bedList) |
| | | }) |
| | | |
| | | </script> |
| | |
| | | <el-button v-if="bedItem.docId === null" @click = onHaveSeatclick(bedItem)> |
| | | 入座 |
| | | </el-button> |
| | | <el-button v-if="bedItem.docId === curUser.id" @click = onLeaveSeatclick(bedItem)> |
| | | <div v-if="bedItem.docId === curUser.id"> |
| | | <el-button @click = onLeaveSeatclick(bedItem)> |
| | | 离座 |
| | | </el-button> |
| | | <span v-if="bedItem.roomId === curBed.roomId && bedItem.bedNo === curBed.bedNo" > |
| | | 当前 |
| | | </span> |
| | | <el-button v-else @click = onSetCurSeatclick(bedItem)> |
| | | 设为当前 |
| | | </el-button> |
| | | </div> |
| | | <el-divider/> |
| | | </div> |
| | | </div> |