From 31a7b66e97d7d9f267c152e6d36683ad774dcc65 Mon Sep 17 00:00:00 2001
From: zhangchen <1652267879@qq.com>
Date: 星期五, 27 六月 2025 11:24:04 +0800
Subject: [PATCH] ID2556-修复异常指标超出问题
---
src/views/deviceWindoes2.vue | 48 +++++++++++++++++++++++++++++++++---------------
1 files changed, 33 insertions(+), 15 deletions(-)
diff --git a/src/views/deviceWindoes2.vue b/src/views/deviceWindoes2.vue
index 62ff160..97b64df 100644
--- a/src/views/deviceWindoes2.vue
+++ b/src/views/deviceWindoes2.vue
@@ -79,7 +79,7 @@
</div>
</el-row>
</div>
- <el-carousel v-if="contentHeight > 0" height="auto" :autoplay="false" motion-blur :initial-index="0">
+ <el-carousel v-if="contentHeight > 0" height="auto" :autoplay="false" motion-blur :initial-index="0" always="always">
<el-carousel-item :style="{ height: (contentHeight - 10) + 'px' }">
<div class="chongjian" style="height: 50%">
<el-row :gutter="20" style="height: 100%; padding: 20px 20px 10px 20px">
@@ -478,9 +478,11 @@
font-size: 50px;
color: #333333;
color: #ca7070;
+ overflow: hidden;
+ overflow-y: auto;
"
>
- <el-row style="font-size: 30px">
+ <el-row style="font-size: 30px; overflow: hidden;">
<el-col
v-for="(row, index) in deviceData.异常检验指标"
:span="8"
@@ -860,6 +862,8 @@
font-size: 50px;
color: #333333;
color: #ca7070;
+ overflow: hidden;
+ overflow-y: auto;
"
>
<el-row style="font-size: 30px">
@@ -1693,6 +1697,7 @@
// 创建 Audio 对象,指向 public 目录下的音频文件
const alarmSound = new Audio(alertbaojin)
+const isHeightSet = ref(false);
// 控制播放状态的变量
const isPlaying = ref(false)
// 切换播放/暂停的方法
@@ -2257,17 +2262,29 @@
}
);
-watch(() => deviceData.value.患者姓名, (newVal: string) => {
- console.log("患者姓名变化:", newVal);
- if (newVal) {
- contentHeight.value = 0; // 重置高度
+watch(() => deviceData.value.患者姓名, (newVal: string, oldVal: string) => {
+ console.log("患者姓名变化:", newVal)
+
+ if (newVal && oldVal !== newVal) {
+ isHeightSet.value = false // 重置标识
+ contentHeight.value = 0; // 清空高度,强制更新 el-carousel
+
setTimeout(() => {
- const windowHeight = window.innerHeight
- const toubu = document.getElementById('toubu')
- const toubuHeight = toubu ? toubu.offsetHeight : 0
- contentHeight.value = windowHeight - toubuHeight
- console.log("contentHeight.value: ", contentHeight.value)
- }, 500);
+ if (isHeightSet.value) return // 如果已设置过就不重复执行
+
+ const windowHeight = window.innerHeight
+ const toubu = document.getElementById('toubu')
+ const toubuHeight = toubu ? toubu.offsetHeight : 0
+
+ const newHeight = windowHeight - toubuHeight
+
+ if (newHeight !== contentHeight.value) {
+ contentHeight.value = newHeight
+ console.log("更新 contentHeight.value: ", contentHeight.value)
+ }
+
+ isHeightSet.value = true
+ }, 500)
}
})
@@ -2348,6 +2365,9 @@
console.log(Date.now() + "DEV");
if (dataBody?.透析状态) {
deviceData.value = dataBody?.透析状态;
+ if ('透析单医嘱列表' in dataBody.透析状态) {
+ deviceData.value.透析单医嘱列表 = dataBody.透析状态.透析单医嘱列表;
+ }
} else {
deviceData.value.设备名称 = dataBody.IOT信息.床号;
deviceData.value.患者姓名 = "";
@@ -2361,9 +2381,6 @@
deviceData.value.属性历史列表 = dataBody?.IOT信息?.属性历史列表;
console.log(deviceData.value.设备变化);
deviceData.value.设备状态列表 = dataBody.IOT信息.状态列表;
- if ('透析单医嘱列表' in dataBody.透析状态) {
- deviceData.value.透析单医嘱列表 = dataBody.透析状态.透析单医嘱列表;
- }
}
}
}
@@ -2951,6 +2968,7 @@
width: 100%;
height: 100%;
border: 1px solid coral;
+ user-select: none;
.toubu {
// padding-left: 20px;
width: 100%;
--
Gitblit v1.8.0