| | |
| | | import Koa from 'koa'; |
| | | import Router from 'koa-router'; |
| | | const koaBody = require('koa-body'); |
| | | |
| | | const creatorKoa=(win)=>{ |
| | | const app = new Koa(); |
| | | const router = new Router(); |
| | |
| | | "data": body, |
| | | "message": "接收成功" |
| | | } |
| | | // writeResult(body) |
| | | }) |
| | | |
| | | app.use(router.routes()); |
| | |
| | | win?.webContents.send('message-koa','nihao0-----') |
| | | 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) |
| | | win?.webContents.send('getConfigData',store.get('clientCode'),store.path) |
| | | }) |
| | | |
| | | // Make all links open with the browser, not with the application |
| | |
| | | "clientCode": arg.clientCode, |
| | | "machineName": arg.machineName, |
| | | "screenTimeout": arg.screenTimeout, |
| | | "devices":arg.devices |
| | | } |
| | | //对比两端配置文件 |
| | | if(JSON.stringify(mode1)!=JSON.stringify(mode2)){ |
| | |
| | | // 重新建立sockte 通讯 |
| | | 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) |
| | | win?.webContents.send('getConfigData',store.get('clientCode'),store.path) |
| | | } |
| | | |
| | | |
| | |
| | | const mode={ |
| | | clientCode:value, |
| | | machineName:os.hostname(), |
| | | screenTimeout: 300, |
| | | devices:[] |
| | | screenTimeout: 60, |
| | | } |
| | | ipcRenderer.send('setConfingData',mode) |
| | | }) |
| | |
| | | } |
| | | else if(args.length>0&&args[0].length>0){ |
| | | clientCode=args[0] |
| | | deviceList=args[1] |
| | | // 建立sockte 通讯 |
| | | creatorClient(deviceList,clientCode) |
| | | creatorClient([],clientCode) |
| | | |
| | | } |
| | | }) |
| | |
| | | } |
| | | const PatientCallback=function(message:any){ |
| | | if (message.body) { |
| | | console.log('00000000000000',message.body) |
| | | const data=JSON.parse(message.body) |
| | | console.log(data,'患者信息读取') |
| | | writePatient(data) |
| | |
| | | // 订阅患者信息事件 |
| | | stompClient.subscribe(`/queue/patient/info/${pcName}`,PatientCallback) |
| | | // 订阅配置文件事件 |
| | | stompClient.subscribe(`/queue/workstation/config/set/${clientCode}/${pcName}`,configCallback) |
| | | // stompClient.subscribe(`/queue/workstation/config/set/${clientCode}/${pcName}`,configCallback) |
| | | // 发送配置文件到服务端 |
| | | stompClient.send(`/app/workstation/config/set/${clientCode}/${pcName}`,{},JSON.stringify({"clientCode":clientCode,"machineName":pcName})) |
| | | // stompClient.send(`/app/workstation/config/set/${clientCode}/${pcName}`,{},JSON.stringify({"clientCode":clientCode,"machineName":pcName})) |
| | | |
| | | } |
| | | // 更新sockte链接状态 |
| | |
| | | resultTime:"" |
| | | } |
| | | export const sockteStore =defineStore('sockteInfo',()=>{ |
| | | const isLink=ref(true) // sockte 链接状态 |
| | | const isLink=ref(false) // sockte 链接状态 |
| | | const netLink=ref(true) // 网络链接状态 |
| | | const pcName=ref('') |
| | | const weightSockte=ref(weightInfo) // 体重秤sockte结果 |
| | |
| | | const AudioRef4=ref() |
| | | const AudioRef5=ref() |
| | | const isLink = computed(() => { |
| | | return !sockte.isLink |
| | | return sockte.isLink |
| | | }) |
| | | const netLink = computed(() => { |
| | | return !sockte.netLink |
| | |
| | | // AudioRef2.value.play() |
| | | if (patientInfo.value.id === 0) { |
| | | AudioRef0.value.play() |
| | | inputRef.value.focus(); |
| | | // inputRef.value.focus(); |
| | | |
| | | } |
| | | else { |
| | |
| | | } |
| | | if (patientInfo.value.id === 0) { |
| | | AudioRef0.value.play() |
| | | inputRef.value.focus(); |
| | | // inputRef.value.focus(); |
| | | settime() |
| | | } else { |
| | | AudioRef3.value.play() |
| | |
| | | |
| | | state.clockNum = patientInfoStore().viewNumber |
| | | setInterval(function () { |
| | | if(isLink.value){ |
| | | // console.log('sockte链接成功指标指向input',isLink.value) |
| | | inputRef.value.focus(); |
| | | } |
| | | }, 1000) |
| | | |
| | | }) |