chenyc
2024-07-11 b7b73d339a42d09ecc3f0115c49e23dc46893d5e
src/views/home/index.vue
@@ -4,12 +4,12 @@
    <div style="height: 10%;padding-top: 20px;">
        <el-row>
            <el-col :span="12" >
                <div style="display: grid;grid-template-columns: minmax(160px, 25%) 1fr;">
                <div style="display: grid;grid-template-columns: minmax(200px, 25%) 1fr;">
                    <div style="margin-top: 5px;" @click="guyanbi">
                        <img class="image_1"  style="margin-left: 20px;display: inline-block;"  referrerpolicy="no-referrer" src="@/assets/logo.png" />
                    
                    </div>
                      <div class="titlecss">自助签到系统</div>
                      <div @click="yanzhengTUpian" class="titlecss">自助签到系统</div>
                </div> 
            </el-col>
            <el-col v-if="dialogVisible" :span="12" style="text-align: right;padding-top: 10px;">
@@ -53,8 +53,10 @@
                    <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="{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;">
                                {{patientInfo.name}}
                              </div>
                            </div>
                            <div style="display: grid;place-items: center;font-size: 120px;font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;font-weight: 800;color: #65AAF6;">
                                <template v-if="configData.deviceType==='体重秤'">
@@ -75,25 +77,23 @@
                        <el-col :span="8">
                            <div class="textwenben" style="height: 28%; font-size: 25px;background-color: #DFB144; border-radius: 12px 0 0 0;">
                              <template v-if="configData.deviceType==='体重秤'">
                                <template v-if="patientInfo.isAfterMed===0">
                                <template v-if="patientInfo.isAfterMed===0&&!configData.gantiziShow">
                                  机号/床位号
                                </template>
                                <template v-else>干体重(kg)</template>
                                  
                              </template>
                              <template v-else>
                                <template v-if="patientInfo.isAfterMed===0">
                                <template v-if="!configData.gantiziShow">
                                  机号/床位号
                                </template>
                                <template v-else>
                                  机号/床位号
                                </template>
                                <template v-else>干体重(kg)</template>
                                
                              </template>
                            </div>
                            <div class="textwenben" style="height: 70%; font-size: 80px; color: #DFB144;">
                              <template v-if="configData.deviceType==='体重秤'">
                                  <template v-if="patientInfo.isAfterMed===0">
                                  <template v-if="patientInfo.isAfterMed===0&&!configData.gantiziShow">
                                    {{ patientInfo.deviceNo }}
                                  </template>
                                  <template v-else>{{patientInfo.pureWeight}}</template>
@@ -218,9 +218,10 @@
    <div  style="height: 18%;">
        <el-row>
            <el-col :span="6" style="padding-left: 40px; font-size: 34px; color: #FFFFFF;">
                {{formatDate(new Date(),'HH:MM')}}
              {{date.substring(11,16)}}
                <br>
                {{formatDate(new Date(),'YYYY-mm-dd')}}
                <!-- {{formatDate(new Date(),'YYYY-mm-dd')}} -->
                {{date.substring(0,11)}}
            </el-col>
            <el-col :span="12" style="font-size: 40px;color: #FFFFFF;text-align: center; padding-top: 20px;">
                请将脸部对准摄像头
@@ -239,6 +240,20 @@
           返回
          </div>
        </div>
        <el-dialog
            v-model="centerDialogVisible"
            title=""
            width="40%"
            align-center
        >
            <span>
              <div>
                  找到该程序根目录下imgs/1708401593426.png下路径 把图片名改成一致 就可以测试了,
              </div>
                <el-button @click="yanzhengTUpianClick">验证</el-button>
            </span>
        </el-dialog>
    
   
  </div>
