From efb29dd72dfb4349869d0e7459490309ab47a2c1 Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期二, 27 九月 2022 11:26:57 +0800
Subject: [PATCH] 679
---
src/views/home/index.vue | 9 ++++++---
src/samples/sockteStomp.ts | 5 ++---
src/samples/node-api.ts | 6 ++----
electron/main/index.ts | 7 ++-----
src/stores/sockteInfo.ts | 2 +-
5 files changed, 13 insertions(+), 16 deletions(-)
diff --git a/electron/main/index.ts b/electron/main/index.ts
index d4ac784..21420db 100644
--- a/electron/main/index.ts
+++ b/electron/main/index.ts
@@ -7,7 +7,6 @@
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();
@@ -26,7 +25,6 @@
"data": body,
"message": "接收成功"
}
- // writeResult(body)
})
app.use(router.routes());
@@ -89,7 +87,7 @@
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
@@ -151,7 +149,6 @@
"clientCode": arg.clientCode,
"machineName": arg.machineName,
"screenTimeout": arg.screenTimeout,
- "devices":arg.devices
}
//对比两端配置文件
if(JSON.stringify(mode1)!=JSON.stringify(mode2)){
@@ -161,7 +158,7 @@
// 重新建立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)
}
diff --git a/src/samples/node-api.ts b/src/samples/node-api.ts
index 51059bd..27f6b5a 100644
--- a/src/samples/node-api.ts
+++ b/src/samples/node-api.ts
@@ -48,8 +48,7 @@
const mode={
clientCode:value,
machineName:os.hostname(),
- screenTimeout: 300,
- devices:[]
+ screenTimeout: 60,
}
ipcRenderer.send('setConfingData',mode)
})
@@ -57,9 +56,8 @@
}
else if(args.length>0&&args[0].length>0){
clientCode=args[0]
- deviceList=args[1]
// 建立sockte 通讯
- creatorClient(deviceList,clientCode)
+ creatorClient([],clientCode)
}
})
diff --git a/src/samples/sockteStomp.ts b/src/samples/sockteStomp.ts
index cb57715..eba1a11 100644
--- a/src/samples/sockteStomp.ts
+++ b/src/samples/sockteStomp.ts
@@ -151,7 +151,6 @@
}
const PatientCallback=function(message:any){
if (message.body) {
- console.log('00000000000000',message.body)
const data=JSON.parse(message.body)
console.log(data,'患者信息读取')
writePatient(data)
@@ -178,9 +177,9 @@
// 订阅患者信息事件
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链接状态
diff --git a/src/stores/sockteInfo.ts b/src/stores/sockteInfo.ts
index 0948389..19431f9 100644
--- a/src/stores/sockteInfo.ts
+++ b/src/stores/sockteInfo.ts
@@ -32,7 +32,7 @@
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结果
diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index d8a0e30..21f03fb 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -31,7 +31,7 @@
const AudioRef4=ref()
const AudioRef5=ref()
const isLink = computed(() => {
- return !sockte.isLink
+ return sockte.isLink
})
const netLink = computed(() => {
return !sockte.netLink
@@ -164,7 +164,7 @@
// AudioRef2.value.play()
if (patientInfo.value.id === 0) {
AudioRef0.value.play()
- inputRef.value.focus();
+ // inputRef.value.focus();
}
else {
@@ -197,7 +197,7 @@
}
if (patientInfo.value.id === 0) {
AudioRef0.value.play()
- inputRef.value.focus();
+ // inputRef.value.focus();
settime()
} else {
AudioRef3.value.play()
@@ -253,7 +253,10 @@
state.clockNum = patientInfoStore().viewNumber
setInterval(function () {
+ if(isLink.value){
+ // console.log('sockte链接成功指标指向input',isLink.value)
inputRef.value.focus();
+ }
}, 1000)
})
--
Gitblit v1.8.0