diff --git a/src/stores/remote-ws-store.ts b/src/stores/remote-ws-store.ts
index 915708f..40b225c 100644
--- a/src/stores/remote-ws-store.ts
+++ b/src/stores/remote-ws-store.ts
@@ -288,7 +288,9 @@ export const useRemoteWsStore = defineStore("remoteWs", {
date: date,
msgType: "init"
}))
- this.loopSendMedicinePing(name,id,date,index,()=>{})
+ if (this.loopSendMedicinePing) {
+ this.loopSendMedicinePing(name,id,date,index,()=>{})
+ }
}
}
},
diff --git a/src/views/remote-manage/remote-control.vue b/src/views/remote-manage/remote-control.vue
index 3c37b50..10c53db 100644
--- a/src/views/remote-manage/remote-control.vue
+++ b/src/views/remote-manage/remote-control.vue
@@ -47,7 +47,7 @@
患者信息
- ping:{{timeDiffPing||'-'}}
+ ping:{{timeDiffPing}}
连接远程控制
已控制
@@ -267,10 +267,8 @@ const varTableData = ref([] as any[]);
const table1SpeedVal = ref('');
const whetherControl =ref(false);
const subscribeMedicineData=ref(null);
-const pingData=ref(0);
const intervalFun=ref(null);
const timeDiffPing=ref(0);
-const cachePingFirstTime=ref(0);
let currentAIMedicine: any;
let currentDocMedicine: any;
const medicineSpeedTemp: any = {};
@@ -331,7 +329,7 @@ watch(subscribeMedicineData,(newValue:any,oldValue:any)=>{
}
break;
case 'pong':
- pingData.value=newValue.msg;
+ timeDiffPing.value=newValue.msg;
break;
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() {
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)
@@ -361,10 +344,6 @@ function createConnect() {
function loopSendMedicinePing(){
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){