From ebff3bb9647a2741ed564ecd5333f7a3c27ff5e7 Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期二, 05 十二月 2023 09:57:37 +0800
Subject: [PATCH] gx
---
src/views/home/index.vue | 9 +++++----
src/stores/StoresConfing.ts | 2 ++
package.json | 2 +-
src/utils/axios.ts | 4 ++--
src/utils/formatTime.ts | 12 +++++++++++-
5 files changed, 21 insertions(+), 8 deletions(-)
diff --git a/package.json b/package.json
index 5133013..d4f1300 100644
--- a/package.json
+++ b/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": "",
diff --git a/src/stores/StoresConfing.ts b/src/stores/StoresConfing.ts
index e5d8f31..4951fbc 100644
--- a/src/stores/StoresConfing.ts
+++ b/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,
diff --git a/src/utils/axios.ts b/src/utils/axios.ts
index 3112807..acae852 100644
--- a/src/utils/axios.ts
+++ b/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(()=>{
diff --git a/src/utils/formatTime.ts b/src/utils/formatTime.ts
index e2ab96e..3c7221c 100644
--- a/src/utils/formatTime.ts
+++ b/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
+}
+
diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index d35609a..b0c5da9 100644
--- a/src/views/home/index.vue
+++ b/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)
--
Gitblit v1.8.0