eight
2024-08-28 2bc74ebfec4a30beddc66fd55be4947e5f7cf498
src/views/ecg/room/RoomLoginSelect.vue
@@ -2,9 +2,10 @@
  <div style="display: flex; flex-direction: column; align-items: center;">
    <div style="display: flex; flex-wrap: wrap; justify-content: center; margin-bottom: 20px">
      <div class=roomwrap v-for="(value, key) in bedMap" :key="key">
        <RoomBedSelect :title="key" :bedList="value" :curBed="curSel" @haveSeat="haveSeat" @leaveSeat="leaveSeat"/>
        <RoomBedSelect :title="key" :bedList="value" :curBed="curSel" @event-haveseat="haveSeat" @event-leaveseat="leaveSeat"/>
      </div>
    </div>
    <el-button @click="confirmCurSel">确认</el-button>
  </div>
</template>
@@ -143,7 +144,7 @@
    roomVO.docId = curUser.id
    roomVO.docName = curUser.nickname
    curSel.value = roomVO
    haveSeatConfirm()
  }).catch(() => {
    console.log('取消');
@@ -180,6 +181,25 @@
  });
}
const confirmCurSel = () => {
  if (curSel.value.docId === null ) {
    ElMessage({
      message: '请先选择工作的位置!',
      type: 'info',
      duration: 3000 // 自动关闭时间,默认为3000ms
    });
    return
  }
  userStore.setRoomInfoAction(curSel.value)
  if (isStringEmpty(route.redirectedFrom?.fullPath))
    push({ path: "/"})
  else if(route.redirectedFrom?.fullPath === "/roomselect" )
    push({ path: "/"})
  else
    push({ path: route.redirectedFrom?.fullPath})
}
/** 初始化 **/
onMounted(() => {
  getList()