eight
2024-11-18 adecd142412454acbd8f729c7230e9a90b3dcddc
src/views/ecg/room/RoomLoginSelect.vue
@@ -4,7 +4,7 @@
      <div class=roomwrap v-for="(value, key) in bedMap" :key="key">
        <RoomBedSelect :title="key" :bedList="value" :curBed="curSel" @event-haveseat="haveSeat" @event-leaveseat="leaveSeat"/>
      </div>
      <div v-if="isEmptyOpeningBed">"工位没有开放"</div>
      <el-empty v-if="isEmptyOpeningBed" description="工位没有开放"/>
    </div>
    <div>
      <el-button @click="confirmCurSel">确认</el-button>
@@ -21,6 +21,7 @@
import {isStringEmpty} from "@/utils/stringUtil";
import {cloneDeep} from "lodash-es";
import {DoctorApi} from "@/api/ecg/doctor";
import {useRoomStore} from "@/store/modules/room";
const {  push } = useRouter()
defineOptions({ name: 'RoomLoginSelect' })
@@ -28,6 +29,7 @@
const route = useRoute();
const userStore = useUserStore()
const roomStore = useRoomStore()
const curUser = userStore.getUser
const isEmptyOpeningBed = ref<boolean>(true);
@@ -39,7 +41,10 @@
  bedNo: null,
  status: null,
  docId: null,
  docName: null
  docName: null,
  ip: "",
  checkTypes: [],
  opType: 0
})
/** 初始化 **/
@@ -73,7 +78,7 @@
      roomVOArray.forEach((roomVO) => {
        if (roomVO.docId === curUser.id) {
          curSel.value = roomVO
          userStore.setRoomInfoAction(curSel.value)
          roomStore.setRoomInfoAction(curSel.value)
        }
      })
  }
@@ -90,11 +95,11 @@
  }
  if (isStringEmpty(route.redirectedFrom?.fullPath))
    push({ path: "/"})
    push({ path: "/ecg/doctor"})
  else if(route.redirectedFrom?.fullPath === "/roomselect" )
    push({ path: "/"})
    push({ path: "/ecg/doctor"})
  else if(route.redirectedFrom?.fullPath === "/ecg/roomselect" )
    push({ path: "/"})
    push({ path: "/ecg/doctor"})
  else
    push({ path: route.redirectedFrom?.fullPath})
}
@@ -115,7 +120,7 @@
    }
    resetCurSel()
    userStore.clearRoomInfoAction()
    await roomStore.clearRoomInfoAction()
    const tempRoomVO = cloneDeep(newRoomVO)
    tempRoomVO.docId = curUser.id
@@ -130,20 +135,21 @@
      return
    }
    userStore.setRoomInfoAction(tempRoomVO)
    await roomStore.setRoomInfoAction(tempRoomVO)
    newRoomVO.docId = curUser.id
    newRoomVO.docName = curUser.nickname
    curSel.value = newRoomVO;
  }
  // curSel.value.opType 0 1 2
  if (isStringEmpty(route.redirectedFrom?.fullPath)) {
    push({path: "/"})
    push({path: "/ecg/doctor"})
  }
  else if(route.redirectedFrom?.fullPath === "/roomselect" ) {
    push({path: "/"})
    push({path: "/ecg/doctor"})
  }
  else if(route.redirectedFrom?.fullPath === "/ecg/roomselect" ) {
    push({path: "/"})
    push({path: "/ecg/doctor"})
  }
  else {
    push({path: route.redirectedFrom?.fullPath})
@@ -164,7 +170,7 @@
  }
  resetCurSel()
  userStore.clearRoomInfoAction()
  await roomStore.clearRoomInfoAction()
  getList()
}