From b5e123281f226d6d191ca161aa331b1c2064f6a1 Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期二, 21 十月 2025 16:02:26 +0800
Subject: [PATCH] 添加界面参数

---
 src/views/home/index.vue |  160 ++++++++++++++++++++++++++++++++---------------------
 1 files changed, 97 insertions(+), 63 deletions(-)

diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index e6fd31a..8d95ac7 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -15,8 +15,6 @@
             <el-col v-if="dialogVisible" :span="12" style="text-align: right;padding-top: 10px;">
                 <el-input  v-model="inputCode" ref="inputRef" id="inputCode" @change="inputChabge"  style="width: 400px; height: 40px;ime-mode:active;margin-right: 20px;"  
                 placeholder="请输入患者卡号或扫描条码" />
-                
-            
             </el-col>
             <el-col v-else :span="12">
                 <div class="dateclas" style="float: right;margin-top: 20px;">
@@ -53,14 +51,15 @@
                     <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: #D09200;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>
-                            <div style="display: grid;place-items: center;font-size: 120px;font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;font-weight: 800;color: #65AAF6;">
+                            <div style="display: grid;place-items: center;font-size: 120px;font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;font-weight: 800;color: black;">
                                 <template v-if="configData.deviceType==='体重秤'">
-                                  {{ weightInfo.result }}
+                                  <!-- {{ weightInfo.result }} -->
+                                  {{weightInfoResult}}
                                 </template>
                                 <template v-else>
                                   {{ Number(gao_ya) }}
@@ -75,39 +74,46 @@
                 <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: #D09200; 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: #D09200;font-weight: 800;">
+                            <div class="textwenben" style="height: 70%; font-size: 80px; color: black;font-weight: 1000;text-align: center;">
                               <template v-if="configData.deviceType==='体重秤'">
                                   <template v-if="patientInfo.isAfterMed===0&&!configData.gantiziShow">
-                                    {{ patientInfo.deviceNo }}
-                                  </template>
-                                  <template v-else>{{patientInfo.pureWeight}}</template>
-                                    
-                                </template>
-                                <template v-else>
-                                  <template v-if="patientInfo.isAfterMed===0">
-                                    {{ patientInfo.deviceNo }}
+                                    <div style="font-size: 50px"> {{ patientInfo.设备分区名称 }}<br/>{{ patientInfo.deviceNo }}</div>
+                                   
                                   </template>
                                   <template v-else>
-                                    {{ patientInfo.deviceNo }}
+                                    {{patientInfo.pureWeight}}
                                   </template>
-                                  
+                                    
+                              </template>
+                              <template v-else>
+                                <!-- 显示干体重 -->
+                                <template v-if="configData.gantiziShow">
+                                  {{patientInfo.pureWeight}}
+                                 
+
                                 </template>
+                                  <!-- 显示分区 -->
+                                <template v-else>
+                                  <div style="font-size: 50px"> {{ patientInfo.设备分区名称 }}<br/>{{ patientInfo.deviceNo }}</div>
+                                </template>
+                                  
+                              </template>
                             </div>
                         </el-col>
                         <el-col :span="8">
@@ -129,12 +135,11 @@
                                 
                               </template>
                             </div>
-                            <div class="textwenben" style="height: 70%; font-size: 80px; color: #41B593; font-weight: 800;
+                            <div class="textwenben" style="height: 70%; font-size: 80px; color: black; font-weight: 1000;
                               border-left: #FFFFFF solid 2px;border-right: #FFFFFF solid 2px;">
                                 <template v-if="configData.deviceType==='体重秤'">
                                   <template v-if="patientInfo.isAfterMed===0">
                                     {{patientInfo.lastTimeAfterWeight}}
-                                    99
                                   </template>
                                   <template v-else>{{tzjs}}</template>
                                     <!-- 体重减少(kg) -->
@@ -155,7 +160,7 @@
                             </div>
                         </el-col>
                         <el-col :span="8">
-                            <div class="textwenben" style="height: 28%; font-size: 25px;background-color: #65AAF6;border-radius: 0 12px 0 0 ">   
+                            <div class="textwenben" style="height: 28%; font-size: 25px;background-color: #65AAF6; border-radius: 0 12px 0 0 ">   
                               <template v-if="configData.deviceType==='体重秤'">
                                 <template v-if="patientInfo.isAfterMed===0">
                                   目标脱水量(L)
@@ -173,13 +178,16 @@
                                 
                               </template>
                             </div>
