yxh
2026-10-05 936c01060eea0924b88ca5c35d221a972a6aba7d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<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>