From b7d347e75d0aeebca06a4f12c7a2aba155c24b1e Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期一, 31 七月 2023 17:01:38 +0800
Subject: [PATCH] 更新配置文件请求地址

---
 src/views/home/index.vue |   93 ++++++++++++++++++++++++++++++++++------------
 1 files changed, 69 insertions(+), 24 deletions(-)

diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index fc46c7f..5be345a 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -18,25 +18,39 @@
                     </div>
                 </div>
                 <div style="width: 100%; height: 20%;" >
-                    <div style="font-size: 2rem; color: #FFFFFF;margin-left: 1rem;" >
+                    <div style="font-size: 2rem; color: #FFFFFF;margin-left: 0.5rem;" >
                       {{timeShidaun}}
                     </div>
                 </div>
-                <div style="width: 100%; height: 25%;padding-top: 0.5rem;" >
-                    <div style="font-size: 2.5rem; color: #FFFFFF;margin-left: 1rem;">{{ patientInfo.name }}</div>
+                <div style="width: 100%; height: 30%;" >
+                    <div style="font-size: 2.5rem; color: #FFFFFF;margin-left: 0.5rem;">{{ patientInfo.name }}</div>
                 </div>
-                <div style="width: 100%; height: 25%; padding-top: 1rem;">
-                    <div style="font-size: 1.5rem;  color: #FFFFFF;margin-left: 1rem;">透析号:{{ patientInfo.hemoCode }}</div>
+                <div style="width: 100%; height: 20%;">
+                    <div style="font-size: 1.5rem;  color: #FFFFFF;margin-left: 0.5rem;">透析号:{{ patientInfo.hemoCode }}</div>
                 </div>
+                <div v-if="is_ce_wen" style="width: 100%; height: 20%;">
+                    <div style="font-size: 1.5rem;  color: #FFFFFF;margin-left: 0.5rem;">
+                      体温:<span v-if="dangqian_wendu>30">{{dangqian_wendu}}°C</span>
+                      <span v-else>      /</span>
+                    </div>
+                </div> 
               </el-col>
             </el-row> 
             <el-row style="height: 30%;background: rgba(243, 247, 243, 0.3);border-radius: 8px; margin-top: 5%; font-size: 2rem;">
       
               <div style="height: 25%; line-height: 100%; width: 100%;color: #FFFFFF; "   >
-                <div  style="width: 200px; font-size: 2rem; text-align: center; height: 63px; line-height: 63px;background: #2CAAFD;border-radius: 0px 8px 0px 50px;float:right">签到时间</div>
+                <div v-if="patientInfo.isAfterMed===0"   style="width: 200px; font-size: 2rem; text-align: center; height: 63px; line-height: 63px;background: #2CAAFD;border-radius: 0px 8px 0px 50px;float:right">
+                  签到时间
+                </div>
+                <div v-if="patientInfo.isAfterMed===1"   style="width: 200px; font-size: 2rem; text-align: center; height: 63px; line-height: 63px;background: #2CAAFD;border-radius: 0px 8px 0px 50px;float:right">
+                  下次透析时间
+                </div>
               </div>
-              <div style="height: 75%; line-height: 100%; width: 100%;color: #FFFFFF; padding-top: 35px; padding-left: 20px; ">
+              <div v-if="patientInfo.isAfterMed===0" style="height: 75%; line-height: 100%; width: 100%;color: #FFFFFF; padding-top: 35px; padding-left: 20px; ">
                   <div >{{date}}</div>
+              </div>
+              <div v-else style="height: 75%; line-height: 100%; width: 100%;color: #FFFFFF; padding-top: 35px; padding-left: 20px; ">
+                  <div v-if="patientInfo.nextRecordDate!==''&&patientInfo.nextRecordDate!==null">{{patientInfo.nextRecordDate.substring(0,11)}}</div>
               </div>
             </el-row>
           </el-col>
@@ -106,14 +120,16 @@
             <div style="height: 48%; margin-top: 4%;">
               <div style="height: 25%;">
                 <div class="textjuzhong" style="background: #65AAF6; font-size: 2rem; color: #FFFFFF;">
