From 1eb000b9b8ba5d2c481bd2ba6a852c9f5de161eb Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期一, 22 一月 2024 13:48:09 +0800
Subject: [PATCH] 更新ui
---
electron-builder.json5 | 8
imgs/1705895407297.png | 0
src/views/home/index2.vue | 186 ++++++++++
src/utils/electronUtils.ts | 14
src/main.ts | 85 -----
src/views/home/index.vue | 612 +++++++++++++++++++++--------------
imgs/1705892155987.png | 0
src/assets/homeback.png | 0
index.html | 2
package.json | 4
electron/main/index.ts | 31 +
src/router/index.ts | 1
imgs/1705642240612.png | 0
electron/main/appVersion.ts | 64 +++
14 files changed, 672 insertions(+), 335 deletions(-)
diff --git a/electron-builder.json5 b/electron-builder.json5
index af6e609..507e4ed 100644
--- a/electron-builder.json5
+++ b/electron-builder.json5
@@ -32,5 +32,11 @@
"perMachine": false,
"allowToChangeInstallationDirectory": true,
"deleteAppDataOnUninstall": false
- }
+ },
+ publish: [
+ {
+ provider: "generic",
+ url: 'https://piclist.icoldchain.cn',
+ },
+ ],
}
diff --git a/electron/main/appVersion.ts b/electron/main/appVersion.ts
new file mode 100644
index 0000000..3ce226f
--- /dev/null
+++ b/electron/main/appVersion.ts
@@ -0,0 +1,64 @@
+import { autoUpdater } from 'electron-updater';
+import logger from 'electron-log'
+import { dialog, BrowserWindow } from 'electron';
+
+const updateUrl = 'https://piclist.icoldchain.cn'
+/**检测更新 */
+export const checkUpdate = (win: BrowserWindow) => {
+ console.log('----------------------------123');
+ console.log('开始检测');
+ logger.info('开始检测版本号')
+
+ // 设置更新检测的资源路径,会检测对应路径下的 last.yaml文件中的版本信息 上线后确保该文件能正常访问
+ if (process.platform == 'darwin') {
+ autoUpdater.setFeedURL(`${updateUrl}/mac`);
+ return;
+ } else {
+ autoUpdater.setFeedURL(`${updateUrl}/win`);
+ }
+
+ //检测更新
+ autoUpdater.checkForUpdates();
+
+ //监听'error'事件
+ autoUpdater.on('error', err => {
+ console.log('出错拉' + err);
+ dialog.showErrorBox('更新出错拉!', err.message);
+ });
+
+ //监听'update-available'事件,发现有新版本时触发
+ autoUpdater.on('update-available', () => {
+ console.log('found new version');
+ dialog.showMessageBox({
+ message: '发现新版本,正在下载安装包'
+ });
+ });
+
+ // 更新包下载百分比回调
+ autoUpdater.on('download-progress', function (progressObj) {
+ if (win) {
+ win.webContents.send('download-progress', progressObj);
+ }
+ });
+
+ //默认会自动下载新版本,如果不想自动下载,设置autoUpdater.autoDownload = false
+ // autoUpdater.autoDownload = false;
+
+ //监听'update-downloaded'事件,新版本下载完成时触发
+ autoUpdater.on('update-downloaded', () => {
+ dialog
+ .showMessageBox({
+ type: 'info',
+ title: '应用更新',
+ message: '需要退出程序才能安装新版本,是否安装?',
+ buttons: ['是', '否']
+ })
+ .then(buttonIndex => {
+ if (buttonIndex.response == 0) {
+ //选择是,则退出程序,安装新版本
+ autoUpdater.quitAndInstall();
+
+ }
+ });
+ });
+};
diff --git a/electron/main/index.ts b/electron/main/index.ts
index 78d324b..597d6e7 100644
--- a/electron/main/index.ts
+++ b/electron/main/index.ts
@@ -1,13 +1,11 @@
-import { app, BrowserWindow, shell, ipcMain,Menu } from 'electron'
+import { app, BrowserWindow, shell, ipcMain,Menu, IpcMainEvent } from 'electron'
import { release } from 'os'
import { join } from 'path'
-// import updater from "../preload/autoUpdate.js"
import logger from '../preload/logger.js'
-import fs from 'fs'
-import iconv from 'iconv-lite'
//koa----
import Koa from 'koa';
import Router from 'koa-router';
+import { checkUpdate } from './appVersion.js';
const koaBody = require('koa-body');
const creatorKoa=(win)=>{
const app = new Koa();
@@ -162,6 +160,31 @@
logger.info(arg)
})
})
+/**
+* 版本更新检测
+*/
+ipcMain.handle("check-update",(e:any)=>{
+ // 获取发送通知的渲染进程窗口
+ const currentWin = getWindowByEvent(e);
+ // 升级校验
+ checkUpdate(currentWin);
+});
+
+
+/**
+ * 通过窗口事件获取发送者的窗口
+ * @param event ipc发送窗口事件
+ */
+function getWindowByEvent(event: IpcMainEvent): BrowserWindow {
+ const webContentsId = event.sender.id;
+ for (const currentWin of BrowserWindow.getAllWindows()) {
+ if (currentWin.webContents.id === webContentsId) {
+ return currentWin;
+ }
+ }
+ return null;
+}
+
// 渲染端发送消息到主进程
ipcMain.on("winClose",()=>{
win?.close()
diff --git a/imgs/1705642240612.png b/imgs/1705642240612.png
new file mode 100644
index 0000000..f17a42c
--- /dev/null
+++ b/imgs/1705642240612.png
Binary files differ
diff --git a/imgs/1705892155987.png b/imgs/1705892155987.png
new file mode 100644
index 0000000..d8d5511
--- /dev/null
+++ b/imgs/1705892155987.png
Binary files differ
diff --git a/imgs/1705895407297.png b/imgs/1705895407297.png
new file mode 100644
index 0000000..28d7289
--- /dev/null
+++ b/imgs/1705895407297.png
Binary files differ
diff --git a/index.html b/index.html
index c874a94..ae6bee3 100644
--- a/index.html
+++ b/index.html
@@ -14,7 +14,7 @@
</html>
<style>
html, body{
- height: 98%;
+ height: 100%;
margin: 0;
padding: 0;
}
diff --git a/package.json b/package.json
index 46e7d80..f0284a2 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "sign-tool",
- "version": "2.7.4",
+ "version": "2.7.5",
"icon": "public/favicon.ico",
"main": "dist/electron/main/index.js",
"author": "",
@@ -13,7 +13,7 @@
"publish": [
{
"provider": "generic",
- "url": "http://dhcdn.leon056.com/upgrade/icoldchain"
+ "url": "https://piclist.icoldchain.cn"
}
],
"engines": {
diff --git a/src/assets/homeback.png b/src/assets/homeback.png
index 0a20c5e..a35742f 100644
--- a/src/assets/homeback.png
+++ b/src/assets/homeback.png
Binary files differ
diff --git a/src/main.ts b/src/main.ts
index 633656d..f5bf00d 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -10,91 +10,6 @@
import { createPinia } from 'pinia'
import App from './App.vue'
import './samples/node-api'
-
-// function getUserMedia(constrains:any, success:any, error:any) {
-// if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
-// //最新标准API
-// ElMessage({ type: 'success', message: '支持人脸识别最新Api' });
-// navigator.mediaDevices.getUserMedia(constrains).then(success).catch(error);
-// } else if (navigator.webkitGetUserMedia) {
-// ElMessage({ type: 'success', message: '支持webkit内核浏览器' });
-// //webkit内核浏览器
-// navigator.webkitGetUserMedia(constrains).then(success).catch(error);
-// } else if (navigator.mozGetUserMedia) {
-// ElMessage({ type: 'success', message: '支持Firefox浏览器' });
-// //Firefox浏览器
-// navagator.mozGetUserMedia(constrains).then(success).catch(error);
-// } else if (navigator.getUserMedia) {
-// ElMessage({ type: 'success', message: '支持旧版API' });
-// //旧版API
-// navigator.getUserMedia(constrains).then(success).catch(error);
-// } else {
-// ElMessage('浏览器不支持getUserMedia');
-// }
-// }
-// // 要重写initUserMedia_ 方法,因为chrome的底层api已做调整
-// window.tracking.initUserMedia_ = function (element: { srcObject: any; src: string; }, opt_options: { audio: any; }) {
-// const options = {
-// video: true,
-// audio: !!(opt_options && opt_options.audio)
-// };
-// getUserMedia(options, function (stream: Blob | MediaSource) {
-// try {
-// element.srcObject = stream;
-// } catch (err) {
-// element.src = window.URL.createObjectURL(stream);
-// }
-// }, function (e: { message: MessageParams; }) {
-// ElMessage(e.message);
-// }
-// );
-// };
-// // 重写视频捕获方法,因为不能停止 stop无效的bug
-// window.tracking.trackVideo_ = function (element: CanvasImageSource, tracker: tracking.Tracker) {
-// console.log('trackVideo_');
-// var canvas = document.createElement('canvas');
-// var context = canvas.getContext('2d');
-// var width: number;
-// var height: number;
-
-// var resizeCanvas_ = function () {
-// width = element.offsetWidth;
-// height = element.offsetHeight;
-// canvas.width = width;
-// canvas.height = height;
-// };
-// resizeCanvas_();
-// element.addEventListener('resize', resizeCanvas_);
-
-// var requestId: number;
-// var stopped = false;
-// var requestAnimationFrame_ = function () {
-// requestId = window.requestAnimationFrame(function () {
-// if (element.readyState === element.HAVE_ENOUGH_DATA) {
-// try {
-// // Firefox v~30.0 gets confused with the video readyState firing an
-// // erroneous HAVE_ENOUGH_DATA just before HAVE_CURRENT_DATA state,
-// // hence keep trying to read it until resolved.
-// context.drawImage(element, 0, 0, width, height);
-// } catch (err) { }
-// tracking.trackCanvasInternal_(canvas, tracker);
-// }
-// if (stopped !== true) {
-// requestAnimationFrame_();
-// }
-// });
-// };
-// var task = new tracking.TrackerTask(tracker);
-// task.on('stop', function () {
-// stopped = true;
-// window.cancelAnimationFrame(requestId);
-// });
-// task.on('run', function () {
-// stopped = false;
-// requestAnimationFrame_();
-// });
-// return task.run();
-// };
createApp(App)
.use(createPinia())
.use(ElementPlus)
diff --git a/src/router/index.ts b/src/router/index.ts
index 2353870..b2e68ff 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -4,6 +4,7 @@
import { Session } from '@/utils/storage'
const routes: Array<RouteRecordRaw> = [
+ // { path: '/', name: 'Home', component: () => import('@/views/home/index2.vue')},
{ path: '/', name: 'Home', component: () => import('@/views/home/index.vue')},
// { path: '/', name: 'login', component: () => import('@/views/login/index.vue')},
]
diff --git a/src/utils/electronUtils.ts b/src/utils/electronUtils.ts
new file mode 100644
index 0000000..622e9e9
--- /dev/null
+++ b/src/utils/electronUtils.ts
@@ -0,0 +1,14 @@
+import { ipcRenderer } from "electron";
+
+/**
+ * 检查版本更新
+ */
+export function checkUpdate(){
+ ipcRenderer.invoke("check-update");
+ }
+
+ export default {
+ checkUpdate
+ };
+
+
\ No newline at end of file
diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index 733304a..7023bdc 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -1,224 +1,256 @@
<template>
<div class="homeclass">
- <!-- {{dialogVisible}} -->
- <div class="page" v-if="!dialogVisible">
-
- <el-row style="height: 11.3%;">
- </el-row>
- <el-row style="height: 50%;margin-bottom: 2%;" :gutter="20">
- <el-col :span="7" style="height: 100%;">
- <el-row style="height: 65%;background: rgba(243, 247, 243, 0.3);border-radius: 8px;">
- <el-col :span="11">
- <el-image style="width: 100%; height:100%;border-radius: ;"
- :src="patientInfo.patientAvatarIcon" fit="cover" />
- </el-col>
- <el-col :span="13" style="width: 100%; height: 85%;">
- <div style="width: 100%; height: 20%;">
- <div style="width: 50%;height: 100%;text-align:center; background: #DFB144;border-radius: 0px 8px 0px 50px;color: aliceblue; font-size: 2rem;float:right">
- <template v-if="patientInfo.patientGender===0">男</template>
- <template v-else>女</template>
- </div>
- </div>
- <div style="width: 100%; height: 20%;" >
- <div style="font-size: 2rem; color: #FFFFFF;margin-left: 0.5rem;" >
- {{timeShidaun}}
- </div>
- </div>
- <div style="width: 100%; height: 30%;" >
- <div style="font-size: 2.5rem; color: #FFFFFF;margin-left: 0.5rem;">{{ patientInfo.name }}</div>
- </div>
- <div style="width: 100%; height: 20%;">
- <div style="font-size: 1.5rem; color: #FFFFFF;margin-left: 0.5rem;">透析号:{{ patientInfo.hemoCode }}</div>
- </div>
- <div v-if="is_ce_wen" style="width: 100%; height: 20%;">
- <div style="font-size: 1.5rem; color: #FFFFFF;margin-left: 0.5rem;">
- 体温:<span v-if="dangqian_wendu>30">{{dangqian_wendu}}°C</span>
- <span v-else> /</span>
- </div>
- </div>
- </el-col>
- </el-row>
- <el-row style="height: 30%;background: rgba(243, 247, 243, 0.3);border-radius: 8px; margin-top: 5%; font-size: 2rem;">
-
- <div style="height: 25%; line-height: 100%; width: 100%;color: #FFFFFF; " >
- <div v-if="patientInfo.isAfterMed===0" style="width: 200px; font-size: 2rem; text-align: center; height: 63px; line-height: 63px;background: #2CAAFD;border-radius: 0px 8px 0px 50px;float:right">
- 签到时间
- </div>
- <div v-if="patientInfo.isAfterMed===1" style="width: 200px; font-size: 2rem; text-align: center; height: 63px; line-height: 63px;background: #2CAAFD;border-radius: 0px 8px 0px 50px;float:right">
- 下次透析时间
- </div>
- </div>
- <div v-if="patientInfo.isAfterMed===0" style="height: 75%; line-height: 100%; width: 100%;color: #FFFFFF; padding-top: 35px; padding-left: 20px; ">
- <div >{{date}}</div>
- </div>
- <div v-else style="height: 75%; line-height: 100%; width: 100%;color: #FFFFFF; padding-top: 35px; padding-left: 20px; ">
- <div v-if="patientInfo.nextRecordDate!==''&&patientInfo.nextRecordDate!==null">{{patientInfo.nextRecordDate.substring(0,11)}}</div>
- </div>
- </el-row>
- </el-col>
- <el-col :span="10" style="height: 100%;">
- <div style="width: 100%; height: 100%;position: relative;">
- <div style="position: absolute;width: 100px; height: 100%;color: #FFFFFF; background-color: #41B593;font-size: 2rem;text-align: center;">
- <div style="width: 100%; height:25%;margin-top: 2rem;">透</div>
-
- <div v-if="patientInfo.isAfterMed===0" style="width: 100%; height:25%;">前</div>
- <div v-if="patientInfo.isAfterMed===1" style="width: 100%; height:25%;">后</div>
-
- <div style="width: 100%; height:25%;" v-if="configData.deviceType==='体重秤'"> 称
- </div>
- <div style="width: 100%; height:25%;" v-if="configData.deviceType==='体重秤'">重</div>
- <div style="width: 100%; height:25%;" v-if="configData.deviceType==='血压计'"> 血
- </div>
- <div style="width: 100%; height:25%;" v-if="configData.deviceType==='血压计'">压</div>
- </div>
- <div style="margin-left:100px; height:100%; line-height: 100%; color: #FFFFFF; background: rgba(243, 247, 243, 0.3);font-size: 8rem; font-weight: 900;">
- <div v-if="configData.deviceType==='体重秤'" class="textjuzhong">
- {{ weightInfo.result }}
- </div>
- <div v-if="configData.deviceType==='血压计'" style="height: 100%; width: 100%;font-size: 7rem;" >
- <!-- <div style=" height:100%;" class="textjuzhong">
- {{ Number(gao_ya) }}<br/> {{ Number(di_ya) }}
- </div> -->
- <div style=" height:50%;" class="textjuzhong">
- {{ Number(gao_ya) }}
- <span style="font-size: 1rem; line-height: 1rem; margin-top: 5rem;">
- mmHg
- </span>
- </div>
- <div style=" height:50%;" class="textjuzhong">
- {{ Number(di_ya) }}
- <span style="font-size: 1rem; line-height: 1rem; margin-top: 5rem;">
- mmHg
- </span>
- </div>
- </div>
- </div>
- </div>
- </el-col>
- <el-col :span="7">
- <div style="height: 48%; border-radius: 8px;">
- <div style="height: 25%;">
- <div class="textjuzhong" v-if="patientInfo.isAfterMed===0" style="background: #41B593; font-size: 2rem; color: #FFFFFF;">
- <template v-if="configData.deviceType==='体重秤'">上次透后体重(kg)</template>
- <template v-if="configData.deviceType==='血压计'">上次透后血压</template>
- </div>
- <div class="textjuzhong" v-if="patientInfo.isAfterMed===1" style="background: #41B593; font-size: 2rem; color: #FFFFFF;">
+ <!-- 标头 -->
+ <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="margin-top: 5px;" @click="guyanbi">
+ <img class="image_1" style="margin-left: 20px;display: inline-block;" referrerpolicy="no-referrer" src="@/assets/logo.png" />
- <template v-if="configData.deviceType==='体重秤'">体重减少(kg)</template>
- <template v-if="configData.deviceType==='血压计'">透前血压</template>
+ </div>
+ <div class="titlecss">自助签到系统</div>
+ </div>
+ </el-col>
+ <el-col v-if="dialogVisible" :span="12" style="text-align: right;padding-top: 10px;">
+ <el-input v-model="inputCode" ref="inputRef" id="inputCode" @change="inputChabge" style="width: 400px; height: 40px;ime-mode:active;margin-right: 20px;"
+ placeholder="请输入患者卡号或扫描条码" />
+
+
+ </el-col>
+ <el-col v-else :span="12">
+ <div class="dateclas" style="float: right;margin-top: 20px;">
+ <div class="dateTimeclas" style="float: right;">{{clockNum}}S</div>
+ {{datetext}}
</div>
- </div>
- <div style="height: 75%;">
- <div class="textjuzhong" v-if="patientInfo.isAfterMed===0" style="background: rgba(243, 247, 243, 0.3); font-size: 6rem; font-weight: 800; color: #41B593;">
- <template v-if="configData.deviceType==='体重秤'"> {{patientInfo.lastTimeAfterWeight}}</template>
- <template v-if="configData.deviceType==='血压计'">{{patientInfo.lastTimeAfterBP}}</template>
- </div>
- <div class="textjuzhong" v-if="patientInfo.isAfterMed===1" style="background: rgba(243, 247, 243, 0.3); font-size: 6rem; font-weight: 800; color: #41B593;">
- <template v-if="configData.deviceType==='体重秤'">{{tzjs}}</template>
- <template v-if="configData.deviceType==='血压计'">{{patientInfo.preBP}}</template>
- </div>
- </div>
- </div>
- <div style="height: 48%; margin-top: 4%;">
- <div style="height: 25%;">
- <div class="textjuzhong" style="background: #65AAF6; font-size: 2rem; color: #FFFFFF;">
- <template v-if="configData.deviceType==='体重秤'&&patientInfo.isAfterMed===0">目标脱水量(L)</template>
- <template v-if="configData.deviceType==='体重秤'&&patientInfo.isAfterMed===1">实际超滤量(L)</template>
- <template v-if="configData.deviceType==='血压计'">透前脉搏(次/分)</template>
-
- </div>
- </div>
- <div style="height: 75%;">
- <div class="textjuzhong" style="background: rgba(243, 247, 243, 0.3); font-size: 6rem; font-weight: 800; color: #65AAF6;">
- <template v-if="configData.deviceType==='体重秤'&&patientInfo.isAfterMed===0">{{aimTSL}}</template>
- <template v-if="configData.deviceType==='体重秤'&&patientInfo.isAfterMed===1">{{patientInfo.actuallyClliang}}</template>
- <template v-if="configData.deviceType==='血压计'">{{mai_bu}}</template>
- </div>
- </div>
- </div>
- </el-col>
- </el-row>
- <el-row style="height: 30%;" :gutter="20">
- <el-col :span="7" style="height: 100%;">
- <div style="height: 25%;">
- <div class="textjuzhong" style="background: #DFB144; font-size: 2rem; color: #FFFFFF;">
- 机位/床位号
- </div>
- </div>
- <div style="height: 81%;background-color: #FFFFFF;">
- <div class="textjuzhong" style="background: rgba(243, 247, 243, 0.3); font-size: 6rem; font-weight: 800; color: #DFB144;">
- {{ patientInfo.deviceNo }}
- </div>
- </div>
- </el-col>
- <el-col :span="17">
- <!-- <div style="height: 25%;">
- <div class="textjuzhong" style="background: #DFB144; font-size: 2rem; color: #FFFFFF;">
- 治疗信息
- </div>
- </div> -->
- <div style="height: 100%;background-color: #FFFFFF;">
- <div ref="myChartRef" style="background: rgba(243, 247, 243, 0.3); height: 100%; width: 100%; font-size: 2.5rem; line-height: 4.5rem; font-weight: 800; color: #FFFFFF; text-align: center;padding-top: 1rem;">
- <!-- <div ref="myChartRef" style="height: 300px; width: 100%;"></div> -->
- <!-- <span style="font-size: 4rem; color:#DFB144 ; " >干体重 {{patientInfo.pureWeight}}kg</span>
- <br>
- <span > 透析器:{{patientInfo.txq}}</span>
- <span > 治疗模式:{{patientInfo.medMethod}}</span>
- <span > 灌流器:{{patientInfo.glq}}</span> -->
- </div>
- </div>
- </el-col>
+
+ </el-col>
</el-row>
</div>
- <div class="wrapp">
- <div class="toupu" style="height: 11.3%;">
- <el-row style="100%">
+ <!-- 识别后需要显示的内容 -->
+
+ <div v-if="!dialogVisible" style="height: 84%;">
+ <el-row style="height: 100%;" :gutter="20">
<el-col :span="12" >
- <img class="image_1" @click="guyanbi" referrerpolicy="no-referrer" src="@/assets/logo.png" />
+ <div style="height: 66%; background:rgba(246, 244, 244, 0.3);border-radius: 12px;opacity: 0.9;" >
+ <div style="height: 15%; border-bottom: 4px solid #EDF5FF; text-align: right; padding-right: 20px; font-size: 30px; line-height: 90px;color: #0d44dc;font-weight: 500;font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;">
+
+ <template v-if="configData.deviceType==='体重秤'">
+ <template v-if="patientInfo.isAfterMed===0">
+ 透前称重(kg)
+ </template>
+ <template v-else>透后称重(kg)</template>
+
+ </template>
+ <template v-else>
+ <template v-if="patientInfo.isAfterMed===0">
+ 透前血压(mmgh)
+ </template>
+ <template v-else>透后血压(mmgh)</template>
+
+ </template>
+ </div>
+ <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>
+ <div style="display: grid;place-items: center;font-size: 120px;font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;font-weight: 800;color: #65AAF6;">
+ <template v-if="configData.deviceType==='体重秤'">
+ {{ weightInfo.result }}
+ </template>
+ <template v-else>
+ {{ Number(gao_ya) }}
+ <br>
+ {{ Number(di_ya) }}
+ </template>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div style="height: 31%; margin-top: 20px;border-radius: 12px;" >
+ <el-row style="height: 100%;background:rgba(246, 244, 244, 0.3);border-radius: 12px;opacity: 0.9;">
+ <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>
+ <template v-else>干体重(kg)</template>
+
+ </template>
+ <template v-else>
+ <template v-if="patientInfo.isAfterMed===0">
+ 机号/床位号
+ </template>
+ <template v-else>
+ 机号/床位号
+ </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">
+ {{ patientInfo.deviceNo }}
+ </template>
+ <template v-else>{{patientInfo.pureWeight}}</template>
+
+ </template>
+ <template v-else>
+ <template v-if="patientInfo.isAfterMed===0">
+ {{ patientInfo.deviceNo }}
+ </template>
+ <template v-else>
+ {{ patientInfo.deviceNo }}
+ </template>
+
+ </template>
+ </div>
+ </el-col>
+ <el-col :span="8">
+ <div class="textwenben" style="height: 28%; font-size: 25px;background-color: #41B593; ">
+ <template v-if="configData.deviceType==='体重秤'">
+ <template v-if="patientInfo.isAfterMed===0">
+ 上次透后体重(kg)
+ </template>
+ <template v-else>体重减少(kg)</template>
+
+ </template>
+ <template v-else>
+ <template v-if="patientInfo.isAfterMed===0">
+ 上次透后血压(mmgh)
+ </template>
+ <template v-else>
+ 透前血压(mmgh)
+ </template>
+
+ </template>
+ </div>
+ <div class="textwenben" style="height: 70%; font-size: 80px; color: #41B593;
+ border-left: #FFFFFF solid 2px;border-right: #FFFFFF solid 2px;">
+ <template v-if="configData.deviceType==='体重秤'">
+ <template v-if="patientInfo.isAfterMed===0">
+ {{patientInfo.lastTimeAfterWeight}}
+ </template>
+ <template v-else>{{tzjs}}</template>
+ <!-- 体重减少(kg) -->
+
+ </template>
+ <template v-else>
+ <template v-if="patientInfo.isAfterMed===0">
+ <span style="font-size: 60px;">{{patientInfo.lastTimeAfterBP}}</span>
+ <!-- 上次透后血压(mmgh) -->
+
+ </template>
+ <template v-else>
+ <span style="font-size: 60px;">{{patientInfo.preBP}}</span>
+ <!-- 透前血压(mmgh) -->
+ </template>
+
+ </template>
+ </div>
+ </el-col>
+ <el-col :span="8">
+ <div class="textwenben" style="height: 28%; font-size: 25px;background-color: #65AAF6;border-radius: 0 12px 0 0 ">
+ <template v-if="configData.deviceType==='体重秤'">
+ <template v-if="patientInfo.isAfterMed===0">
+ 目标脱水量(L)
+ </template>
+ <template v-else>实际超滤量(L)</template>
+
+ </template>
+ <template v-else>
+ <template v-if="patientInfo.isAfterMed===0">
+ 脉搏(次/分)
+ </template>
+ <template v-else>
+ 脉搏(次/分)
+ </template>
+
+ </template>
+ </div>
+ <div class="textwenben" style="height: 70%; font-size: 80px; color: #65AAF6;">
+ <template v-if="configData.deviceType==='体重秤'">
+ <template v-if="patientInfo.isAfterMed===0">
+ <!-- 目标脱水量(L) -->
+ {{aimTSL}}
+ </template>
+ <template v-else> {{patientInfo.actuallyClliang}}</template>
+ <!-- 实际超滤量(L) -->
+
+ </template>
+ <template v-else>
+ <template v-if="patientInfo.isAfterMed===0">
+ <!-- 脉搏(次/分) -->
+ {{mai_bu}}
+ </template>
+ <template v-else>
+ <!-- 脉搏(次/分) -->
+ {{mai_bu}}
+ </template>
+
+ </template>
+ </div>
+ </el-col>
+ </el-row>
+ </div>
</el-col>
- <el-col :span="12" >
- <el-row>
- <el-col :span="24" style="text-align: right; line-height: 67px;padding-right: 0px; font-size: 40px;font-weight: 400;color: #EB6F1C;">
- <div v-if="!dialogVisible">{{clockNum}}S</div>
- <el-input v-else v-model="inputCode" ref="inputRef" id="inputCode" style="width: 200px; height: 40px;ime-mode:active" @change="inputChabge"
- placeholder="请输入患者卡号或扫描条码" />
- </el-col>
- </el-row>
+ <el-col :span="12">
+ <div ref="myChartRef1" class="echat" style="height: 48%;">
+
+ </div>
+ <div ref="myChartRef2" class="echat" style="height: 48%;margin-top: 2%;">
+ </div>
</el-col>
- </el-row>
- </div>
- <div class="rWrapp">
+ </el-row>
+
+ </div>
+ <!-- 内容 识别窗口页-->
+ <div style="height: 72%;" class="parentBody">
+ <div class="rWrapp" style="width: 800px;height: 500px;">
<video ref="video" id="myVideo" preload="preload" autoplay loop muted />
-
<canvas ref="canvas" width="{this.width}" height="{this.height}" />
-
- <div style="text-align: center; font-size: 2rem; color: bisque;margin-top: 1rem;">请将脸部对准摄像头</div>
</div>
- <div v-if="imgSrc" class="img_bg_camera" style="margin-top: 200px;">
- <p>效果预览</p>
- <img :src="imgSrc" class="tx_img" />
- </div>
- <div style="margin-top: 0px; z-index: -1;position:absolute;" >
-
- </div>
- <div class="footer" style="text-align: right;">
+ </div>
+ <div style="height: 18%;">
+ <el-row>
+ <el-col :span="6" style="padding-left: 40px; font-size: 34px; color: #FFFFFF;">
+ {{formatDate(new Date(),'HH:MM')}}
+ <br>
+ {{formatDate(new Date(),'YYYY-mm-dd')}}
+ </el-col>
+ <el-col :span="12" style="font-size: 40px;color: #FFFFFF;text-align: center; padding-top: 20px;">
+ 请将脸部对准摄像头
+ </el-col>
+ <el-col :span="6" style="font-size: 24px;color: #FFFFFF; text-align: right; padding-right: 20px; padding-top: 50px;">
+ <span @click="updateChengxu">
+ 版本号:{{getVersion}}
+ </span>
+ </el-col>
+ </el-row>
+ <div></div>
+ </div>
+
+ <div class="footer" style="text-align: right;">
<div class="fanhuikey" v-if="!dialogVisible" @click="fuxuan">
返回
</div>
</div>
- </div>
- <!-- <el-dialog title="提示" v-model="netLink" width="30%">
- <span>无法链接到网络!</span>
- </el-dialog> -->
+
+
</div>
</template>
<script setup lang="ts">
+
import * as echarts from 'echarts';
import { detectSingleFace, nets, matchDimensions, resizeResults, draw, SsdMobilenetv1Options, Box } from 'face-api.js'
import * as faceapi from 'face-api.js'
import { userInfoStore } from '@/stores/userInfo'
import { sockteStore } from '@/stores/sockteInfo'
-import { ipcRenderer } from 'electron'
+import { ipcRenderer } from 'electron'
import { patientInfoStore } from '@/stores/patient'
import { updatePatient,listWeightHistory,listBPHistory } from '@/api/user/index'
import os from "os"
@@ -238,6 +270,10 @@
import {initPort as mbp7000} from '@/samples/deviceApi/mbp7000'
import {initPort as M503} from '@/samples/deviceApi/M503'
import {initPort as seca102} from '@/samples/deviceApi/seca102'
+// 引入模块
+import config from '../../../package.json'
+
+
// 读取体重文件
import{todatatzs } from '@/samples/deviceApi/seca101'
import {ElMessage } from 'element-plus'
@@ -248,6 +284,7 @@
// 默认值:0.5
minConfidence: 0.5
})
+const getVersion=ref('ss')
const canvas = ref('canvas') // 图像画布
const video = ref('video') // 视频元素
const stream = ref(null) // 当前流
@@ -255,7 +292,9 @@
let lsDateTime:any=new Date()
let imgSrc:'';
const msg = ref<string>("没识别到人脸...");
-
+const datetext=computed(()=>{
+ return formatDate(new Date(),'YYYY-mm-dd WWW')
+})
let timer:any=new Date()
const date=ref('')
const timeShidaun=ref('')
@@ -400,7 +439,7 @@
}
const huatu=(series: { name: string; type: string; stack: string; data: any; }[],xAxis: any[],legendData:any[],textTitle:string)=>{
- const myChart = echarts.init(proxy.$refs.myChartRef);
+ const myChart = echarts.init(proxy.$refs.myChartRef1);
const option = {
title: {
text: textTitle,//'体重趋势图',
@@ -448,9 +487,57 @@
myChart.setOption(option);
}
+const huatu2=(series: { name: string; type: string; stack: string; data: any; }[],xAxis: any[],legendData:any[],textTitle:string)=>{
+ const myChart = echarts.init(proxy.$refs.myChartRef2);
+ const option = {
+ title: {
+ text: textTitle,//'体重趋势图',
+ borderRadius:5,
+ backgroundColor:"#409EFF",
+ left:20,
+ textStyle:{
+ color:'#ffffff',
+ fontSize:18
+ }
+ },
+ tooltip: {
+ trigger: 'axis',
+ },
+ legend: {
+ data:legendData //['透前体重', '透后体重', '干体重']
+ },
+ grid: {
+ left: '3%',
+ right: '4%',
+ bottom: '3%',
+ containLabel: true
+ },
+ toolbox: {
+ show: true,
+ feature: {
+ // restore: {}
+ }
+ },
+ xAxis: {
+ type: 'category',
+ boundaryGap: false,
+ data: xAxis
+ },
+ yAxis: {
+ type: 'value',
+ axisLabel: {
+ formatter: '{value}'
+ },
+ min:30,
+ minInterval:1,
+ },
+ series: series
+ };
+ myChart.setOption(option);
+
+}
// 体重趋势图
const intiTubiao=()=>{
- console.log('----------3333')
const xAxisData: any[]=[]
const series=[
{
@@ -475,7 +562,6 @@
data: []
},
]
- console.log(patientInfo.value)
listWeightHistory(`patientCode=${patientInfo.value.code}`).then(res=>{
console.log(res.data,'-----------------------')
if(res.data.length>0){
@@ -522,6 +608,7 @@
data: []
}
]
+ console.log('xueyasdsad')
listBPHistory(`patientCode=${patientInfo.value.code}`).then(res=>{
console.log(res.data,'--------sss---')
if(res.data.length>0){
@@ -533,7 +620,7 @@
series[3].data.push(e.透后舒张压)
})
const legendData=['透前伸缩压', '透前舒张压', '透后伸缩压','透后舒张压']
- huatu(series,xAxisData,legendData,'血压趋势图')
+ huatu2(series,xAxisData,legendData,'血压趋势图')
}
})
}
@@ -555,11 +642,8 @@
dialogVisible.value = false
speech.value?.speak({ text: str }).then(() => {
})
- if(configData.value.deviceType==='体重秤'){
- setTimeout(()=>{intiTubiao()},1000)
- }else{
- setTimeout(()=>{intiTubiaoXY()},1000)
- }
+ setTimeout(()=>{intiTubiao()},1000)
+ setTimeout(()=>{intiTubiaoXY()},1000)
sockteStore().setweightSockte({
@@ -593,6 +677,7 @@
// 没有排班
else if (patientInfo.value.isScheduled === 0) {
setTimeout(()=>{intiTubiao()},1000)
+ setTimeout(()=>{intiTubiaoXY()},1000)
settime()
ipcRenderer.invoke('logger', `患者没有排班:${patientInfo.value.name}`)
// console.log( `患者没有排班:${patientInfo.value.name}`)
@@ -824,11 +909,18 @@
ipcRenderer.send('winClose')
}
}
+const updateChengxu=()=>{
+ console.log('检查更新')
+ ipcRenderer.invoke("check-update");
+}
onMounted(() => {
- console.log(0%5)
console.log('页面初始化', os.hostname())
+ // 调用
+ getVersion.value=config.version
+ console.log("获得的版本号",config.version);
setTimeout(()=>{
console.log('8秒后执行')
+ updateChengxu()
console.log('打印设置文件')
console.log(configData.value)
is_ce_wen.value=configData.value.Is_ce_wen
@@ -1000,7 +1092,6 @@
}
if (navigator.mediaDevices.getUserMedia) {
// 最新的标准API
- console.log('sssdsdsd')
navigator.mediaDevices.getUserMedia(constraints).then(success).catch(error)
} else if (navigator.webkitGetUserMedia) {
// webkit核心浏览器
@@ -1044,14 +1135,58 @@
</script>
<style src="./index.css" />
<style lang="less" scoped>
-.wrapp {
- height: 100%;
- background-size: 100% 100%;
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: center;
- border-radius: 2px;
+ .titlecss{
+ border-left:1px solid #ffffff ;
+ padding-left: 20px;
+ // margin-bottom: 20px;
+ font-size: 40px;
+ font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
+ font-weight: 500;
+ color: #FFFFFF;
+ line-height: 48px;
+ height: 54px;
+ }
+ .textwenben{
+ display: grid;
+ place-items: center;
+ font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
+ font-weight: 500;
+ color: #FFFFFF;
+ }
+ .parentBody{
+ display: grid;
+ place-items: center;
+ }
+ .echat{
+ background-color: #FFFFFF;
+ border-radius: 12px;
+ padding-top: 1%;
+ }
+ .dateclas{
+ width: 404px;
+ height: 42px;
+ padding-left: 10px;
+ background: #FFFFFF;
+ color:#345683;
+ font-weight: 400;
+ // // text-align: center;
+ line-height: 42px;
+ box-shadow: 0px 2px 4px 0px rgba(112,163,221,0.5);
+ border-radius: 20px;
+ font-size: 30px;
+ }
+ .dateTimeclas{
+ height: 42px;
+ text-align: center;
+ width: 120px;
+ line-height: 42px;
+ background: #65AAF6;
+ box-shadow: 2px 2px 4px 0px rgba(112,163,221,0.5);
+ border-radius: 16px;
+ font-size: 30px;
+ color: #FFFFFF;
+ }
+
.rWrapp {
display: flex;
flex-direction: column;
@@ -1074,18 +1209,7 @@
border-radius: 20px;
}
}
- .status {
- //margin-top: 100px;
- text-align: center;
- }
- .img_bg_camera{
- position: absolute;
- top: -500px;
-
- z-index: -999;
- }
-}
-.footer{
+ .footer{
height: 100px;
width: 100%;
line-height: 100px;
@@ -1095,16 +1219,6 @@
position: fixed;
bottom: 20px;
text-align: right;
-}
-.toupu{
- height: 100px;
- width: 100%;
- line-height: 100px;
- font-size: 2rem;
- color: beige;
- // background-color: #ddd;
- position: fixed;
- top: 10px;
}
.fanhuikey{
text-align: center;
@@ -1119,6 +1233,20 @@
position: fixed;
right: 0;
}
- :v-deep .el-input__inner {background-color: transparent !important;}
-</style>
-
+::v-deep .el-input__wrapper {
+ background-color: transparent !important;
+ color: #ffffff;
+}
+//提示框的字体颜色
+::v-deep input::-webkit-input-placeholder {
+ color: #fff;
+}
+::v-deep input::-moz-input-placeholder {
+ color: #fff;
+}
+::v-deep input::-ms-input-placeholder {
+ color: #fff;
+}
+ </style>
+
+
\ No newline at end of file
diff --git a/src/views/home/index2.vue b/src/views/home/index2.vue
new file mode 100644
index 0000000..0aa8411
--- /dev/null
+++ b/src/views/home/index2.vue
@@ -0,0 +1,186 @@
+<template>
+ <div class="homeclass">
+ <div style="height: 12%;padding-top: 20px;">
+ <el-row>
+ <el-col :span="12" >
+ <div style="display: grid;grid-template-columns: minmax(160px, 25%) 1fr;">
+ <div style="margin-top: 5px;">
+ <img class="image_1" style="width: 159px;height: 62px; margin-left: 20px;display: inline-block;" referrerpolicy="no-referrer" src="@/assets/logo.png" />
+
+ </div>
+ <div class="titlecss">自助签到系统</div>
+ </div>
+ </el-col>
+ <el-col v-if="dialogVisible" :span="12" style="text-align: right;padding-top: 10px;">
+ <el-input ref="inputRef" id="inputCode" style="width: 400px; height: 40px;ime-mode:active;margin-right: 20px;"
+ placeholder="请输入患者卡号或扫描条码" />
+
+
+ </el-col>
+ <el-col v-else :span="12">
+
+ <div class="dateclas" style="float: right;margin-top: 20px;">
+ <div class="dateTimeclas" style="float: right;">07:22</div>
+ 2014-09-23
+ </div>
+
+ </el-col>
+ </el-row>
+ </div>
+ <template v-if="dialogVisible">
+ <div style="height: 72%;" class="parentBody">
+ <div style="width: 800px;height: 500px;background-color: aqua;"></div>
+ </div>
+ <div style="height: 18%;">
+ <el-row>
+ <el-col :span="6" style="padding-left: 40px; font-size: 34px; color: #FFFFFF;">
+ 16:00
+ <br>
+ 2023-06-05
+ </el-col>
+ <el-col :span="12" style="font-size: 40px;color: #FFFFFF;text-align: center; padding-top: 20px;">
+ 请将脸部对准摄像头
+ </el-col>
+ <el-col :span="6"></el-col>
+ </el-row>
+ <div></div>
+ </div>
+ </template>
+ <template v-else>
+ <div style="height: 84%;">
+ <el-row style="height: 100%; " gutter="20">
+ <el-col :span="12" >
+ <div style="height: 66%; background:rgba(246, 244, 244, 0.3);border-radius: 12px;opacity: 0.9;" >
+ <div style="height: 15%; border-bottom: 4px solid #EDF5FF; text-align: right; padding-right: 20px; font-size: 30px; line-height: 90px;color: #0d44dc;font-weight: 500;font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;">
+ 透前称重(kg)
+ </div>
+ <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(${anv})`}" style="background-size:100% 100%;height: 100%;">
+
+ </div>
+ <div style="display: grid;place-items: center;font-size: 120px;font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;font-weight: 500;color: #65AAF6;">
+ 112/233
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div style="height: 31%; margin-top: 20px;border-radius: 12px;" >
+ <el-row style="height: 100%;background:rgba(246, 244, 244, 0.3);border-radius: 12px;opacity: 0.9;">
+ <el-col :span="8">
+ <div class="textwenben" style="height: 28%; font-size: 25px;background-color: #DFB144; border-radius: 12px 0 0 0;">
+ 机号/床位好
+ </div>
+ <div class="textwenben" style="height: 70%; font-size: 80px; color: #DFB144;">
+ 28床
+ </div>
+ </el-col>
+ <el-col :span="8">
+ <div class="textwenben" style="height: 28%; font-size: 25px;background-color: #41B593; ">
+ 上次透后血压(mmgh)
+ </div>
+ <div class="textwenben" style="height: 70%; font-size: 80px; color: #41B593;
+ border-left: #FFFFFF solid 2px;border-right: #FFFFFF solid 2px;">
+ 28床
+ </div>
+ </el-col>
+ <el-col :span="8">
+ <div class="textwenben" style="height: 28%; font-size: 25px;background-color: #65AAF6;border-radius: 0 12px 0 0 ">
+ 脉搏(次/分)
+ </div>
+ <div class="textwenben" style="height: 70%; font-size: 80px; color: #65AAF6;">
+ 28床
+ </div>
+ </el-col>
+ </el-row>
+ </div>
+ </el-col>
+ <el-col :span="12">
+ <div ref="myChartRef" class="echat" style="height: 49%;">
+
+ </div>
+ <div ref="myChartRef" class="echat" style="height: 48%;margin-top: 2%;">
+ </div>
+ </el-col>
+ </el-row>
+
+ </div>
+ </template>
+
+
+ </div>
+ </template>
+ <script setup lang="ts">
+import { ref } from 'vue';
+
+ const dialogVisible=ref(false)
+ const anv=ref('http://dhimg.leon056.com/hemodialysis/face/PAT9326175252362sKFe/face-1701040731610.jpg-202311270719101645.jpg')
+ </script>
+ <style src="./index.css" />
+ <style lang="less" scoped>
+ .titlecss{
+ border-left:1px solid #ffffff ;
+ padding-left: 20px;
+ // margin-bottom: 20px;
+ font-size: 40px;
+ font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
+ font-weight: 500;
+ color: #FFFFFF;
+ line-height: 48px;
+ height: 54px;
+ }
+ .textwenben{
+ display: grid;
+ place-items: center;
+ font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
+ font-weight: 500;
+ color: #FFFFFF;
+ }
+ .parentBody{
+ display: grid;
+ place-items: center;
+ }
+ .echat{
+ background-color: #FFFFFF;
+ border-radius: 12px;
+ }
+ .dateclas{
+ width: 334px;
+ height: 42px;
+ background: #FFFFFF;
+ // // text-align: center;
+ line-height: 42px;
+ box-shadow: 0px 2px 4px 0px rgba(112,163,221,0.5);
+ border-radius: 20px;
+ font-size: 30px;
+ }
+ .dateTimeclas{
+ height: 42px;
+ text-align: center;
+ width: 120px;
+ line-height: 42px;
+ background: #65AAF6;
+ box-shadow: 2px 2px 4px 0px rgba(112,163,221,0.5);
+ border-radius: 16px;
+ font-size: 30px;
+ color: #FFFFFF;
+ }
+::v-deep .el-input__wrapper {
+ background-color: transparent !important;
+ color: #ffffff;
+}
+//提示框的字体颜色
+::v-deep input::-webkit-input-placeholder {
+ color: #fff;
+}
+::v-deep input::-moz-input-placeholder {
+ color: #fff;
+}
+::v-deep input::-ms-input-placeholder {
+ color: #fff;
+}
+ </style>
+
+
\ No newline at end of file
--
Gitblit v1.8.0