mirror of
https://gitee.com/xiongmao1988/rax-medical.git
synced 2025-08-24 13:04:57 +08:00
ping值改为后端返回
This commit is contained in:
parent
9c58812420
commit
6bb2d7aff6
|
@ -288,9 +288,11 @@ export const useRemoteWsStore = defineStore("remoteWs", {
|
||||||
date: date,
|
date: date,
|
||||||
msgType: "init"
|
msgType: "init"
|
||||||
}))
|
}))
|
||||||
|
if (this.loopSendMedicinePing) {
|
||||||
this.loopSendMedicinePing(name,id,date,index,()=>{})
|
this.loopSendMedicinePing(name,id,date,index,()=>{})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 请求连接远程控制
|
// 请求连接远程控制
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
</el-text>
|
</el-text>
|
||||||
</el-space>
|
</el-space>
|
||||||
<el-button color="#C77000" @click="viewPatientInfo">患者信息</el-button>
|
<el-button color="#C77000" @click="viewPatientInfo">患者信息</el-button>
|
||||||
<el-button type="text" color="#C77000">ping:{{timeDiffPing||'-'}}</el-button>
|
<el-button type="text" color="#C77000">ping:{{timeDiffPing}}</el-button>
|
||||||
<el-button color="#C77000" @click="connectionUnity('1')" v-if="!whetherControl">连接远程控制</el-button>
|
<el-button color="#C77000" @click="connectionUnity('1')" v-if="!whetherControl">连接远程控制</el-button>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<el-button color="#C77000">已控制</el-button>
|
<el-button color="#C77000">已控制</el-button>
|
||||||
|
@ -267,10 +267,8 @@ const varTableData = ref([] as any[]);
|
||||||
const table1SpeedVal = ref('');
|
const table1SpeedVal = ref('');
|
||||||
const whetherControl =ref(false);
|
const whetherControl =ref(false);
|
||||||
const subscribeMedicineData=ref(null);
|
const subscribeMedicineData=ref(null);
|
||||||
const pingData=ref(0);
|
|
||||||
const intervalFun=ref(null);
|
const intervalFun=ref(null);
|
||||||
const timeDiffPing=ref(0);
|
const timeDiffPing=ref(0);
|
||||||
const cachePingFirstTime=ref(0);
|
|
||||||
let currentAIMedicine: any;
|
let currentAIMedicine: any;
|
||||||
let currentDocMedicine: any;
|
let currentDocMedicine: any;
|
||||||
const medicineSpeedTemp: any = {};
|
const medicineSpeedTemp: any = {};
|
||||||
|
@ -331,7 +329,7 @@ watch(subscribeMedicineData,(newValue:any,oldValue:any)=>{
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'pong':
|
case 'pong':
|
||||||
pingData.value=newValue.msg;
|
timeDiffPing.value=newValue.msg;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -339,21 +337,6 @@ watch(subscribeMedicineData,(newValue:any,oldValue:any)=>{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
watch(pingData,(newValue:any,oldValue:any)=>{
|
|
||||||
if (newValue&&oldValue) {
|
|
||||||
const timeDiff= Math.abs(newValue - oldValue)
|
|
||||||
const res= Math.ceil(timeDiff / 10)
|
|
||||||
timeDiffPing.value=res
|
|
||||||
}else{
|
|
||||||
if (newValue) {
|
|
||||||
const res=Math.abs(newValue - (cachePingFirstTime.value || +new Date())) / 10
|
|
||||||
timeDiffPing.value=Math.ceil(res)
|
|
||||||
}else{
|
|
||||||
timeDiffPing.value= 0 / 10
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
function createConnect() {
|
function createConnect() {
|
||||||
remoteWsStore.createChatConnect(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date, currentRemote.value.index)
|
remoteWsStore.createChatConnect(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date, currentRemote.value.index)
|
||||||
remoteWsStore.createMedicineConnect(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date, currentRemote.value.index)
|
remoteWsStore.createMedicineConnect(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date, currentRemote.value.index)
|
||||||
|
@ -361,10 +344,6 @@ function createConnect() {
|
||||||
|
|
||||||
function loopSendMedicinePing(){
|
function loopSendMedicinePing(){
|
||||||
remoteWsStore.loopSendMedicinePing(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date, currentRemote.value.index,(res:any)=>{})
|
remoteWsStore.loopSendMedicinePing(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date, currentRemote.value.index,(res:any)=>{})
|
||||||
if (cachePingFirstTime.value) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
cachePingFirstTime.value= +new Date()
|
|
||||||
}
|
}
|
||||||
// 连接远程控制
|
// 连接远程控制
|
||||||
function connectionUnity(flag:string){
|
function connectionUnity(flag:string){
|
||||||
|
|
Loading…
Reference in New Issue
Block a user