-                  <template v-if="configData.deviceType==='体重秤'">目标脱水量(L)</template>
+                  <template v-if="configData.deviceType==='体重秤'&&patientInfo.isAfterMed===0">目标脱水量(L)</template>
+                  <template v-if="configData.deviceType==='体重秤'&&patientInfo.isAfterMed===1">实际超滤量(L)</template>
                   <template v-if="configData.deviceType==='血压计'">透前脉搏(次/分)</template>
                   
                 </div>
               </div>
               <div style="height: 75%;">
                 <div class="textjuzhong" style="background: rgba(243, 247, 243, 0.3); font-size: 6rem; font-weight: 800; color: #65AAF6;">
-                  <template v-if="configData.deviceType==='体重秤'">{{aimTSL}}</template>
+                  <template v-if="configData.deviceType==='体重秤'&&patientInfo.isAfterMed===0">{{aimTSL}}</template>
+                  <template v-if="configData.deviceType==='体重秤'&&patientInfo.isAfterMed===1">{{patientInfo.actuallyClliang}}</template>
                   <template v-if="configData.deviceType==='血压计'">{{mai_bu}}</template>
                 </div>
               </div>
@@ -141,7 +157,7 @@
               </div>
               <div style="height: 75%;">
                 <div style="background: rgba(243, 247, 243, 0.3); height: 100%; width: 100%; font-size: 1.3rem; font-weight: 800; color: #FFFFFF;">
-                  <div class="textjuzhong" style="height: 25%;  width: 100%;">干体重  {{patientInfo.preWeight}}  kg</div>
+                  <div class="textjuzhong" style="height: 25%;  width: 100%;">干体重  {{patientInfo.pureWeight}}  kg</div>
                   <div class="textjuzhong" style="height: 25%;  width: 100%;">透析器  {{patientInfo.txq}}</div>
                   <div class="textjuzhong" style="height: 25%;  width: 100%;">治疗模式  {{patientInfo.medMethod}}</div>
                   <div class="textjuzhong" style="height: 25%;  width: 100%;">灌流器  {{patientInfo.glq}}</div>
@@ -158,13 +174,11 @@
             </el-col>
             <el-col :span="12" >
               <el-row>
-                <el-col :span="23" style="text-align: right; line-height: 67px;padding-right: 0px; font-size: 40px;font-weight: 400;color: #EB6F1C;">
-                  <div>{{clockNum}}S</div>
-                </el-col>
-                <el-col :span="1" style="padding-right: 10px;" class="divinput">
-                  <el-input  v-model="inputCode" ref="inputRef" id="inputCode" style="width: 0px; height: 0px;"  @change="inputChabge"
+                <el-col   :span="24" style="text-align: right; line-height: 67px;padding-right: 0px; font-size: 40px;font-weight: 400;color: #EB6F1C;">
+                  <div v-if="!dialogVisible">{{clockNum}}S</div>
+                  <el-input v-else  v-model="inputCode" ref="inputRef" id="inputCode"  style="width: 200px; height: 40px;"  @change="inputChabge"
                     placeholder="请输入患者卡号或扫描条码" />
-                  </el-col>
+                </el-col>
               </el-row>
             </el-col>
           </el-row>
@@ -183,7 +197,6 @@
         <div class="footer" style="text-align: right;">
           <div class="fanhuikey" v-if="!dialogVisible" @click="fuxuan">
            返回
-            <!-- <el-button type="primary" :icon="RefreshRight" circle /> -->
           </div>
         </div>
     </div>
@@ -201,12 +214,13 @@
 import os from "os"
 import Speech from 'speak-tts'
 import { reactive,computed, toRefs, onMounted, watch, ref } from "vue"
-import { RefreshRight } from '@element-plus/icons-vue'
 import { sendPationCodeApi } from '../../samples/httpApi'
 import { formatDate } from '@/utils/formatTime'
 import { confingInfoStore } from '@/stores/StoresConfing'
 import {base64toFile} from '@/samples/faceApi'
-import { ElMessage } from 'element-plus'
+import{initPort} from '@/samples/portApi'
+import{initPort as oumulongHbp9030 } from '@/samples/deviceApi/oumulong-HBP-9030'
+import { ElLoading, ElMessage } from 'element-plus'
 let trackerTask: any = null;
 // 标识用的画布
 const myCanvas = ref<HTMLCanvasElement | null>(null);
