gx
chenyc
2023-12-05 ebff3bb9647a2741ed564ecd5333f7a3c27ff5e7
gx
5个文件已修改
29 ■■■■ 已修改文件
package.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/stores/StoresConfing.ts 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/axios.ts 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/formatTime.ts 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/home/index.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package.json
@@ -1,6 +1,6 @@
{
  "name": "sign-tool",
  "version": "2.7.3",
  "version": "2.7.4",
  "icon": "public/favicon.ico",
  "main": "dist/electron/main/index.js",
  "author": "",
src/stores/StoresConfing.ts
@@ -10,6 +10,8 @@
        timeJg:10000,
        base_api:"",
        face_push:3,
        beginWorkTime:5,
        endWorkTime:22,
        Is_ce_wen:false,
        portPath:'COM5',
        baudRate:115200,
src/utils/axios.ts
@@ -3,8 +3,8 @@
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(()=>{
src/utils/formatTime.ts
@@ -1,5 +1,5 @@
import { Data } from "electron/main"
import { confingInfoStore } from '@/stores/StoresConfing'
/**
 * 时间日期转换
 * @param date 当前时间,new Date() 格式
@@ -222,3 +222,13 @@
    var differenceInSeconds = Math.floor(differenceInMilliseconds / 1000);
    return differenceInSeconds
}
// 获取工作时间
export function isworkTime(param: Date): boolean {
    const begin=confingInfoStore().confingInfo.beginWorkTime
    const endW=confingInfoStore().confingInfo.endWorkTime
    const hour: number = new Date(param).getHours()
    if(begin===undefined||endW===undefined) return true
    if (hour < begin||hour>endW) return false
    else return true
}
src/views/home/index.vue
@@ -216,7 +216,7 @@
import Speech from 'speak-tts'
import { reactive,computed, toRefs, onMounted, watch, ref } from "vue"
import { sendPationCodeApi } from '../../samples/httpApi'
import { formatDate,jgTime } from '@/utils/formatTime'
import { formatDate,jgTime,isworkTime } from '@/utils/formatTime'
import { confingInfoStore } from '@/stores/StoresConfing'
import {base64toFile} from '@/samples/faceApi'
import{initPort} from '@/samples/portApi'
@@ -251,9 +251,10 @@
    // console.log('没有监测到---')
    msg.value = "没识别到人脸...";
  } else if(event.data.length >= 1){
    trackerTask.stop();
    msg.value = "检测到人脸";
    console.log('监测到人脸2样')
    console.log('监测到人脸样')
    console.log(event.data)
    const myCanvas = document.getElementById("myCanvas");// 
    const thisContext = myCanvas?.getContext("2d");
@@ -263,8 +264,8 @@
    const X= jgTime(lsDateTime,new Date())
    
    // 转文件
    // 识别框显示才能到传阿里云识别
    if(dialogVisible.value&&X>configData.value.face_push){
    // 识别框显示才能到传阿里云识别并且时间要是工作时间
    if(dialogVisible.value&&X>configData.value.face_push&&isworkTime(new Date())){
      lsDateTime=new Date()
      console.log(X,'上传阿里识别间隔')
      base64toFile(imgSrc)