@@ -259,7 +274,7 @@
import { sendPationCodeApi } from '../../samples/httpApi'
import { formatDate,jgTime,isworkTime } from '@/utils/formatTime'
import { confingInfoStore } from '@/stores/StoresConfing'
import {base64toFile} from '@/samples/faceApi'
import {base64toFile,yanzhengimg} from '@/samples/faceApi'
import{initPort} from '@/samples/portApi'
import{initPort as oumulongHbp9030 } from '@/samples/deviceApi/oumulong-HBP-9030'
import{initPort as  TM2655VP} from '@/samples/deviceApi/TM2655VP'
@@ -268,15 +283,22 @@
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 mbp9020} from '@/samples/deviceApi/mbp-9020'
import {initPort as rbp9000c} from '@/samples/deviceApi/RBP-9000c'
import {initPort as M503} from '@/samples/deviceApi/M503'
import {initPort as seca102} from '@/samples/deviceApi/seca102'
import {initPort as liangjiang} from '@/samples/deviceApi/liangjiang'
// 引入模块
import config from '../../../package.json'
import { Delete, Download, Plus, ZoomIn } from '@element-plus/icons-vue'
// 读取体重文件
import{todatatzs } from '@/samples/deviceApi/seca101'
import {ElMessage } from 'element-plus'
import {ElMessage, UploadFile, UploadInstance, UploadProps } from 'element-plus'
const { proxy } = getCurrentInstance() as any;
// 人脸检测对象
const options = new SsdMobilenetv1Options({
@@ -319,7 +341,22 @@
const gao_ya=ref("")//高压
const di_ya=ref("")//低压
const  mai_bu=ref("")//脉搏,
const tupianpath=ref('') //验证图片地址
const centerDialogVisible=ref(false)
const uploadRef = ref<UploadInstance>()
const fileList=ref([])
const imageUrl = ref('')
const dialogImageUrl = ref('')
// 打开图片验证
const yanzhengTUpian=()=>{
  centerDialogVisible.value=true
}
//验证图片
const yanzhengTUpianClick=()=>{
  const path = './imgs/1708401593426.png'
  yanzhengimg(path)
}
const tzjs=computed(()=>{
  if(weightInfo.value.result!=='0'&&weightInfo.value.result!==undefined&&weightInfo.value.result!==null){
    return (patientInfo.value.preWeight-Number(weightInfo.value.result)).toFixed(1)
@@ -328,7 +365,6 @@
  }
 
})
const configData=computed(()=>{
  return confingInfoStore().confingInfo
})
@@ -581,7 +617,7 @@
  const xAxisData: any[]=[]
  const series=[
    {
      name: '透前伸缩压',
      name: '透前收缩压',
      type: 'line',
      color:'#E6A23C',
      smooth: true,
@@ -595,7 +631,7 @@
      data: <any>[]
    },
    {
      name: '透后伸缩压',
      name: '透后收缩压',
      type: 'line',
      color:'#606266',
      smooth: true,
@@ -603,7 +639,7 @@
    },{
      name: '透后舒张压',
      type: 'line',
      color:'#E6A23C',
      color:'#F56C6C',
      smooth: true,
      data: []
    }
@@ -619,7 +655,7 @@
        series[2].data.push(e.透后伸缩压)
        series[3].data.push(e.透后舒张压)
      })
      const legendData=['透前伸缩压', '透前舒张压', '透后伸缩压','透后舒张压']
      const legendData=['透前收缩压', '透前舒张压', '透后收缩压','透后舒张压']
      huatu2(series,xAxisData,legendData,'血压趋势图')
    }
  })
@@ -911,7 +947,12 @@
}
const updateChengxu=()=>{
  console.log('检查更新')
  ipcRenderer.invoke("check-update");
  if(configData.value.isLanFace===true){
    console.log('是内网不能检查更新')
  }else{
    ipcRenderer.invoke("check-update");
  }
}
onMounted(() => {
  console.log('页面初始化', os.hostname())
@@ -933,6 +974,13 @@
        TM2655VP(configData.value.xueyanjiPortPath,configData.value.xueyanjiBaudRate)
      }else if(configData.value.xyj_type==='mbp7000'){
        mbp7000(configData.value.xueyanjiPortPath,configData.value.xueyanjiBaudRate)
      }else if(configData.value.xyj_type==='mbp7000qy'){
        mbp7000qy(configData.value.xueyanjiPortPath,configData.value.xueyanjiBaudRate)
      }else if(configData.value.xyj_type==='mbp9020'){
        mbp9020(configData.value.xueyanjiPortPath,configData.value.xueyanjiBaudRate)
      }
      else if(configData.value.xyj_type==='RBP-9000c'){
        rbp9000c(configData.value.xueyanjiPortPath,configData.value.xueyanjiBaudRate)
      }
      else{
        oumulongHbp9030(configData.value.xueyanjiPortPath,configData.value.xueyanjiBaudRate)
@@ -958,6 +1006,8 @@
        XK3190A12(configData.value.tzcPortPath,configData.value.tzcBaudRate)
      }else if(configData.value.tzc_type==='zhiRongHehui'){
        zhiRongHehui(configData.value.tzcPortPath,configData.value.tzcBaudRate)
      }else if(configData.value.tzc_type==='lianjiang'){
        liangjiang(configData.value.tzcPortPath,1200)
      }
      else{
        zhiRongT605(configData.value.tzcPortPath,configData.value.tzcBaudRate)
@@ -1046,7 +1096,10 @@
  const resizedResult = resizeResults(result, dims)
  const box = resizedResult.box
  // 不要小头像
  if(box._height<120) return detectFace()
  // console.log('000')
  const h=configData.value.imgHeight===undefined?140:configData.value.imgHeight
  // console.log('000',h)
  if(box._height<h) return detectFace()
  //检测框是否在取景框内
  // if (!checkInViewFinder(box)) return detectFace()
  // drawViewFinder()
@@ -1068,11 +1121,11 @@
    return detectFace()
  }
  const X= jgTime(lsDateTime,new Date())
  console.log('----',X,dialogVisible.value)
  // console.log('----',X,dialogVisible.value)
  // console.log(image)
  if(dialogVisible.value&&X>configData.value.face_push&&isworkTime(new Date())){
    lsDateTime=new Date()
    console.log(X,'上传阿里识别间隔')
    // console.log(X,'上传图片间隔')
    base64toFile(image)
  }
  return detectFace()