| | |
| | | <template> |
| | | <el-container> |
| | | <el-main class="room-setting-main"> |
| | | <div class="card-area"> |
| | | <div class="wrap" v-for="(value, key) in bedMap" :key="key"> |
| | | <RoomStatus :title="key" :bedList="value" @refresh="getList"/> |
| | | <div class="rs-columns"> |
| | | <!-- ============ ① 工位开诊状态 ============ --> |
| | | <el-card class="rs-section rs-section--status" shadow="never"> |
| | | <template #header> |
| | | <div class="rs-section__head"> |
| | | <span class="rs-section__title">① 工位开诊状态</span> |
| | | <span class="rs-section__hint">请点击工位的「开诊 / 闭诊」图片,切换开诊状态</span> |
| | | </div> |
| | | </template> |
| | | |
| | | <!-- 图例:把三种图片和状态文字对应起来 --> |
| | | <div class="rs-legend"> |
| | | <span class="rs-legend__item"> |
| | | <img :src="closeImg" alt="已闭诊" /> |
| | | <b class="is-closed">已闭诊</b> |
| | | <span>点图片 → 开诊</span> |
| | | </span> |
| | | <span class="rs-legend__item"> |
| | | <img :src="openImg" alt="已开诊" /> |
| | | <b class="is-open">已开诊</b> |
| | | <span>点图片 → 闭诊</span> |
| | | </span> |
| | | <span class="rs-legend__item"> |
| | | <img :src="doctorImg" alt="医生在座" /> |
| | | <b class="is-doctor">医生在座</b> |
| | | <span>需先在医生工作台「离座」才能闭诊</span> |
| | | </span> |
| | | </div> |
| | | |
| | | <div class="rs-cards"> |
| | | <RoomStatus |
| | | v-for="(value, key) in bedMap" |
| | | :key="key" |
| | | :title="key" |
| | | :bedList="value" |
| | | @refresh="onBedRefresh" |
| | | /> |
| | | </div> |
| | | </el-card> |
| | | |
| | | <div class="rs-side"> |
| | | <!-- ============ ② 全局操作 ============ --> |
| | | <el-card class="rs-section" shadow="never"> |
| | | <template #header> |
| | | <div class="rs-section__head"> |
| | | <span class="rs-section__title">② 全局操作</span> |
| | | </div> |
| | | </template> |
| | | <div class="rs-btns"> |
| | | <el-button size="small" type="primary" plain @click="startBiz">手动开诊</el-button> |
| | | <el-button size="small" type="warning" plain @click="closeBiz">手动闭诊</el-button> |
| | | <el-button size="small" @click="resetRoom">重置诊室</el-button> |
| | | <el-button size="small" @click="resetSchedule">重置定时任务</el-button> |
| | | <el-button size="small" @click="refresh">刷新</el-button> |
| | | </div> |
| | | <div class="rs-note"> |
| | | 手动开诊 / 闭诊是<b>自动补人的总闸</b>:闭诊后「排队中」的患者不会被自动搬进各工位的候诊区。 |
| | | <br />「重置诊室」会清空当班工位与队列,请在无患者时使用。 |
| | | </div> |
| | | </el-card> |
| | | |
| | | <!-- ============ ③ 选择工位模式 ============ --> |
| | | <el-card class="rs-section" shadow="never"> |
| | | <template #header> |
| | | <div class="rs-section__head"> |
| | | <span class="rs-section__title">③ 选择工位模式</span> |
| | | </div> |
| | | </template> |
| | | <el-select v-model="roomSelectMode" size="small" style="width: 100%" @change="saveRoomSelectMode"> |
| | | <el-option :value="0" label="0 - 按需要强制选择工位" /> |
| | | <el-option :value="1" label="1 - 登录IP匹配工位" /> |
| | | <el-option :value="2" label="2 - 登录时手动选择工位(写入本机IP)" /> |
| | | <el-option :value="3" label="3 - 按系统默认处理" /> |
| | | </el-select> |
| | | <div class="rs-note"> |
| | | 0=每次都要选;1=按IP自动匹配,匹配不到才让选;2=每次都要选并把本机IP写到该工位; |
| | | 3=该IP首次选一次并记住,之后按 1 自动匹配 |
| | | </div> |
| | | <div class="rs-warn" v-if="unboundIpBeds.length > 0"> |
| | | 以下工位未绑定有效的 IPv4 地址(本系统工位绑定仅采用 IPv4),模式 1、3 将无法自动匹配到它们:{{ unboundIpBeds.join('、') }} |
| | | </div> |
| | | </el-card> |
| | | |
| | | <!-- ============ ④ 运行概况 ============ --> |
| | | <el-card class="rs-section" shadow="never"> |
| | | <template #header> |
| | | <div class="rs-section__head"> |
| | | <span class="rs-section__title">④ 运行概况</span> |
| | | </div> |
| | | </template> |
| | | |
| | | <div class="rs-kv"> |
| | | <span class="rs-kv__k">开诊时间</span> |
| | | <span class="rs-kv__v">{{ openingPeriod || '—' }}</span> |
| | | </div> |
| | | <div class="rs-kv"> |
| | | <span class="rs-kv__k">开诊状态</span> |
| | | <el-tag :type="monitorInfo?.openingFlag === 1 ? 'success' : 'info'" size="small"> |
| | | {{ monitorInfo?.openingFlag === 1 ? '开诊中(会自动补人)' : '已闭诊(不会自动补人)' }} |
| | | </el-tag> |
| | | </div> |
| | | <div class="rs-kv"> |
| | | <span class="rs-kv__k">工位</span> |
| | | <span class="rs-kv__v"> |
| | | 开通 {{ monitorInfo?.openingBedNum ?? 0 }} · |
| | | 在座 {{ monitorInfo?.docBedNum ?? 0 }}(医生 {{ monitorInfo?.docNum ?? 0 }} 人)· |
| | | 参与分流 {{ monitorInfo?.routingBedNum ?? 0 }} |
| | | </span> |
| | | </div> |
| | | |
| | | <!-- 各检查项目的工位分布(原来是一行行裸文本,看不出四个数字分别是什么) --> |
| | | <el-table :data="checkTypeRows" size="small" border class="rs-table"> |
| | | <el-table-column prop="name" label="检查项目" min-width="96" show-overflow-tooltip /> |
| | | <el-table-column label="开通(检查/安装)" align="center" width="116"> |
| | | <template #default="{ row }">{{ row.openMain }} / {{ row.openInstall }}</template> |
| | | </el-table-column> |
| | | <el-table-column label="在座(检查/安装)" align="center" width="116"> |
| | | <template #default="{ row }">{{ row.docMain }} / {{ row.docInstall }}</template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-card> |
| | | </div> |
| | | </div> |
| | | <div class="btn-area"> |
| | | <el-button size="small" @click="startBiz" > 手动开诊 </el-button> |
| | | <el-button size="small" @click="closeBiz" > 手动闭诊 </el-button> |
| | | <el-button size="small" @click="resetRoom" > 重置诊室 </el-button> |
| | | <el-button size="small" @click="resetSchedule" > 重置定时任务 </el-button> |
| | | <el-button size="small" @click="refresh" > 刷新 </el-button> |
| | | </div> |
| | | <div class="mode-area"> |
| | | <span class="mode-label">选择工位模式:</span> |
| | | <el-select v-model="roomSelectMode" size="small" style="width: 210px" @change="saveRoomSelectMode"> |
| | | <el-option :value="0" label="0 - 按需要强制选择工位" /> |
| | | <el-option :value="1" label="1 - 登录IP匹配工位" /> |
| | | <el-option :value="2" label="2 - 登录时手动选择工位(写入本机IP)" /> |
| | | <el-option :value="3" label="3 - 按系统默认处理" /> |
| | | </el-select> |
| | | <span class="mode-tip"> |
| | | 0=每次都要选;1=按IP自动匹配,匹配不到才让选;2=每次都要选并把本机IP写到该工位; |
| | | 3=该IP首次选一次并记住,之后按1自动匹配 |
| | | </span> |
| | | <span class="mode-warn" v-if="unboundIpBeds.length > 0"> |
| | | 以下工位未绑定有效的 IPv4 地址(本系统工位绑定仅采用 IPv4),模式1、3将无法自动匹配到它们:{{ unboundIpBeds.join('、') }} |
| | | </span> |
| | | </div> |
| | | </el-main> |
| | | <el-aside width="210px" class="monitor-aside"> |
| | | <div> |
| | | 开诊时间:{{ openingPeriod }} |
| | | <!-- |
| | | 【本次说明】开诊状态是"自动补人"的总门闸: |
| | | 已闭诊时,**排队中的患者不会被自动搬进各工位的候诊区**(界面上不会有报错,只表现为"人不进来")。 |
| | | --> |
| | | <el-tag :type="monitorInfo?.openingFlag === 1 ? 'success' : 'info'" size="small"> |
| | | {{ monitorInfo?.openingFlag === 1 ? '开诊中(会自动补人)' : '已闭诊(不会自动补人)' }} |
| | | </el-tag> |
| | | </div> |
| | | <div> |
| | | 工位概况: 开通 {{ monitorInfo?.openingBedNum }} · |
| | | 在座工位 {{ monitorInfo?.docBedNum }}(医生 {{ monitorInfo?.docNum ?? 0 }} 人)· |
| | | 参与分流 {{ monitorInfo?.routingBedNum }} |
| | | </div> |
| | | <div v-for="(value, key) in monitorInfo.checkTypeBedInfo" :key="key"> |
| | | {{ getCheckTypeName(Number(key)) }} {{ value }} |
| | | </div> |
| | | <div>工位概况:开放的工位 有医生工位 参与分流工位</div> |
| | | <div>检查项目 开放的工位 (检查/领用 | 安装) 有医生工位 (检查/领用 | 安装)</div> |
| | | </el-aside> |
| | | </el-container> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import {RoomStatus} from "@/components/RoomStatus" |
| | | import { RoomStatus } from '@/components/RoomStatus' |
| | | import { RoomApi, RoomVO, MonitorInfo, isUsableSeatIp } from '@/api/ecg/room' |
| | | import { QueueApi } from '@/api/ecg/queue' |
| | | import { getConfigKey, getConfigPage, createConfig, updateConfig } from '@/api/infra/config' |
| | | import { useCheckTypeStore } from "@/store/modules/checkType"; |
| | | import { getCheckTypeName } from "../../../utils/checkTypeFormatter"; |
| | | import { useCheckTypeStore } from '@/store/modules/checkType' |
| | | import { getCheckTypeName } from '../../../utils/checkTypeFormatter' |
| | | // 图例用的三张状态图(与 RoomStatus 卡片内保持一致) |
| | | import closeImg from '@/assets/room/close.jpg' |
| | | import openImg from '@/assets/room/open.jpg' |
| | | import doctorImg from '@/assets/room/desk-doctor.jpg' |
| | | |
| | | defineOptions({ name: 'RoomSetting' }) |
| | | |
| | |
| | | checkTypeBedInfo: {} |
| | | }) |
| | | |
| | | const checkTypeStore = useCheckTypeStore(); |
| | | const checkTypeStore = useCheckTypeStore() |
| | | |
| | | /** 该IP能否用于自动匹配工位(支持 IPv4/IPv6;空、0.0.0.0、::、127.x、::1 都是无效占位/回环值) */ |
| | | const isIpUsable = (ip?: string | null) => isUsableSeatIp(ip) |
| | |
| | | }) |
| | | }) |
| | | return list |
| | | }) |
| | | |
| | | /** |
| | | * 【本需求·布局整理】把后端 `checkTypeBedInfo` 的"空格拼串"解析成表格行。 |
| | | * |
| | | * 后端拼的是:`开通(检查/领用) 开通(安装) 在座(检查/领用) 在座(安装) `, |
| | | * 原来直接在页面上一行行输出这四个数字,没人看得懂哪个是哪个。 |
| | | */ |
| | | const checkTypeRows = computed(() => { |
| | | const map: Record<string, string> = (monitorInfo.value?.checkTypeBedInfo as any) || {} |
| | | return Object.keys(map).map((key) => { |
| | | const parts = String(map[key] || '').trim().split(/\s+/) |
| | | const num = (i: number) => { |
| | | const n = Number(parts[i]) |
| | | return Number.isFinite(n) ? n : 0 |
| | | } |
| | | return { |
| | | key: Number(key), |
| | | name: getCheckTypeName(Number(key)), |
| | | openMain: num(0), |
| | | openInstall: num(1), |
| | | docMain: num(2), |
| | | docInstall: num(3) |
| | | } |
| | | }) |
| | | }) |
| | | |
| | | const getOpeningPeriod = async () => { |
| | |
| | | key: ROOM_SELECT_MODE_KEY, |
| | | value: String(roomSelectMode.value), |
| | | visible: true, |
| | | remark: '0=按需要强制选择工位;1=登录IP匹配工位(匹配不到按0);2=登录时手动选择工位并写入本机IP;3=按系统默认处理(首次选并记IP,之后按1)' |
| | | remark: |
| | | '0=按需要强制选择工位;1=登录IP匹配工位(匹配不到按0);2=登录时手动选择工位并写入本机IP;3=按系统默认处理(首次选并记IP,之后按1)' |
| | | } |
| | | try { |
| | | if (roomSelectModeConfigId.value) { |
| | |
| | | |
| | | /** 查询列表 */ |
| | | const getList = async () => { |
| | | const data = await RoomApi.getAllBedMap() |
| | | bedMap.value = data as Map<String, RoomVO[]> |
| | | const data = await RoomApi.getAllBedMap() |
| | | bedMap.value = data as Map<string, RoomVO[]> |
| | | } |
| | | |
| | | /** 开/闭某个工位后:既要刷新卡片,也要刷新右侧概况(原来只刷卡片,数字停留在旧值) */ |
| | | const onBedRefresh = () => { |
| | | getList() |
| | | getMonitorInfo() |
| | | } |
| | | |
| | | const startBiz = async () => { |
| | | await RoomApi.startBiz(); |
| | | await RoomApi.startBiz() |
| | | getMonitorInfo() |
| | | } |
| | | |
| | | const closeBiz = async () => { |
| | | await RoomApi.closeBiz(); |
| | | await RoomApi.closeBiz() |
| | | getMonitorInfo() |
| | | } |
| | | |
| | | const resetRoom = async () => { |
| | | await RoomApi.resetRoom(); |
| | | getList() |
| | | await RoomApi.resetRoom() |
| | | getList() |
| | | } |
| | | |
| | | const resetSchedule = async () => { |
| | | await QueueApi.resetSchedule(); |
| | | await QueueApi.resetSchedule() |
| | | } |
| | | |
| | | const refresh = () => { |
| | |
| | | getRoomSelectMode() |
| | | getMonitorInfo() |
| | | }) |
| | | |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | /* ========================================================================== |
| | | 需求:开诊设置页面卡片太大,要不滚动鼠标就能看全。 |
| | | 卡片本身已在 RoomStatus 里压缩(148px 宽 / 图片限高 46px), |
| | | 这里再收紧布局外边距与右侧监控栏,减少整体纵向占用。 |
| | | 【本需求·布局整理】按功能拆成 4 块,页面不再是一堆东西平铺: |
| | | |
| | | ① 工位开诊状态(左,主区) 图例 + 各诊室工位卡片 |
| | | ② 全局操作(右上) 开诊/闭诊/重置/刷新 |
| | | ③ 选择工位模式(右中) 模式下拉 + 说明 + 未绑定IP提醒 |
| | | ④ 运行概况(右下) 开诊时间/状态/工位统计 + 各检查项目分布表 |
| | | |
| | | 窄屏(<1000px)时右侧自动折到下方,不会横向溢出。 |
| | | ========================================================================== */ |
| | | .room-setting-main { |
| | | padding: 8px 12px; |
| | | } |
| | | |
| | | .card-area { |
| | | .rs-columns { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | justify-content: center; |
| | | align-items: flex-start; |
| | | gap: 10px; |
| | | } |
| | | |
| | | /* ---------- 分区卡片通用 ---------- */ |
| | | .rs-section { |
| | | :deep(.el-card__header) { |
| | | padding: 8px 12px; |
| | | } |
| | | |
| | | :deep(.el-card__body) { |
| | | padding: 10px 12px; |
| | | } |
| | | |
| | | &__head { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | align-items: baseline; |
| | | gap: 8px; |
| | | } |
| | | |
| | | &__title { |
| | | font-size: 14px; |
| | | font-weight: 600; |
| | | color: var(--el-text-color-primary); |
| | | } |
| | | |
| | | &__hint { |
| | | font-size: 12px; |
| | | font-weight: 600; |
| | | color: var(--el-color-primary); |
| | | } |
| | | } |
| | | |
| | | /* 左侧主区(工位状态):占满剩余宽度 */ |
| | | .rs-section--status { |
| | | flex: 1 1 560px; |
| | | min-width: 0; |
| | | } |
| | | |
| | | /* 右侧一列:三块功能卡片纵向排列 */ |
| | | .rs-side { |
| | | display: flex; |
| | | flex: 0 0 380px; |
| | | flex-direction: column; |
| | | gap: 10px; |
| | | } |
| | | |
| | | /* ---------- ① 图例 ---------- */ |
| | | .rs-legend { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | gap: 4px 18px; |
| | | padding: 6px 10px; |
| | | margin-bottom: 8px; |
| | | } |
| | | |
| | | .wrap { |
| | | margin: 0 6px; |
| | | } |
| | | |
| | | .btn-area { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | justify-content: center; |
| | | margin-bottom: 8px; |
| | | } |
| | | |
| | | /* 选择工位模式设置区 */ |
| | | .mode-area { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | align-items: center; |
| | | gap: 8px; |
| | | padding: 6px 8px; |
| | | font-size: 12px; |
| | | color: #606266; |
| | | line-height: 1.6; |
| | | color: var(--el-text-color-secondary); |
| | | background: var(--el-fill-color-lighter); |
| | | border-radius: 4px; |
| | | |
| | | &__item { |
| | | display: inline-flex; |
| | | align-items: center; |
| | | gap: 4px; |
| | | |
| | | img { |
| | | width: 40px; |
| | | height: 30px; |
| | | object-fit: contain; |
| | | } |
| | | |
| | | b { |
| | | font-size: 12px; |
| | | font-weight: 600; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .mode-label { |
| | | font-weight: 600; |
| | | .rs-legend .is-open { |
| | | color: var(--el-color-success); |
| | | } |
| | | |
| | | .mode-tip { |
| | | color: #909399; |
| | | max-width: 640px; |
| | | line-height: 16px; |
| | | .rs-legend .is-closed { |
| | | color: var(--el-text-color-secondary); |
| | | } |
| | | |
| | | .mode-warn { |
| | | flex: 1 0 100%; |
| | | color: #e6a23c; |
| | | .rs-legend .is-doctor { |
| | | color: var(--el-color-primary); |
| | | } |
| | | |
| | | /* 右侧监控信息:字号收紧,避免换行撑高 */ |
| | | .monitor-aside { |
| | | padding: 8px 10px; |
| | | /* 工位卡片区 */ |
| | | .rs-cards { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | align-items: flex-start; |
| | | } |
| | | |
| | | /* ---------- ② 全局操作 ---------- */ |
| | | .rs-btns { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | gap: 8px; |
| | | |
| | | :deep(.el-button + .el-button) { |
| | | margin-left: 0; |
| | | } |
| | | } |
| | | |
| | | /* ---------- 说明文字 ---------- */ |
| | | .rs-note { |
| | | margin-top: 8px; |
| | | font-size: 12px; |
| | | line-height: 18px; |
| | | color: var(--el-text-color-secondary); |
| | | } |
| | | |
| | | .rs-warn { |
| | | margin-top: 8px; |
| | | font-size: 12px; |
| | | line-height: 18px; |
| | | color: var(--el-color-warning); |
| | | } |
| | | |
| | | /* ---------- ④ 运行概况 ---------- */ |
| | | .rs-kv { |
| | | display: flex; |
| | | gap: 8px; |
| | | font-size: 12px; |
| | | line-height: 20px; |
| | | |
| | | & + & { |
| | | margin-top: 2px; |
| | | } |
| | | |
| | | &__k { |
| | | flex: none; |
| | | min-width: 56px; |
| | | color: var(--el-text-color-secondary); |
| | | } |
| | | |
| | | &__v { |
| | | color: var(--el-text-color-regular); |
| | | } |
| | | } |
| | | |
| | | .rs-table { |
| | | margin-top: 8px; |
| | | } |
| | | </style> |