@@ -239,9 +253,9 @@
       base64toFile(imgSrc)
     }
     setTimeout(() => {
-      console.log('监测到人脸后3s')
+      console.log(configData.value.face_push+'秒跑一次人脸识别')
       trackerTask.run();
-    }, 3000);
+    }, configData.value.face_push*1000);
     // @ts-ignore
     if (typeof window.stream === "object") {
       myVideo.srcObject = null;
@@ -262,6 +276,8 @@
 let patientCodeLs = ''
 // 临时血压
 let patientCodeLsXy = ''
+// 测温是否开启
+const is_ce_wen=ref()
 const isUseFaceRecogService = ref(false)
 const fasongNum=ref(0)
 const caozuo=ref(0)// 点击10下才能关闭
@@ -320,6 +336,9 @@
 const patientInfo = computed(() => {
   return patientInfoStore().patientInfo
 })
+const dangqian_wendu=computed(()=>{
+  return sockte.wendu
+})
 // 计数
 const viewNumber = computed(() => {
   return patientInfoStore().viewNumber
@@ -335,6 +354,7 @@
     }
     else {
       clearInterval(timer)
+      clockNum.value = patientInfoStore().viewNumber
       patientInfoStore().setpatientInfo({
         id: 0,
         code: '',
@@ -354,6 +374,13 @@
       })
       sockteStore().setxyjSockte({
         type: '血压计',
+        deviceName: '',
+        result: '',
+        resultTime: '',
+        state: 2
+      })
+      sockteStore().setfaceSockte({
+        type: '人脸识别',
         deviceName: '',
         result: '',
         resultTime: '',
@@ -432,6 +459,7 @@
       // 定时数秒器
     settime()
     if (patientInfo.value.id !== 0 && patientInfo.value.name !== '' && patientInfo.value.isScheduled === 1) {
+      // 人脸识别成功后 1查看是否开启测温
       // console.log(`患者信息识别成功:${patientInfo.value.name}`)
       ipcRenderer.invoke('logger', `患者信息识别成功:${patientInfo.value.name}`)
       let str = `${patientInfo.value.name}识别成功。床号:${patientInfo.value.deviceNo}`
@@ -575,6 +603,9 @@
     weight: weightInfo.value.result,
     bloodPressure: ''
   }
+  if(dangqian_wendu.value>30){
+    mode.temperature=dangqian_wendu.value
+  }
   fasongNum.value++
   ipcRenderer.invoke('logger', `患者结果上传,第${fasongNum.value}次`)
   ipcRenderer.invoke('logger', '参数:'+JSON.stringify(mode))
@@ -603,6 +634,9 @@
     patientCode: patientInfo.value.code,
     weight: '',
     bloodPressure: xyjInfo.value.result
+  }
+  if(dangqian_wendu.value>30){
+    mode.temperature=dangqian_wendu.value
   }
   fasongNum.value++
   ipcRenderer.invoke('logger', `患者结果上传,第${fasongNum.value}次`)
@@ -669,12 +703,23 @@
     ipcRenderer.send('winClose')
   }
 }
+const openPort=()=>{
+  initPort('com5',115200)
+}
 onMounted(() => {
   console.log('页面初始化', os.hostname())
   setTimeout(()=>{
-    console.log('3秒后执行')
+    console.log('8秒后执行')
     console.log('打印设置文件')
     console.log(configData.value)
+    is_ce_wen.value=configData.value.Is_ce_wen
+    if(is_ce_wen.value){
+      initPort(configData.value.portPath,configData.value.baudRate)
+    }
+    // 是否开启血压计联机
+    if(configData.value.Is_xyj){
+      oumulongHbp9030(configData.value.xueyanjiPortPath,configData.value.xueyanjiBaudRate)
+    }
       // 是否开启脸识别
     isUseFaceRecogService.value = configData.value.isUseFaceRecogService
     console.log('人脸识别',isUseFaceRecogService.value)
@@ -703,7 +748,7 @@
     speech.value?.init().then(() => {
       console.log('语音初始化成功')
     })
-  },3000)
+  },8000)
 })
 
 
@@ -783,7 +828,7 @@
   border-radius: 50px 0px 0px 50px;
   position: fixed;
   right: 0;
- 
 }
+  :v-deep .el-input__inner {background-color: transparent !important;}
 </style>
 

--
Gitblit v1.8.0