| | |
| | | import { app, BrowserWindow, shell, ipcMain,Menu } 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' |
| | |
| | | const url = `http://${process.env['VITE_DEV_SERVER_HOST']}:${process.env['VITE_DEV_SERVER_PORT']}` |
| | | |
| | | async function createWindow() { |
| | | |
| | | win = new BrowserWindow({ |
| | | title: 'Main window', |
| | | fullscreen: true,// 开启默认全屏 |
| | | // autoHideMenuBar:true, //关闭菜单栏 |
| | | autoHideMenuBar:store.get('debug'), //关闭菜单栏 |
| | | webPreferences: { |
| | | preload: splash, |
| | | nodeIntegration: true, |
| | | contextIsolation: false, |
| | | }, |
| | | }) |
| | | |
| | | if (app.isPackaged) { |
| | | win.loadFile(join(__dirname, '../../index.html')) |
| | | } else { |
| | |
| | | if (process.platform !== 'darwin') app.quit() |
| | | }) |
| | | |
| | | |
| | | app.on('second-instance', () => { |
| | | if (win) { |
| | | // 如果用户试图打开另一个窗口,则将焦点放在主窗口上 |
| | |
| | | createWindow() |
| | | } |
| | | }) |
| | | // 自动更新 |
| | | // app.on('ready', async () => { |
| | | // updater() |
| | | // }) |
| | | |
| | | // 新窗口示例arg:新的Windows url |
| | | ipcMain.handle("open-win", (event, arg) => { |
| New file |
| | |
| | | import { autoUpdater } from "electron-updater" |
| | | |
| | | import {dialog, BrowserWindow} from 'electron' |
| | | |
| | | import log from 'electron-log' |
| | | autoUpdater.logger = log |
| | | autoUpdater.logger.transports.file.level = "info" |
| | | const path = require('path') |
| | | const isDevelopment = process.env.NODE_ENV === 'development' |
| | | |
| | | // 防止报错no such file or directory dev-app-update.yml |
| | | if (isDevelopment) { |
| | | autoUpdater.updateConfigPath = path.join(__dirname, '../dev-app-update.yml') |
| | | } |
| | | export default () => { |
| | | let win = null |
| | | //设置自动下载 |
| | | autoUpdater.autoDownload = false |
| | | // 检测是否有新版本 |
| | | autoUpdater.checkForUpdates() |
| | | autoUpdater.on('checking-for-update', res => { |
| | | log.info("获取版本信息:" + res) |
| | | }) |
| | | autoUpdater.on('update-not-available', res => { |
| | | log.info("没有可更新版本:" + res) |
| | | }) |
| | | autoUpdater.on('update-available', res => { |
| | | dialog.showMessageBox({ |
| | | type: 'info', |
| | | title: '软件更新', |
| | | message: '发现新版本, 确定更新?', |
| | | buttons: ['确定', '取消'] |
| | | }).then(resp => { |
| | | if (resp.response == 0) { |
| | | createWindow() |
| | | autoUpdater.downloadUpdate() |
| | | } |
| | | }) |
| | | }) |
| | | async function createWindow() { |
| | | win = new BrowserWindow({ |
| | | width: 300, |
| | | height: 300, |
| | | title: "七鹊", |
| | | frame: false, |
| | | transparent: true, |
| | | maximizable: false, |
| | | webPreferences: { |
| | | nodeIntegration: true, |
| | | contextIsolation: false, |
| | | enableRemoteModule: true |
| | | }, |
| | | }) |
| | | if (process.env.WEBPACK_DEV_SERVER_URL) { |
| | | await win.loadURL(process.env.WEBPACK_DEV_SERVER_URL + '#/update') |
| | | } else { |
| | | win.loadURL('app://./index.html#/update') |
| | | } |
| | | } |
| | | autoUpdater.on('download-progress', res => { |
| | | log.info("下载监听:" + res) |
| | | win.webContents.send('downloadProgress', res) |
| | | }) |
| | | |
| | | autoUpdater.on('update-downloaded', () => { |
| | | dialog.showMessageBox({ |
| | | title: '下载完成', |
| | | message: '最新版本已下载完成, 退出程序进行安装' |
| | | }).then(() => { |
| | | autoUpdater.quitAndInstall() |
| | | }) |
| | | }) |
| | | } |
| | |
| | | window.onmessage = ev => { |
| | | ev.data.payload === 'removeLoading' && removeLoading() |
| | | } |
| | | setTimeout(removeLoading, 4999) |
| | | setTimeout(removeLoading, 6999) |
| | | |
| | |
| | | { |
| | | "name": "sign-tool", |
| | | "version": "2.6.3", |
| | | "version": "2.6.5", |
| | | "icon": "public/favicon.ico", |
| | | "main": "dist/electron/main/index.js", |
| | | "author": "", |
| | |
| | | "dev": "vite", |
| | | "build": "vite build && electron-builder" |
| | | }, |
| | | "publish": [ |
| | | { |
| | | "provider": "generic", |
| | | "url": "http://dhcdn.leon056.com/upgrade/icoldchain" |
| | | } |
| | | ], |
| | | "engines": { |
| | | "node": ">=14.17.0" |
| | | }, |
| | |
| | | "axios": "^0.27.2", |
| | | "electron-log": "^4.4.8", |
| | | "electron-store": "^8.0.2", |
| | | "electron-updater": "^6.1.1", |
| | | "element-plus": "^2.2.6", |
| | | "iconv-lite": "^0.6.3", |
| | | "internet-available": "^1.0.0", |
| | |
| | | }) |
| | | // 主进程获取配置项完成sockte注册和httpshu |
| | | ipcRenderer.on('getConfigData',(_event,...args)=>{ |
| | | console.log('----------------') |
| | | console.log("config.json",...args) |
| | | if(args!==null){ |
| | | if(args[0]===undefined){ |
| | |
| | | else if(args.length>0&&args[0].clientCode.length>0){ |
| | | console.log('配置文件读取') |
| | | clientCode=args[0].clientCode |
| | | // 建立sockte 通讯 |
| | | deviceList=args[0].deviceList |
| | | // 存放conging到仓库 |
| | | confingInfoStore().setconfingInfo(args[0]) |
| | | // connect() |
| | | // creatorClient(args[0]) |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | import Stomp from 'stompjs' |
| | | import os from 'os' |
| | | import { ipcRenderer } from 'electron' |
| | | let stompClient: Stomp.Client | null=null |
| | | |
| | | import { confingInfoStore } from '@/stores/StoresConfing' |
| | |
| | | // 创建客户端链接 |
| | | const creatorClient=(configObj:any)=>{ |
| | | config=configObj |
| | | devices=configObj.deviceList |
| | | // devices=configObj.deviceList |
| | | clientCode=configObj.clientCode |
| | | console.log(devices,'设备列表','chong') |
| | | const socket = new WebSocket('ws://hemobs.icoldchain.cn/broadcast') |
| | |
| | | face_score:0.55, |
| | | timeJg:10000, |
| | | base_api:"", |
| | | face_push:3, |
| | | |
| | | }) |
| | | /** |
| | |
| | | import axios, {AxiosError, AxiosResponse} from 'axios' |
| | | import { Session } from '@/utils/storage' |
| | | import { ElMessage } from 'element-plus' |
| | | |
| | | import { confingInfoStore } from '@/stores/StoresConfing' |
| | | |
| | | |
| | | // const BASE_URL = 'https://hemobs.icoldchain.cn' |
| | | const BASE_URL = confingInfoStore().confingInfo.base_api |
| | | let BASE_URL = 'https://hemobs.icoldchain.cn' |
| | | const TIME_OUT = 10 * 1000 |
| | | |
| | | setTimeout(()=>{ |
| | | console.log('重新赋值api',confingInfoStore().confingInfo) |
| | | BASE_URL=confingInfoStore().confingInfo.base_api |
| | | },10000) |
| | | /** |
| | | * 创建axios实例 |
| | | */ |
| | |
| | | </div> |
| | | <div style="height: 75%;"> |
| | | <div style="background: rgba(243, 247, 243, 0.3); height: 100%; width: 100%; font-size: 1.3rem; font-weight: 800; color: #FFFFFF;"> |
| | | <div class="textjuzhong" style="height: 25%; width: 100%;">干体重 {{patientInfo.preWeight}} kg</div> |
| | | <div class="textjuzhong" style="height: 25%; width: 100%;">干体重 {{patientInfo.pureWeight}} kg</div> |
| | | <div class="textjuzhong" style="height: 25%; width: 100%;">透析器 {{patientInfo.txq}}</div> |
| | | <div class="textjuzhong" style="height: 25%; width: 100%;">治疗模式 {{patientInfo.medMethod}}</div> |
| | | <div class="textjuzhong" style="height: 25%; width: 100%;">灌流器 {{patientInfo.glq}}</div> |
| | |
| | | <div class="footer" style="text-align: right;"> |
| | | <div class="fanhuikey" v-if="!dialogVisible" @click="fuxuan"> |
| | | 返回 |
| | | <!-- <el-button type="primary" :icon="RefreshRight" circle /> --> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | import os from "os" |
| | | import Speech from 'speak-tts' |
| | | import { reactive,computed, toRefs, onMounted, watch, ref } from "vue" |
| | | import { RefreshRight } from '@element-plus/icons-vue' |
| | | import { sendPationCodeApi } from '../../samples/httpApi' |
| | | import { formatDate } from '@/utils/formatTime' |
| | | import { confingInfoStore } from '@/stores/StoresConfing' |
| | | import {base64toFile} from '@/samples/faceApi' |
| | | import { ElMessage } from 'element-plus' |
| | | import { ElLoading, ElMessage } from 'element-plus' |
| | | let trackerTask: any = null; |
| | | // 标识用的画布 |
| | | const myCanvas = ref<HTMLCanvasElement | null>(null); |
| | |
| | | base64toFile(imgSrc) |
| | | } |
| | | setTimeout(() => { |
| | | console.log('监测到人脸后3s') |
| | | console.log(configData.value.face_push+'秒跑一次人脸识别') |
| | | trackerTask.run(); |
| | | }, 3000); |
| | | }, configData.value.face_push*1000); |
| | | // @ts-ignore |
| | | if (typeof window.stream === "object") { |
| | | myVideo.srcObject = null; |
| | |
| | | } |
| | | else { |
| | | clearInterval(timer) |
| | | clockNum.value = patientInfoStore().viewNumber |
| | | patientInfoStore().setpatientInfo({ |
| | | id: 0, |
| | | code: '', |
| | |
| | | }) |
| | | sockteStore().setxyjSockte({ |
| | | type: '血压计', |
| | | deviceName: '', |
| | | result: '', |
| | | resultTime: '', |
| | | state: 2 |
| | | }) |
| | | sockteStore().setfaceSockte({ |
| | | type: '人脸识别', |
| | | deviceName: '', |
| | | result: '', |
| | | resultTime: '', |
| | |
| | | onMounted(() => { |
| | | console.log('页面初始化', os.hostname()) |
| | | setTimeout(()=>{ |
| | | console.log('3秒后执行') |
| | | console.log('5秒后执行') |
| | | console.log('打印设置文件') |
| | | console.log(configData.value) |
| | | // 是否开启脸识别 |
| | |
| | | speech.value?.init().then(() => { |
| | | console.log('语音初始化成功') |
| | | }) |
| | | },3000) |
| | | },8000) |
| | | }) |
| | | |
| | | |