| | |
| | | creatorKoa(win) |
| | | win?.webContents.send('getScreenTimeout',store.get('screenTimeout')) |
| | | win?.webContents.send('getPcName',store.get('machineName')) |
| | | win?.webContents.send('getConfigData',store.get('clientCode'),store.path) |
| | | win?.webContents.send('getConfigData',store.get(),store.path) |
| | | }) |
| | | |
| | | // Make all links open with the browser, not with the application |
| | |
| | | "machineName": arg.machineName, |
| | | "screenTimeout": arg.screenTimeout, |
| | | } |
| | | //对比两端配置文件 |
| | | if(JSON.stringify(mode1)!=JSON.stringify(mode2)){ |
| | | //更新cofing.json |
| | | console.log('update confing.json') |
| | | store.set(mode2) |
| | | // 重新建立sockte 通讯 |
| | | win?.webContents.send('getScreenTimeout',store.get('screenTimeout')) |
| | | win?.webContents.send('getPcName',store.get('machineName')) |
| | | win?.webContents.send('getConfigData',store.get('clientCode'),store.path) |
| | | } |
| | | // //对比两端配置文件 |
| | | // if(JSON.stringify(mode1)!=JSON.stringify(mode2)){ |
| | | // //更新cofing.json |
| | | // console.log('update confing.json') |
| | | // store.set(mode2) |
| | | // // 重新建立sockte 通讯 |
| | | // win?.webContents.send('getScreenTimeout',store.get('screenTimeout')) |
| | | // win?.webContents.send('getPcName',store.get('machineName')) |
| | | // win?.webContents.send('getConfigData',store.get('clientCode'),store.path) |
| | | // } |
| | | |
| | | |
| | | }) |
| | |
| | | <script setup lang="ts"> |
| | | // This starter template is using Vue 3 <script setup> SFCs |
| | | // Check out https://vuejs.org/api/sfc-script-setup.html#script-setup |
| | | import HelloWorld from './components/HelloWorld.vue' |
| | | import { onMounted } from "vue" |
| | | onMounted(()=>{ |
| | | console.log('app点初始化') |
| | | }) |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | console.log("config.json",...args) |
| | | if(args!==null){ |
| | | if(args[0]===undefined){ |
| | | // alert("配置文件没有写入配置,请检查配置文件 文件路径:"+args[2]) |
| | | ElMessageBox.prompt('没有设定客户编号,请输入客户编号并保存', '警告', { |
| | | confirmButtonText: '保存', |
| | | showClose:false, |
| | | showCancelButton:false, |
| | | inputErrorMessage: 'Invalid Email', |
| | | }) |
| | | .then(({ value }) => { |
| | | const mode={ |
| | | clientCode:value, |
| | | machineName:os.hostname(), |
| | | screenTimeout: 60, |
| | | console.log('配置文件没有配置') |
| | | } |
| | | ipcRenderer.send('setConfingData',mode) |
| | | }) |
| | | |
| | | } |
| | | else if(args.length>0&&args[0].length>0){ |
| | | clientCode=args[0] |
| | | else if(args.length>0&&args[0].clientCode.length>0){ |
| | | clientCode=args[0].clientCode |
| | | // 建立sockte 通讯 |
| | | creatorClient([],clientCode) |
| | | deviceList=args[0].deviceList |
| | | creatorClient(args[0]) |
| | | |
| | | } |
| | | } |
| | |
| | | deviceName:string |
| | | deviceType:string |
| | | } |
| | | |
| | | let config={} |
| | | let devices:Array<device>=[] |
| | | let clientCode:string='' |
| | | /** |
| | |
| | | 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})) |
| | | stompClient.send(`/app/workstation/config/set/${clientCode}/${pcName}`,{}, |
| | | JSON.stringify(config)) |
| | | |
| | | } |
| | | // 更新sockte链接状态 |
| | | sockteStore().setsockteIsLink(true) |
| | | console.log(sockteStore().isLink) |
| | | // sockte订阅服务关闭完全有post 来代替 |
| | | // if(devices!==undefined &&devices!=null&&devices.length>0){ |
| | | // // 更新sockte链接状态 |
| | | // sockteStore().setsockteIsLink(true) |
| | | // console.log(sockteStore().isLink) |
| | | // console.log(devices) |
| | | // if(devices!==undefined&&devices!=null &&devices!=null &&devices.length>0){ |
| | | // devices.forEach(de=>{ |
| | | // if(stompClient!==null){ |
| | | // console.log() |
| | | // stompClient.subscribe(`/queue/${clientCode}/${de.deviceName}/result`,callback) |
| | | // stompClient.subscribe(`/queue/${clientCode}/${de.deviceName}/keepalive`,callbackState) |
| | | // stompClient.send(`/app/device/request/${clientCode}/${de.deviceName}`, {}, JSON.stringify({"deviceNumber":de.deviceName})); |
| | | // } |
| | | // }) |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | const error_callback=function(error:any){ |
| | |
| | | },60000) |
| | | } |
| | | // 创建客户端链接 |
| | | const creatorClient=(devices2:any,clientCode2:any)=>{ |
| | | devices=devices2 |
| | | clientCode=clientCode2 |
| | | const creatorClient=(configObj:any)=>{ |
| | | config=configObj |
| | | devices=configObj.deviceList |
| | | clientCode=configObj.clientCode |
| | | console.log(devices,'设备列表','chong') |
| | | const socket = new WebSocket('ws://hemobs.icoldchain.cn/broadcast') |
| | | stompClient = Stomp.over(socket) |
| | |
| | | <teleport to="body"> |
| | | <div class="mask"> |
| | | <el-header class="go"> |
| | | <div> |
| | | 请把头移动到摄像头能拍到的位置,不要动 ! |
| | | </div> |
| | | <div class="box"> |
| | | <video id="videoCamera" class="canvas" :width="videoWidth" :height="videoHeight" autoPlay></video> |
| | | <canvas id="canvasCamera" class="canvas" :width="videoWidth" :height="videoWidth"></canvas> |
| | | <canvas id="canvasCamera" class="canvas" :width="300" :height="300"></canvas> |
| | | </div> |
| | | <div class="footer"> |
| | | <el-button @click="getCompetence" icon="el-icon-video-camera"> 打开摄像头 </el-button> |
| | | <el-button @click="drawImage" icon="el-icon-camera"> 拍照 </el-button> |
| | | <el-button @click="stopNavigator" icon="el-icon-switch-button"> 关闭摄像头 </el-button> |
| | | <el-button @click="resetCanvas" icon="el-icon-refresh"> 重置 </el-button> |
| | | <el-button @click="$emit('closed')" class="closeBtn">关闭</el-button> |
| | | </div> |
| | | </el-header> |
| | | </div> |
| | |
| | | <script lang="ts" setup> |
| | | import { ref, reactive, inject, toRefs, nextTick } from "vue"; |
| | | import { ElMessage, ElMessageBox } from "element-plus"; |
| | | const message = inject("$message"); |
| | | const config = inject("$CONFIG"); |
| | | const tool = inject("$TOOL"); |
| | | const api = inject("$API"); |
| | | |
| | | const loading = ref(false); |
| | | const os = ref(false); //控制摄像头开关 |
| | | let thisVideo = ref(""); |
| | |
| | | thisCancas = document.getElementById("canvasCamera"); |
| | | thisContext = thisCancas.getContext("2d"); |
| | | thisVideo = document.getElementById("videoCamera"); |
| | | thisContext.drawImage(thisVideo, 0, 0, 500, 500); |
| | | thisContext.drawImage(thisVideo, 0, 0, 300, 300); |
| | | //获取图片地址 |
| | | queryParams.imgSrc = thisCancas.toDataURL('image/png'); |
| | | console.log(queryParams.imgSrc); |
| | |
| | | justify-content: space-between; |
| | | float: left; |
| | | margin-top: 217px; |
| | | } |
| | | .detailed { |
| | | width: 1200px !important; |
| | | height: 800px !important; |
| | | display: block; |
| | | position: absolute; |
| | | left: 50%; |
| | | top: 50%; |
| | | transform: translate(-50%, -50%); |
| | | background-color: white; |
| | | z-index: 1999; |
| | | } |
| | | |
| | | |
| | | .oText { |
| | | margin-left: 42px; |
| | | } |
| | | .mask { |
| | | position: absolute; |
| | | top: 0; |