679
chenyc
2022-09-27 efb29dd72dfb4349869d0e7459490309ab47a2c1
679
5个文件已修改
29 ■■■■■ 已修改文件
electron/main/index.ts 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/samples/node-api.ts 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/samples/sockteStomp.ts 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/stores/sockteInfo.ts 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/home/index.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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)
  }
  
  
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)
  }
})
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链接状态
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结果
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)
            
        })