From c7ec2fc769d64eecf04d1f2786c07e40ac945d0b Mon Sep 17 00:00:00 2001
From: zhangchen <1652267879@qq.com>
Date: 星期二, 01 七月 2025 14:57:47 +0800
Subject: [PATCH] Merge branches 'master' and 'master' of http://dh.leon056.com:7499/r/data2/Single_application into ID1743-副屏添加医嘱
---
src/views/deviceWindoes2.vue | 335 +++++++++++++++++++++++++++++++++++++------------------
1 files changed, 223 insertions(+), 112 deletions(-)
diff --git a/src/views/deviceWindoes2.vue b/src/views/deviceWindoes2.vue
index 0322e29..cb96448 100644
--- a/src/views/deviceWindoes2.vue
+++ b/src/views/deviceWindoes2.vue
@@ -24,20 +24,31 @@
<span
class="grid-container"
@click="initTupiao"
- style="margin-left: 5%; font-size: 350%; height: 100%"
+ style="margin-left: 2%; font-size: 200%; height: 100%"
>{{ deviceData.患者姓名 }}
</span>
<span
class="grid-container"
v-if="deviceData.年龄 !== null"
- style="margin-left: 5%; font-size: 300%; height: 100%"
+ style="margin-left: 2%; font-size: 200%; height: 100%"
>{{ deviceData.年龄 }}岁</span
>
<span
class="grid-container"
- style="margin-left: 5%; font-size: 300%; height: 100%"
+ style="margin-left: 2%; font-size: 200%; height: 100%"
>{{ deviceData.性别 }}</span
+ >
+ <span
+ class="grid-container"
+ style="margin-left: 2%; font-size: 200%; height: 100%"
+ >{{ patientSourceAndCode }}</span
+ >
+ <span
+ v-if="deviceData.签到号"
+ class="grid-container"
+ style="margin-left: 2%; font-size: 200%; height: 100%"
+ >{{ deviceData.签到号 }}</span
>
<div
@@ -79,9 +90,10 @@
</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%">
+ <div :style="{ height: (contentHeight - 10) + 'px' }">
+ <div class="chongjian" style="height: 50%;">
<el-row :gutter="20" style="height: 100%; padding: 20px 20px 10px 20px">
<el-col :span="6" style="height: 100%; padding-bottom: 10px">
<div style="height: 100%">
@@ -475,12 +487,13 @@
height: 75%;
text-align: center;
font-weight: 600;
- font-size: 50px;
- color: #333333;
+ color: #333333;
color: #ca7070;
+ overflow: hidden;
+ overflow-y: auto;
"
>
- <el-row style="font-size: 30px">
+ <el-row style="font-size: 20px; overflow: hidden;">
<el-col
v-for="(row, index) in deviceData.异常检验指标"
:span="8"
@@ -514,7 +527,7 @@
height: 75%;
text-align: center;
font-weight: 600;
- font-size: 50px;
+ font-size: 25px;
color: #8079cb;
"
class="grid-container"
@@ -629,7 +642,7 @@
<!-- 治疗中 -->
<div
class="mowei"
- style="height: 39%"
+ style="height: 39%;"
v-if="Number(deviceData.透析状态) > 0"
>
<el-row style="height: 100%; padding: 0px 20px 10px 20px">
@@ -860,9 +873,11 @@
font-size: 50px;
color: #333333;
color: #ca7070;
+ overflow: hidden;
+ overflow-y: auto;
"
>
- <el-row style="font-size: 30px">
+ <el-row style="font-size: 20px">
<el-col
v-for="(row, index) in deviceData.异常检验指标"
:span="12"
@@ -1089,6 +1104,7 @@
</div>
</el-col>
</el-row>
+ </div>
</div>
</el-carousel-item>
<el-carousel-item :style="{ height: (contentHeight - 10) + 'px' }">
@@ -1538,8 +1554,8 @@
<template #footer>
<div class="dialog-footer">
<el-button @click="centerDialogVisible = false">取消</el-button>
- <el-button @click="test">测试播报</el-button>
- <el-button @click="toggleAlarm">测试报警</el-button>
+ <!-- <el-button @click="test">测试播报</el-button> -->
+ <!-- <el-button @click="toggleAlarm">测试报警</el-button> -->
<el-button type="primary" @click="saveSet"> 确认 </el-button>
<el-button type="success" @click="shuaxin"> 刷新 </el-button>
</div>
@@ -1606,6 +1622,9 @@
<el-option label="测血压" value="测血压" />
<el-option label="开超滤" value="开超滤" />
<el-option label="给药" value="给药" />
+ <el-option label="调电导度" value="调电导度" />
+ <el-option label="调血流量" value="调血流量" />
+ <el-option label="冲管" value="冲管" />
</el-select>
</el-form-item>
<el-form-item label="定型文:">
@@ -1672,7 +1691,13 @@
import cljd from "../img/cljd.png";
import tizhong from "../img/tizhong.png";
import { EventSourcePolyfill } from "event-source-polyfill";
-import alertbaojin from '../assets/alert.wav'
+import alertbaojin from "../assets/alert.wav";
+import cxybaojing from "../assets/cxy.mp3";
+import gybaojing from "../assets/gy.mp3";
+import kclbaojing from "../assets/kcl.mp3";
+import tdddbaojing from "../assets/tzddd.mp3";
+import tzxllbaojing from "../assets/tzxll.mp3";
+import cgbaojing from "../assets/cg.mp3";
import {
computed,
@@ -1690,26 +1715,86 @@
import { jgTime4 } from "../utils/formatTime";
import { setTimeoutAlert } from "../utils/httpApi";
import DoctorAdvice from '../components/doctorAdvice/index.vue';
-// 创建 Audio 对象,指向 public 目录下的音频文件
-const alarmSound = new Audio(alertbaojin)
+// 创建 Audio 对象,指向 public 目录下的音频文件
+const alarmSound = new Audio(alertbaojin); //一般报警声音
+const alarmSoundCXY = new Audio(cxybaojing); //测血压报警
+alarmSoundCXY.loop = true; // 循环播放
+const alarmSoundGY = new Audio(gybaojing); //给药报警
+alarmSoundGY.loop = true; // 循环播放
+const alarmSoundKCL = new Audio(kclbaojing); //开超滤报警
+alarmSoundKCL.loop = true; // 循环播放
+const alarmSoundTZDDD = new Audio(tdddbaojing); //调整电导度
+alarmSoundTZDDD.loop = true; // 循环播放
+const alarmSoundTZxll = new Audio(tzxllbaojing); //调整电导度
+alarmSoundTZxll.loop = true; // 循环播放
+const alarmSoundCG = new Audio(cgbaojing); //冲管
+alarmSoundCG.loop = true; // 循环播放
+
+const isHeightSet = ref(false);
// 控制播放状态的变量
-const isPlaying = ref(false)
+const isPlaying = ref(false);
// 切换播放/暂停的方法
const toggleAlarm = () => {
+ console.log('-------------')
+ console.log('看看是打开还是暂停')
if (isPlaying.value) {
- alarmSound.pause()
+ if (倒计时告警文本.value === "测血压") {
+
+ alarmSoundCXY.pause();
+ } else if (倒计时告警文本.value === "冲管") {
+ alarmSoundCG.pause();
+ } else if (倒计时告警文本.value === "开超滤") {
+ alarmSoundKCL.pause();
+ } else if (倒计时告警文本.value === "给药") {
+ alarmSoundGY.pause();
+ } else if (倒计时告警文本.value === "调电导度") {
+ alarmSoundTZDDD.pause();
+ } else if (倒计时告警文本.value === "调血流量") {
+ alarmSoundTZxll.pause();
+ } else {
+ alarmSound.pause();
+ }
} else {
- alarmSound.currentTime = 0 // 从头开始播放
- alarmSound.play().catch((err) => {
- console.error('播放失败:', err)
- })
+ if (倒计时告警文本.value === "测血压") {
+ alarmSoundCXY.currentTime = 0; // 从头开始
+ alarmSoundCXY.play().catch((err) => {
+ console.error("播放失败:", err);
+ });
+ } else if (倒计时告警文本.value === "冲管") {
+ alarmSoundCG.currentTime = 0; // 从头开始
+ alarmSoundCG.play().catch((err) => {
+ console.error("播放失败:", err);
+ });
+ } else if (倒计时告警文本.value === "开超滤") {
+ alarmSoundKCL.currentTime = 0; // 从头开始
+ alarmSoundKCL.play().catch((err) => {
+ console.error("播放失败:", err);
+ });
+ } else if (倒计时告警文本.value === "给药") {
+ alarmSoundGY.currentTime = 0; // 从头开始
+ alarmSoundGY.play().catch((err) => {
+ console.error("播放失败:", err);
+ });
+ } else if (倒计时告警文本.value === "调电导度") {
+ alarmSoundTZDDD.currentTime = 0; // 从头开始
+ alarmSoundTZDDD.play().catch((err) => {
+ console.error("播放失败:", err);
+ });
+ } else if (倒计时告警文本.value === "调血流量") {
+ alarmSoundTZxll.currentTime = 0; // 从头开始
+ alarmSoundTZxll.play().catch((err) => {
+ console.error("播放失败:", err);
+ });
+ } else {
+ alarmSound.currentTime = 0; // 从头开始播放
+ alarmSound.play().catch((err) => {
+ console.error("播放失败:", err);
+ });
+ }
}
- isPlaying.value = !isPlaying.value
-}
-// 语音播报
-import Speech from "speak-tts";
-const speech = ref(null);
+ isPlaying.value = !isPlaying.value;
+};
const { proxy } = getCurrentInstance() as any;
// 在需要使用的组件中引入
import { ChatDotSquare } from "@element-plus/icons-vue";
@@ -1743,6 +1828,9 @@
const 当前客户耗材集合 = ref({});
const deviceData = ref({
+ 患者来源: null,
+ 患者门诊住院号: '',
+ 签到号: '',
透析单医嘱列表: [],
iot_传输时间: "2025-01-10 19:15:24",
iot_当前脱水量: 2.04,
@@ -1926,6 +2014,18 @@
return false;
}
});
+
+const patientSourceAndCode = computed(() => {
+ let res = '';
+ if (deviceData.value.患者来源 === null) {
+ return ''
+ } else {
+ res = deviceData.value.患者来源 === 1 ? '住院号:' : '门诊号:';
+ res += deviceData.value.患者门诊住院号;
+ }
+ return res;
+})
+
watch(
() => isShowXY.value,
() => {
@@ -1959,7 +2059,6 @@
};
// 保存定时任务
const setDingshi = () => {
-
console.log("--------------------");
console.log(formInline.value);
console.log(deviceCode.value);
@@ -1970,7 +2069,7 @@
} else {
alertText = formInline.value.alertText;
}
- if (alertText==='') {
+ if (alertText === "") {
ElMessage.warning("设置报警消息不能为空");
return true;
}
@@ -1983,7 +2082,7 @@
if (res.data === "OK") {
倒计时.value = minutes * 60;
centerDialogVisible2.value = false;
- 倒计时告警文本.value = alertText
+ 倒计时告警文本.value = alertText;
} else {
ElMessage.warning(res.message);
}
@@ -2149,24 +2248,55 @@
const 倒计时告警文本 = ref("");
// 定时器回调函数
const updateTime = () => {
+ 倒计时.value--;
if (倒计时.value > 0) {
倒计时显示.value = formatSecondsToTime(倒计时.value);
- 倒计时.value--;
- } else if(倒计时.value!==-100) {
+ } else if (倒计时.value > -5) {
倒计时显示.value = "";
// 只有没触发的时候才触发他
- if(centerDialogVisible3.value===false){
- centerDialogVisible3.value = true;
- 关闭弹框警告();
- // 播报警告文本(倒计时告警文本.value);
- toggleAlarm()
- }
-
- }else{
+ if (centerDialogVisible3.value === false) {
+ centerDialogVisible3.value = true;
+ 关闭弹框警告();
+ // toggleAlarm();
+ }
+ } else {
倒计时显示.value = "";
}
};
let intervalId = null;
+watch(()=>centerDialogVisible3.value,()=>{
+ if(centerDialogVisible3.value===false){
+ alarmSound.pause();
+ alarmSoundCXY.pause();
+ alarmSoundKCL.pause();
+ alarmSoundGY.pause();
+ alarmSoundTZDDD.pause();
+ alarmSoundTZxll.pause();
+ alarmSoundCG.pause();
+ }else{
+ if (倒计时告警文本.value === "测血压") {
+ alarmSoundCXY.play();
+ }
+ else if (倒计时告警文本.value === "冲管") {
+ alarmSoundCG.play();
+ }
+ else if (倒计时告警文本.value === "开超滤") {
+ alarmSoundKCL.play();
+ }
+ else if (倒计时告警文本.value === "给药") {
+ alarmSoundGY.play();
+ }
+ else if (倒计时告警文本.value === "调电导度") {
+ alarmSoundTZDDD.play();
+ }
+ else if (倒计时告警文本.value === "调血流量") {
+ alarmSoundTZxll.play();
+ }
+ else {
+ alarmSound.play();
+ }
+ }
+})
onMounted(() => {
let devcieCode = Local.get("devcieCode");
if (devcieCode) {
@@ -2176,12 +2306,12 @@
centerDialogVisible.value = true;
}
intervalId = setInterval(updateTime, 1000);
- speech.value = new Speech();
- speech.value?.setLanguage("zh-CN");
- speech.value?.init().then(() => {
- console.log("语音初 始化成功");
- // test()
- });
+ const width = window.innerWidth;
+const height = window.innerHeight;
+
+console.log('可视区域宽度:', width);
+console.log('可视区域高度:', height);
+
});
// 在组件卸载前清除定时器,防止内存泄漏
onBeforeUnmount(() => {
@@ -2257,17 +2387,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)
}
})
@@ -2277,7 +2419,7 @@
// http://testbs.ihemodialysis.com/sse/sseEvent
// const test='http://testbs.ihemodialysis.com/sse/sseEvent/'
数据初始化.value = true;
- const test = "https://backend.ihemodialysis.com/sse/sseEvent/";
+ const test = import.meta.env.VITE_SSE_BASE_URL;
const stateArr = [
{ key: 0, value: "正在链接中" },
{ key: 1, value: "已经链接并且可以通讯" },
@@ -2314,12 +2456,15 @@
if (dataBody.倒计时?.提醒文本) {
倒计时.value = dataBody.倒计时?.设定提醒倒计时;
console.log("设置了倒计时值", 倒计时.value);
- if (倒计时.value <= 0 && 倒计时.value >= -60&& centerDialogVisible3.value===false) {
+ if (
+ 倒计时.value <= 0 &&
+ 倒计时.value >= -60 &&
+ centerDialogVisible3.value === false
+ ) {
centerDialogVisible3.value = true;
倒计时告警文本.value = dataBody.倒计时?.提醒文本;
关闭弹框警告();
- 播报警告文本(倒计时告警文本.value);
- toggleAlarm()
+ // toggleAlarm();
} else if (倒计时.value <= -60) {
centerDialogVisible3.value = false;
}
@@ -2348,6 +2493,21 @@
console.log(Date.now() + "DEV");
if (dataBody?.透析状态) {
deviceData.value = dataBody?.透析状态;
+ if ('透析单医嘱列表' in dataBody.透析状态) {
+ deviceData.value.透析单医嘱列表 = dataBody.透析状态.透析单医嘱列表;
+ } else {
+ deviceData.value.透析单医嘱列表 = []
+ }
+ if ('患者来源' in dataBody.透析状态) {
+ deviceData.value.患者来源 = dataBody.透析状态.患者来源;
+ } else {
+ deviceData.value.患者来源 = null
+ }
+ if ('患者门诊住院号' in dataBody.透析状态) {
+ deviceData.value.患者门诊住院号 = dataBody.透析状态.患者门诊住院号;
+ } else {
+ deviceData.value.患者门诊住院号 = ''
+ }
} else {
deviceData.value.设备名称 = dataBody.IOT信息.床号;
deviceData.value.患者姓名 = "";
@@ -2361,9 +2521,6 @@
deviceData.value.属性历史列表 = dataBody?.IOT信息?.属性历史列表;
console.log(deviceData.value.设备变化);
deviceData.value.设备状态列表 = dataBody.IOT信息.状态列表;
- if ('透析单医嘱列表' in dataBody.透析状态) {
- deviceData.value.透析单医嘱列表 = dataBody.透析状态.透析单医嘱列表;
- }
}
}
}
@@ -2391,56 +2548,9 @@
setTimeout(function () {
console.log("30秒已过,关闭报警设置弹框。");
centerDialogVisible3.value = false;
- toggleAlarm()
- 倒计时.value=-100
+ 倒计时.value = -100;
}, 30000); // 30000 毫秒 = 30 秒
};
-const 播报警告文本 = (tex) => {
- if (centerDialogVisible3.value) {
- console.log(centerDialogVisible3.value,'播报')
- speech.value
- .speak({
- text: tex,
- listeners: {
- //开始播放
- onstart: () => {
- console.log("开始播报");
- },
- //判断播放是否完毕
- onend: () => {
- console.log("播报完成");
- },
- //恢复播放
- onresume: () => {
- console.log("Resume utterance");
- },
- },
- })
- .then(() => {
- 播报警告文本(tex);
- });
- }
-};
-const test=()=>{
- speech.value
- .speak({
- text: '你好,我现在在测试播报内容',
- listeners: {
- //开始播放
- onstart: () => {
- console.log("开始播报");
- },
- //判断播放是否完毕
- onend: () => {
- console.log("播报完成");
- },
- //恢复播放
- onresume: () => {
- console.log("Resume utterance");
- },
- },
- })
-}
//初始化
const sourceInit = () => {
console.log("初始化see");
@@ -2601,7 +2711,7 @@
label: { fontSize: 20, color: "#409EFF" },
});
seriesData[2].markPoint.data.push({
- name: "上机血压",
+ name: "上机压",
value: e.脉搏,
xAxis: index,
yAxis: e.脉搏,
@@ -2951,6 +3061,7 @@
width: 100%;
height: 100%;
border: 1px solid coral;
+ user-select: none;
.toubu {
// padding-left: 20px;
width: 100%;
--
Gitblit v1.8.0