chenyc
2023-07-19 10bdb4ff5b468c77aad45ab2ec5158d715ab6a3d
更新测温模块
5个文件已修改
3个文件已添加
60 ■■■■ 已修改文件
imgs/1689746492888.png 补丁 | 查看 | 原始文档 | blame | 历史
imgs/1689746844895.png 补丁 | 查看 | 原始文档 | blame | 历史
imgs/1689747349082.png 补丁 | 查看 | 原始文档 | blame | 历史
package.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/samples/portApi.ts 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/stores/sockteInfo.ts 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/axios.ts 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/home/index.vue 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
imgs/1689746492888.png
imgs/1689746844895.png
imgs/1689747349082.png
package.json
@@ -1,6 +1,6 @@
{
  "name": "sign-tool",
  "version": "2.6.6",
  "version": "2.6.7",
  "icon": "public/favicon.ico",
  "main": "dist/electron/main/index.js",
  "author": "",
src/samples/portApi.ts
@@ -1,6 +1,8 @@
import { ElMessage } from 'element-plus'
const { SerialPort } = require('serialport')
const { DelimiterParser } = require('@serialport/parser-delimiter')
import {sockteStore} from '@/stores/sockteInfo'
let serialport={}
// 解析器分隔符
@@ -45,10 +47,17 @@
          const hex4e=value[0]
          const hex0e=value[1]
          const wendu=(hex4e+hex0e*256)/100
          ElMessage({
                message: '收到温度:'+wendu,
                type: 'success',
            })
          if(wendu>20){
            sockteStore().setWendu(wendu)
            console.log('解析到的温度'+wendu)
            // ElMessage({
            //     message: '收到温度:'+wendu,
            //     type: 'success',
            // })
          }else{
            console.log('读取温度异常'+wendu)
          }
        }
      })
}
src/stores/sockteInfo.ts
@@ -42,10 +42,16 @@
    const isLink=ref(false) // sockte 链接状态
    const netLink=ref(true) // 网络链接状态
    const pcName=ref('')
    // 温度
    const wendu=ref(0)
    const weightSockte=ref(weightInfo) // 体重秤sockte结果
    const xyjSockte=ref(xyjInfo) // 血压计sockte结果
    const dkqSockte=ref(dkqInfo) // 读卡器sockte结果
    const faceInfoSockte=ref(faceInfo)
    // 更新温度
    function setWendu(wen_du:number){
        wendu.value=wen_du
    }
    // 更新连接状态
    function setsockteIsLink(Link:boolean){
        isLink.value=Link
@@ -112,7 +118,7 @@
        pcName.value=name
    }
    return {isLink,netLink,weightSockte,xyjSockte,dkqSockte,faceInfoSockte,pcName,setsockteIsLink,setnetLink,setweightSockte,
        setweightState,setPcName,setXtjState,setfaceSockte,
    return {isLink,netLink,weightSockte,xyjSockte,dkqSockte,wendu,faceInfoSockte,pcName,setsockteIsLink,setnetLink,setweightSockte,
        setweightState,setPcName,setXtjState,setfaceSockte,setWendu,
        setxyjSockte,setdkqSockte}
})
src/utils/axios.ts
@@ -3,14 +3,14 @@
import { ElMessage } from 'element-plus'
import { confingInfoStore } from '@/stores/StoresConfing'
let BASE_URL = 'http://testbs.ihemodialysis.com'
// let BASE_URL = 'https://hemobs.icoldchain.cn'
// let BASE_URL = 'http://testbs.ihemodialysis.com'
let BASE_URL = 'https://hemobs.icoldchain.cn'
const TIME_OUT = 10 * 1000
setTimeout(()=>{
    console.log('重新赋值api',confingInfoStore().confingInfo)
    BASE_URL=confingInfoStore().confingInfo.base_api
},10000)
// setTimeout(()=>{
//     console.log('重新赋值api',confingInfoStore().confingInfo)
//     BASE_URL=confingInfoStore().confingInfo.base_api
// },10000)
/**
 * 创建axios实例
 */
src/views/home/index.vue
@@ -18,16 +18,22 @@
                    </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;">
@@ -329,6 +335,9 @@
const patientInfo = computed(() => {
  return patientInfoStore().patientInfo
})
const dangqian_wendu=computed(()=>{
  return sockte.wendu
})
// 计数
const viewNumber = computed(() => {
  return patientInfoStore().viewNumber