chenyc
2024-08-27 7576405d2b4653b460ff0eed68f4c89340be5450
src/views/home/index.vue
@@ -981,6 +981,9 @@
      }  
      else if(configData.value.xyj_type==='RBP-9000c'){
        rbp9000c(configData.value.xueyanjiPortPath,configData.value.xueyanjiBaudRate)
        // 鱼跃血压计
      }else if(configData.value.xyj_type==='yuyue'){
        rbp9000c(configData.value.xueyanjiPortPath,configData.value.xueyanjiBaudRate)
      }
      else{
        oumulongHbp9030(configData.value.xueyanjiPortPath,configData.value.xueyanjiBaudRate)
@@ -1117,12 +1120,11 @@
  )
  if (!image) {
    drawBox(box, '识别失败')
    // 开启识别
    video.value.play()
    return detectFace()
  }
  const X= jgTime(lsDateTime,new Date())
  // 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,'上传图片间隔')
@@ -1162,8 +1164,11 @@
  const canvas = document.createElement('canvas')
  canvas.width = video.videoWidth
  canvas.height = video.videoHeight
  canvas.getContext('2d')?.drawImage(video, 0, 0, canvas.width, canvas.height)
  // 参数:图片,裁剪开始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)
  const imgSrc = canvas?.toDataURL('image/png');
  return imgSrc
}
// 画盒子