From 1051ab47ac671486801296ccf0ad7c0ed527d7e6 Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期二, 22 四月 2025 15:23:19 +0800
Subject: [PATCH] gx优化播报延时
---
src/views/home/index.vue | 61 +++++++++++++++++++++++-------
1 files changed, 47 insertions(+), 14 deletions(-)
diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index 63e2fec..bd80506 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -53,8 +53,8 @@
<div style="height: 77%;">
<div style="display: grid;grid-template-columns: minmax(250px, 40%) 1fr; height: 100%; padding-left: 20px;padding-top: 20px;">
<!-- 头像 -->
- <div :style="{backgroundImage:`url(${patientInfo.patientAvatarIcon})`}" style="background-size:100% 100%;height: 100%;" >
- <div style="width:140px; height: 50px; line-height: 50px; font-size: 25px; background: #DFB144;color: #FFFFFF; font-weight: 500; text-align: center; border-radius: 0px 8px 0px 30px; float: right;">
+ <div :style="{backgroundImage:`url(${patientInfo.patientAvatarIcon.replace(/\\/g, '/').replace(/%EF%BF%BD/g, '')})`}" style="background-size:100% 100%;height: 100%;" >
+ <div style="width:140px; height: 50px; line-height: 50px; font-size: 25px; background: #9F61DC;color: #FFFFFF; font-weight: 500; text-align: center; border-radius: 0px 8px 0px 30px; float: right;">
{{patientInfo.name}}
</div>
</div>
@@ -75,23 +75,23 @@
<div style="height: 31%; margin-top: 20px;border-radius: 12px;" >
<el-row style="height: 100%;background:rgba(246, 244, 244, 0.3);border-radius: 12px;opacity: 0.9;">
<el-col :span="8">
- <div class="textwenben" style="height: 28%; font-size: 25px;background-color: #DFB144; border-radius: 12px 0 0 0;">
+ <div class="textwenben" style="height: 28%; font-size: 25px;background-color: #9F61DC; border-radius: 12px 0 0 0;">
<template v-if="configData.deviceType==='体重秤'">
<template v-if="patientInfo.isAfterMed===0&&!configData.gantiziShow">
机号/床位号
</template>
- <template v-else>干体重(kg)</template>
+ <template v-else>理想体重(kg)</template>
</template>
<template v-else>
<template v-if="!configData.gantiziShow">
机号/床位号
</template>
- <template v-else>干体重(kg)</template>
+ <template v-else>理想体重(kg)</template>
</template>
</div>
- <div class="textwenben" style="height: 70%; font-size: 80px; color: #DFB144;">
+ <div class="textwenben" style="height: 70%; font-size: 80px; color: #9F61DC;font-weight: 1000;">
<template v-if="configData.deviceType==='体重秤'">
<template v-if="patientInfo.isAfterMed===0&&!configData.gantiziShow">
{{ patientInfo.deviceNo }}
@@ -129,7 +129,7 @@
</template>
</div>
- <div class="textwenben" style="height: 70%; font-size: 80px; color: #41B593;
+ <div class="textwenben" style="height: 70%; font-size: 80px; color: #41B593; font-weight: 1000;
border-left: #FFFFFF solid 2px;border-right: #FFFFFF solid 2px;">
<template v-if="configData.deviceType==='体重秤'">
<template v-if="patientInfo.isAfterMed===0">
@@ -280,10 +280,12 @@
import{initPort as TM2655VP} from '@/samples/deviceApi/TM2655VP'
import{initPort as zhiRongT605 } from '@/samples/deviceApi/zhiRongT605'
import{initPort as zhiRongHehui } from '@/samples/deviceApi/zhiRongHehui'
+import{initPort as zhiRongShantou } from '@/samples/deviceApi/zhiRongShantou'
import{initPort as taiHengM523 } from '@/samples/deviceApi/taiHengM523'
import{initPort as XK3190A12 } from '@/samples/deviceApi/XK3190A12'
import {initPort as mbp7000} from '@/samples/deviceApi/mbp7000'
import {initPort as mbp7000qy} from '@/samples/deviceApi/mbp7000qy'
+import {initPort as omlhbp9020} from '@/samples/deviceApi/oml-HBP-9020'
import {initPort as mbp9020} from '@/samples/deviceApi/mbp-9020'
import {initPort as rbp9000c} from '@/samples/deviceApi/RBP-9000c'
@@ -293,6 +295,7 @@
import {initPort as seca101Banger} from '@/samples/deviceApi/seca101Banger'
import {initPort as liangjiang} from '@/samples/deviceApi/liangjiang'
import {initPort as xinanguojiTZC} from '@/samples/deviceApi/xinanguojiTZC'
+
// 引入模块
import config from '../../../package.json'
@@ -707,6 +710,7 @@
}
// 没有找到患者
else if (patientInfo.value.name === '') {
+ timer=new Date()
ipcRenderer.invoke('logger', '接收到的患者为空')
console.log('接收到的患者为空')
if (isUseFaceRecogService.value) {
@@ -749,7 +753,7 @@
() => weightInfo.value.resultTime,
async () => {
const X= jgTime(timer,new Date())
- // console.log(X,'收到体重',configData.value.BobaoJg)
+ console.log(X,'收到体重',configData.value.BobaoJg)
// 体重不能0
if (weightInfo.value.result !== "0"&&patientInfo.value.code!=='') {
ipcRenderer.invoke('logger', `体重变化了:${weightInfo.value.result}`)
@@ -783,14 +787,36 @@
}else if(Number(patientInfo.value.pureWeight) !== 0&&patientInfo.value.isAfterMed===1 && patientInfo.value.preWeight>10){
aimTSL.value = (Number(patientInfo.value.preWeight)- Number(patientInfo.value.pureWeight) - Number(patientInfo.value.clothesWeight)).toFixed(2)
}
- }// 要过4秒才能重复播报这个消息
- else if(patientInfo.value.code===''&&weightInfo.value.result !== "0"&&X>configData.value.BobaoJg){
- timer=new Date()
- speech.value?.speak({ text: "没有识别的患者,请先验证患者" }).then(() => {
- })
+ }// 要过设置的10秒才能重复播报这个消息
+ else if(patientInfo.value.code===''&&weightInfo.value.result !== "0"){
+ //10后才执行
+ if(播报是否完成.value){
+ 播报是否完成.value=false
+ setTimeout(bobaoyuy, configData.value.BobaoJg*1000);
+ }else{
+ console.log('上一次播报还没完成,放弃这次播报',播报是否完成.value)
+ }
+
+
}
}
);
+// 默认播报完成
+const 播报是否完成=ref(true)
+const bobaoyuy=()=>{
+
+ if(patientInfo.value.name===''){
+ speech.value?.speak({ text: "没有识别的患者,请先验证患者",onend:()=>{
+ console.log('播报完成')
+
+ 播报是否完成.value=true
+ console.log('播报完成111111',播报是否完成.value)
+ }
+ })
+ 播报是否完成.value=true
+ }
+
+}
// 血压发送了变化
watch(
() => xyjInfo.value.resultTime,
@@ -995,6 +1021,8 @@
// 鱼跃血压计
}else if(configData.value.xyj_type==='yuyue'){
yuyueDevice(configData.value.xueyanjiPortPath,configData.value.xueyanjiBaudRate)
+ }else if(configData.value.xyj_type==='oml-HBP-9020'){
+ omlhbp9020(configData.value.xueyanjiPortPath,configData.value.xueyanjiBaudRate)
}
else{
oumulongHbp9030(configData.value.xueyanjiPortPath,configData.value.xueyanjiBaudRate)
@@ -1019,11 +1047,16 @@
XK3190A12(configData.value.tzcPortPath,configData.value.tzcBaudRate)
}else if(configData.value.tzc_type==='zhiRongHehui'){
zhiRongHehui(configData.value.tzcPortPath,configData.value.tzcBaudRate)
+ // 福州连江 就是1200 南京圣洁 9600
}else if(configData.value.tzc_type==='lianjiang'){
- liangjiang(configData.value.tzcPortPath,1200)
+ liangjiang(configData.value.tzcPortPath,configData.value.tzcBaudRate)
}else if(configData.value.tzc_type==='xinanguojiTZC'){
xinanguojiTZC(configData.value.tzcPortPath,9600)
}
+ // 志荣粤康 2400
+ else if(configData.value.tzc_type==='zhiRongShantou'){
+ zhiRongShantou(configData.value.tzcPortPath,configData.value.tzcBaudRate)
+ }
else{
zhiRongT605(configData.value.tzcPortPath,configData.value.tzcBaudRate)
}
--
Gitblit v1.8.0