-                            <div class="textwenben" style="height: 70%; font-size: 80px; color: #65AAF6;">
+                            <div class="textwenben" style="height: 70%; font-size: 80px; color:black ;">
                               <template v-if="configData.deviceType==='体重秤'">
                                 <template v-if="patientInfo.isAfterMed===0">
                                   <!-- 目标脱水量(L) -->
                                   {{aimTSL}}
                                 </template>
-                                <template v-else> {{patientInfo.actuallyClliang}}</template>
+                                <template v-else>
+                                    <span v-if="configData.isHiddenActuallyClliang" >/</span>
+                                    <span v-else>{{patientInfo.actuallyClliang}}</span>
+                                 </template>
                                   <!-- 实际超滤量(L) -->
                                  
                               </template>
@@ -281,10 +289,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'
@@ -294,6 +304,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'
@@ -317,9 +328,9 @@
 const getUserMediaFail = ref(false) // 获取用户媒体失败
 let lsDateTime:any=new Date()
 const msg = ref<string>("没识别到人脸...");
-const datetext=computed(()=>{
-  return  formatDate(new Date(),'YYYY-mm-dd  WWW')
-})
+const datetext=ref(formatDate(new Date(),'YYYY-mm-dd  WWW'))
+/**体重发送时候显示在界面的体重 */
+const weightInfoResult=ref() 
 let timer:any=new Date()
 const date=ref('')
 const timeShidaun=ref('')
@@ -341,6 +352,7 @@
 const clockNum=ref(60)
 const timerNum=ref(0)//定时器数
 const aimTSL=ref('')// 目标脱水量,
+const actuallyClliang=ref('') //实际超滤量
 const gao_ya=ref("")//高压
 const di_ya=ref("")//低压
 const  mai_bu=ref("")//脉搏,
@@ -366,31 +378,18 @@
 const configData=computed(()=>{
   return confingInfoStore().confingInfo
 })
-const isLink = computed(() => {
-  return !sockte.isLink
-})
 
 // 网络链接
 const netLink = computed(() => {
-  if(!sockte.netLink){
-    ipcRenderer.invoke('logger', '网络已经断开')
-  }else{
-    ipcRenderer.invoke('logger', '网络已经恢复')
-   
-  }
-  return !sockte.netLink
+  return sockte.netLink
 })
 watch(netLink,()=>{
-  if(!netLink.value){
+  if(netLink.value){
+    ipcRenderer.invoke('logger', `检查网络状态True`)
     ElMessage.success('网络已经连接')
   }else{
-    // ElNotification({
-    //   title: '异常',
-    //   message: '网络已断开,等待重连',
-    //   type: 'warning',
-    //   duration:10000
-    // })
-    // ElMessage.warning('网络已断开,等待重连')
+    // ElMessage.warning('网络已经断开')
+    ipcRenderer.invoke('logger', `检查网络状态Fales`)
   }
 })
 
@@ -436,6 +435,7 @@
       id: 0,
       code: '',
       name: '',
+      patientNamePyFull:'',
       patientAvatarIcon: '',
       deviceCode: '',
       hemoCode: '',
@@ -465,6 +465,7 @@
       })
     clockNum.value = patientInfoStore().viewNumber
     aimTSL.value = ''
+    
     gao_ya.value = ''
     di_ya.value = ''
     mai_bu.value = ''
