<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>
|
</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>
|
</el-main>
|
<el-aside width="210px" class="monitor-aside">
|
<div>开诊时间:{{ openingPeriod }} {{ monitorInfo?.openingFlag }} </div>
|
<div>工位概况: {{monitorInfo?.openingBedNum}} {{monitorInfo?.docBedNum}} {{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 { RoomApi, RoomVO, MonitorInfo } from '@/api/ecg/room'
|
import { QueueApi } from '@/api/ecg/queue'
|
import { getConfigKey } from '@/api/infra/config'
|
import {useCheckTypeStore} from "@/store/modules/checkType";
|
import {getCheckTypeName} from "../../../utils/checkTypeFormatter";
|
|
defineOptions({ name: 'RoomSetting' })
|
|
const bedMap = ref() // 列表的数据
|
|
const openingPeriod = ref<string>('')
|
const monitorInfo = ref<MonitorInfo>({
|
openingBedNum: 0,
|
docBedNum: 0,
|
routingBedNum: 0,
|
openingFlag: 0,
|
checkTypeBedInfo: {}
|
})
|
|
const checkTypeStore = useCheckTypeStore();
|
|
const getOpeningPeriod = async () => {
|
const data = await getConfigKey('ecg.openingtime')
|
openingPeriod.value = data
|
}
|
|
const getMonitorInfo = async () => {
|
const data = await RoomApi.getMonitorInfo()
|
monitorInfo.value = data as MonitorInfo
|
}
|
|
/** 查询列表 */
|
const getList = async () => {
|
const data = await RoomApi.getAllBedMap()
|
bedMap.value = data as Map<String, RoomVO[]>
|
}
|
|
const startBiz = async () => {
|
await RoomApi.startBiz();
|
getMonitorInfo()
|
}
|
|
const closeBiz = async () => {
|
await RoomApi.closeBiz();
|
getMonitorInfo()
|
}
|
|
const resetRoom = async () => {
|
await RoomApi.resetRoom();
|
getList()
|
}
|
|
const resetSchedule = async () => {
|
await QueueApi.resetSchedule();
|
}
|
|
const refresh = () => {
|
getList()
|
getOpeningPeriod()
|
getMonitorInfo()
|
}
|
|
/** 初始化 **/
|
onMounted(() => {
|
getList()
|
getOpeningPeriod()
|
getMonitorInfo()
|
})
|
|
</script>
|
|
<style scoped lang="scss">
|
/* ==========================================================================
|
需求:开诊设置页面卡片太大,要不滚动鼠标就能看全。
|
卡片本身已在 RoomStatus 里压缩(148px 宽 / 图片限高 46px),
|
这里再收紧布局外边距与右侧监控栏,减少整体纵向占用。
|
========================================================================== */
|
.room-setting-main {
|
padding: 8px 12px;
|
}
|
|
.card-area {
|
display: flex;
|
flex-wrap: wrap;
|
justify-content: center;
|
margin-bottom: 8px;
|
}
|
|
.wrap {
|
margin: 0 6px;
|
}
|
|
.btn-area {
|
display: flex;
|
flex-wrap: wrap;
|
justify-content: center;
|
margin-bottom: 8px;
|
}
|
|
/* 右侧监控信息:字号收紧,避免换行撑高 */
|
.monitor-aside {
|
padding: 8px 10px;
|
font-size: 12px;
|
line-height: 18px;
|
}
|
</style>
|