chenyc
2025-08-06 aec98248047327dd29d9ac6f5f307d5a86b939a1
更新
4个文件已修改
43 ■■■■■ 已修改文件
src/samples/faceApi.ts 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/samples/httpApi.ts 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/stores/StoresConfing.ts 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/home/index.vue 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/samples/faceApi.ts
@@ -13,7 +13,7 @@
var AipFaceClient = require("baidu-aip-sdk").face;
// 设置APPID/AK/SK
// 设置APPID/AK/SK  百度人脸识别
var APP_ID = "119524671";
var API_KEY = "53x6fo60pAGACz078FyT2QpY";
var SECRET_KEY = "r06aXtscuAk2SXHk1FsGM66aUCoGzncU";
@@ -105,14 +105,13 @@
const faceSearchBaidu=async(path:any)=>{
  const faceScore=confingInfoStore().confingInfo.face_score
  console.log('文件路径百度识别')
  console.log(path)
  try {
    var image = path; // 图片的 base64 数据,图片大小不超过 10M,支持 JPG、PNG、BMP、JPEG 格式
    var imageType = "BASE64";
    
    var groupIdList = "test_2018";
    var groupIdList = confingInfoStore().confingInfo.clientCode; // 人脸库ID列表,多个用逗号分隔,最多支持20个
    
    // 调用人脸搜索
    clientBaidu.search(image, imageType, groupIdList).then(function(result: any) {
@@ -265,14 +264,17 @@
        faceApiCheck(path)
       }else{
        //阿里验证外网
        console.log('阿里识别')
        if(faceType==='阿里云'){
          console.log('阿里识别')
          faceShibie(path)
        }else if(faceType==='百度'){
          console.log('百度识别')
          faceSearchBaidu(base64)
          //直接删除
          delImg(path)
       }else{
          console.log('阿里识别')
          faceShibie(path)
       }
     }
   } });
src/samples/httpApi.ts
@@ -2,11 +2,13 @@
import { confingInfoStore } from '@/stores/StoresConfing'
import {getPatientInfo2,updatePatient} from '@/api/user/index'
import {writePatient,writeResult} from './sockteStomp'
import { ipcRenderer } from 'electron'
/**
 * 发送患者卡号返回患者信息
 * @param codeStr 
 */
const sendPationCodeApi=(codeStr:string)=>{
    ipcRenderer.invoke('logger', `用患者code获取患者数据 code:${codeStr}`)
    const pcName= sockteStore().pcName
    const mode={
        machineName:pcName,
@@ -14,7 +16,10 @@
        queryCode:codeStr
    }
    getPatientInfo2(mode).then(re=>{
        ipcRenderer.invoke('logger', `获取患者数据成功:${JSON.stringify(re.data)}`)
        writePatient(re.data)
    }).catch(err=>{
        ipcRenderer.invoke('logger', `获取患者数据失败:${err}`)
    })  
}
const updatePatientApi=(pam:object)=>{
src/stores/StoresConfing.ts
@@ -2,6 +2,7 @@
import { ref } from 'vue'
export const confingInfoStore =defineStore('confingInfo',()=>{
    const confingInfo=ref({
        clientCode:"",//客户端编号
        isLanFace:false,//内网版
        faceType:"百度",//人脸识别类型  baidu 阿里云
        faceApi:'',
src/views/home/index.vue
@@ -100,16 +100,20 @@
                                    {{patientInfo.pureWeight}}
                                  </template>
                                    
                              </template>
                              <template v-else>
                                <!-- 显示干体重 -->
                                <template v-if="configData.gantiziShow">
                                  {{patientInfo.pureWeight}}
                                </template>
                                  <!-- 显示分区 -->
                                <template v-else>
                                  <template v-if="patientInfo.isAfterMed===0">
                                    <div style="font-size: 50px">  {{ patientInfo.设备分区名称 }}<br/>{{ patientInfo.deviceNo }}</div>
                                  </template>
                                  <template v-else>
                                    {{patientInfo.pureWeight}}
                                  </template>
                                  <div style="font-size: 50px"> {{ patientInfo.设备分区名称 }}<br/>{{ patientInfo.deviceNo }}</div>
                                </template>
                              </template>
                            </div>
                        </el-col>
                        <el-col :span="8">
@@ -672,7 +676,7 @@
      // 人脸识别成功后 1查看是否开启测温
      // console.log(`患者信息识别成功:${patientInfo.value.name}`)
      ipcRenderer.invoke('logger', `患者信息识别成功:${patientInfo.value.name}`)
      let str = `${patientInfo.value.patientNamePyFull?patientInfo.value.patientNamePyFull:patientInfo.value.name}识别成功,分区:${patientInfo.value.设备分区名称},床号:${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(() => {
      })
@@ -703,7 +707,6 @@
    else if (patientInfo.value.name === '') {
      timer=new Date()
      ipcRenderer.invoke('logger', '接收到的患者为空')
      console.log('接收到的患者为空')
      if (isUseFaceRecogService.value) {
        dialogVisible.value = true
      }
@@ -877,7 +880,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);
    }
@@ -909,7 +913,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);
    }