@@ -669,6 +670,7 @@
 watch(
   () => patientInfo.value.datetime,
   () => {
+    weightInfoResult.value=''
     patientCodeLs = ''
     patientCodeLsXy = ''
     aimTSL.value = ''
@@ -679,7 +681,7 @@
       // 人脸识别成功后 1查看是否开启测温
       // console.log(`患者信息识别成功:${patientInfo.value.name}`)
       ipcRenderer.invoke('logger', `患者信息识别成功:${patientInfo.value.name}`)
-      let str = `${patientInfo.value.name}识别成功。床号:${patientInfo.value.deviceNo}`
+      let str = `${patientInfo.value.patientNamePyFull?patientInfo.value.patientNamePyFull:patientInfo.value.name}识别成功,分区 ${patientInfo.value.设备分区名称},床号:${patientInfo.value.deviceNo},`
       dialogVisible.value = false
       speech.value?.speak({ text: str }).then(() => {
       })
@@ -708,8 +710,8 @@
     }
     // 没有找到患者
     else if (patientInfo.value.name === '') {
+      timer=new Date()
       ipcRenderer.invoke('logger', '接收到的患者为空')
-      console.log('接收到的患者为空')
       if (isUseFaceRecogService.value) {
         dialogVisible.value = true
       }
@@ -750,7 +752,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}`)
@@ -773,6 +775,7 @@
           ipcRenderer.invoke('logger', `开始发送结果到服务器:患者:${patientInfo.value.name},体重结果:${weightInfo.value.result}`)
           console.log(`开始发送结果到服务器:患者:${patientInfo.value.name},体重结果:${weightInfo.value.result}`)
           sundModeTz()
+          weightInfoResult.value=weightInfo.value.result
         }
         else {
             // 临时患者code=当前患者code
@@ -784,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,
@@ -851,7 +876,7 @@
     ipcRenderer.invoke('logger', '结果上传成功')
     // 测量结果发送成功后就一定要体重秤归零才行  关闭体重秤归零状态为false
     // 只增对M503
-    if(configData.value.tzc_type==='M503'||configData.value.tzc_type==='seca101Banger'){
+    if(configData.value.tzc_type==='M503'||configData.value.tzc_type==='seca101Banger'||configData.value.tzc_type==='XK3190-A12'){
       console.log('发送清理体重归零')
       sockteStore().setis测量准备(false)
     }
@@ -860,7 +885,8 @@
   }).catch(re=>{
     ElMessage('结果发送失败')
     console.log('结果发送失败')
-    ipcRenderer.invoke('logger', `结果发送失败:第${fasongNum.value}次,3秒后重新发送`)
+    ipcRenderer.invoke('logger', `结果发送失败:${patientInfo.value.name}第${fasongNum.value}次,3秒后重新发送`)
+    ipcRenderer.invoke('logger', `发送失败服务器返回异常:${JSON.stringify(re)}`)
     if(fasongNum.value<3){
       setTimeout(sundModeTz,5000);
     }
@@ -892,7 +918,8 @@
   }).catch(re=>{
     ElMessage('结果发送失败')
     console.log('结果发送失败')
-    ipcRenderer.invoke('logger', `结果发送失败:第${fasongNum.value}次,2秒后重新发送`)
+    ipcRenderer.invoke('logger', `结果发送失败:${patientInfo.value.name}第${fasongNum.value}次,3秒后重新发送`)
+    ipcRenderer.invoke('logger', `发送失败服务器返回异常:${JSON.stringify(re)}`)
     if(fasongNum.value<3){
       setTimeout(sundModeXyj,2000);
     }
@@ -996,6 +1023,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)
@@ -1020,10 +1049,15 @@
         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)
@@ -1045,6 +1079,7 @@
       // 获取用户媒体流
       getUserMedia(
         (streams: null) => {
+          console.log('打开视频流')
           //后续用于停止视频流
           stream.value = streams
           //显示视频
@@ -1069,6 +1104,7 @@
       if(clockNum.value===0){
         fuxuan()
       }
+      datetext.value= formatDate(new Date(),'YYYY-mm-dd  WWW')
       date.value=formatDate(new Date(),'YYYY-mm-dd HH:MM')
       if(Number(date.value.substring(11,13))<12){
         timeShidaun.value='上午好!'
@@ -1133,16 +1169,14 @@
   if (!image) {
     drawBox(box, '识别失败')
     // 开启识别
-    video.value.play()
+    // video.value.play()
     return detectFace()
   }
   const X= jgTime(lsDateTime,new Date())
   //人脸上传到阿里云  
   // 只有是结果归零状态才能进行识别   
-  console.log(`检查人脸是否要上传到阿里云识别:${sockteStore().is测量准备}`)
-  if(dialogVisible.value&&X>configData.value.face_push&&isworkTime(new Date())&&sockteStore().is测量准备){
+  if(dialogVisible.value&&X>configData.value.face_push&&sockteStore().is测量准备){
     lsDateTime=new Date()
-    // console.log(X,'上传图片间隔')
     base64toFile(image)
   }
   return detectFace()
@@ -1181,7 +1215,7 @@
   canvas.height = video.videoHeight
   // 参数:图片,裁剪开始x坐标,裁剪开始y坐标,裁剪宽度,裁剪高度,目标x坐标,目标y坐标,目标宽度,目标高度
   // context.drawImage(image, 100, 100, 200, 200, 0, 0, 200, 200);
-  canvas.getContext('2d')?.drawImage(video, startPoint.x-10,startPoint.y-10,width+20,height+20,0,0,width+10,height+10)
+  canvas.getContext('2d')?.drawImage(video, startPoint.x-20,startPoint.y-20,width+60,height+60,20,20,width+60,height+60)
   const imgSrc = canvas?.toDataURL('image/png');
 
   return imgSrc

--
Gitblit v1.8.0