| | |
| | | async function createWindow() { |
| | | win = new BrowserWindow({ |
| | | title: 'Main window', |
| | | fullscreen: true, |
| | | webPreferences: { |
| | | preload: splash, |
| | | nodeIntegration: true, |
| | |
| | | // Test active push message to Renderer-process |
| | | // 测试推送消息到Renderer进程 |
| | | win.webContents.on('did-finish-load', () => { |
| | | win?.webContents.send('main-process-message', new Date().toLocaleString()) |
| | | win?.webContents.send('getConfigData',store.get('clientCode'),store.get('devices'),store.path) |
| | | // win?.webContents.send('main-process-message', new Date().toLocaleString()) |
| | | win?.webContents.send('getScreenTimeout',store.get('screenTimeout')) |
| | | win?.webContents.send('getPcName',store.get('machineName')) |
| | | win?.webContents.send('getConfigData',store.get('clientCode'),store.get('devices'),store.path) |
| | | }) |
| | | |
| | | // Make all links open with the browser, not with the application |
| | |
| | | console.log('update confing.json') |
| | | store.set(mode2) |
| | | // 重新建立sockte 通讯 |
| | | win?.webContents.send('getConfigData',store.get('clientCode'),store.get('devices'),store.path) |
| | | win?.webContents.send('getScreenTimeout',store.get('screenTimeout')) |
| | | win?.webContents.send('getPcName',store.get('machineName')) |
| | | win?.webContents.send('getConfigData',store.get('clientCode'),store.get('devices'),store.path) |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | }) |
| | | ipcRenderer.on("getScreenTimeout",(_event,args)=>{ |
| | | console.log(args,'得到配置文件时间') |
| | | patientInfoStore().setViewNumber(args) |
| | | if(args!==undefined){ |
| | | patientInfoStore().setViewNumber(args) |
| | | } |
| | | }) |
| | | ipcRenderer.on("getPcName",(_event,arg)=>{ |
| | | if(arg!==undefined){ |
| | | sockteStore().setPcName(arg) |
| | | } |
| | | }) |
| | | setInterval(function(){ |
| | | // 检查网络状态 |
| | |
| | | sockteStore().setweightState(resultInfo.status) |
| | | break |
| | | case "血压计": |
| | | sockteStore().setxyjSockte( |
| | | { |
| | | deviceName:resultInfo.deviceName, |
| | | type:"血压计", |
| | | result:resultInfo.result, |
| | | resultTime:resultInfo.resultTime, |
| | | state:0 |
| | | } |
| | | ) |
| | | sockteStore().setXtjState(resultInfo.status) |
| | | break |
| | | default: |
| | | console.log('有配置类型没有匹配') |
| | |
| | | } |
| | | } |
| | | const connectCallback=function(){ |
| | | const pcName= os.hostname() |
| | | const pcName= sockteStore().pcName |
| | | // 订阅患者信息服务 |
| | | if(stompClient!==null){ |
| | | // 订阅患者信息事件 |
| | | stompClient.subscribe(`/queue/patient/info/${pcName}`,PatientCallback) |
| | | // 订阅配置文件事件 |
| | | stompClient.subscribe(`/queue/workstation/config/set/${clientCode}/${pcName}`,configCallback) |
| | | // 发送配置文件到服务端 |
| | | stompClient.send(`/app/workstation/config/set/${clientCode}/${pcName}`,{},JSON.stringify({"clientCode":clientCode,"machineName":pcName})) |
| | | |
| | | } |
| | |
| | | devices.forEach(de=>{ |
| | | if(stompClient!==null){ |
| | | stompClient.subscribe(`/queue/${clientCode}/${de.deviceName}/result`,callback) |
| | | // /queue/{clientCode}/{deviceName}/keepalive |
| | | // stompClient.subscribe(`/queue/${clientCode}/${de.deviceName}/keepalive`,callbackState) |
| | | stompClient.subscribe(`/queue/${clientCode}/${de.deviceName}/keepalive`,callbackState) |
| | | stompClient.send(`/app/device/request/${clientCode}/${de.deviceName}`, {}, JSON.stringify({"deviceNumber":de.deviceName})); |
| | | |
| | | } |
| | |
| | | * @param codeStr |
| | | */ |
| | | const sendPationCode=(codeStr:string)=>{ |
| | | const pcName= sockteStore().pcName |
| | | const mode={ |
| | | clientCode:clientCode, |
| | | queryCode:codeStr |
| | | } |
| | | if(stompClient!==null){ |
| | | stompClient.send(`/app/patient/info/get/${os.hostname()}`,{},JSON.stringify(mode)) |
| | | stompClient.send(`/app/patient/info/get/${pcName}`,{},JSON.stringify(mode)) |
| | | } |
| | | } |
| | | /** |
| | |
| | | export const sockteStore =defineStore('sockteInfo',()=>{ |
| | | const isLink=ref(true) // sockte 链接状态 |
| | | const netLink=ref(true) // 网络链接状态 |
| | | const pcName=ref('') |
| | | const weightSockte=ref(weightInfo) // 体重秤sockte结果 |
| | | const xyjSockte=ref(xyjInfo) // 血压计sockte结果 |
| | | const dkqSockte=ref(dkqInfo) // 读卡器sockte结果 |
| | |
| | | xyjSockte.value.resultTime=info.resultTime |
| | | weightSockte.value.state=info.state |
| | | } |
| | | function setXtjState(state:any){ |
| | | xyjSockte.value.state=state |
| | | } |
| | | /** |
| | | * 更新血压计结果 |
| | | * @param info 体重结果 |
| | |
| | | dkqSockte.value.result=info.result |
| | | dkqSockte.value.resultTime=info.resultTime |
| | | } |
| | | function setPcName(name:any){ |
| | | pcName.value=name |
| | | } |
| | | |
| | | return {isLink,netLink,weightSockte,xyjSockte,dkqSockte,setsockteIsLink,setnetLink,setweightSockte, |
| | | setweightState, |
| | | return {isLink,netLink,weightSockte,xyjSockte,dkqSockte,pcName,setsockteIsLink,setnetLink,setweightSockte, |
| | | setweightState,setPcName,setXtjState, |
| | | setxyjSockte,setdkqSockte} |
| | | }) |
| | |
| | | import { userInfoStore } from '@/stores/userInfo' |
| | | import { sockteStore } from '@/stores/sockteInfo' |
| | | import { patientInfoStore } from '@/stores/patient' |
| | | import { ipcRenderer } from 'electron' |
| | | import os from "os" |
| | | import { reactive,computed, toRefs,onMounted ,ref,watch} from "vue" |
| | | import{sendPationCode,sendPationSet} from '../../samples/sockteStomp' |
| | | import {formatDate} from '@/utils/formatTime' |
| | | |
| | | export default { |
| | | setup() { |
| | | let timer:any=0 |
| | |
| | | state.Newdate=formatDate(new Date(),"YYYY-mm-dd HH:MM:SS") |
| | | },1000) |
| | | }) |
| | | return{ ...toRefs(state),isLink,netLink,weightInfo,patientInfo,inputRef,AudioRef0,AudioRef,AudioRef2,AudioRef3,inputChabge |
| | | return{ ...toRefs(state),isLink,netLink,weightInfo,patientInfo,xyjInfo,inputRef,AudioRef0,AudioRef,AudioRef2,AudioRef3,inputChabge |
| | | } |
| | | } |
| | | } |
| | |
| | | <div class="conText">{{aimTSL}}</div> |
| | | </div> |
| | | <div class="grid-item"> |
| | | <div class="lableText">血压:</div> |
| | | <div class="lableText" v-if="xyjInfo.state===2">血压:</div> |
| | | <div class="lableText" v-if="xyjInfo.state===1" style="color:red">血压通讯服务正常运行但未联通设备</div> |
| | | <div class="lableText" v-if="xyjInfo.state===0" style="color:red">血压通讯服务不正常 </div> |
| | | <div class="conText">{{gao_ya}}/{{di_ya}}</div> |
| | | </div> |
| | | </div> |