From d90d5e4eef48fc8429906d2e0b0478894fb0056f Mon Sep 17 00:00:00 2001 From: republicline <1464474399@qq.com> Date: Thu, 17 Oct 2024 17:31:20 +0800 Subject: [PATCH] =?UTF-8?q?2024=E5=B9=B410=E6=9C=8817=E6=97=A517=E7=82=B93?= =?UTF-8?q?1=E5=88=86:=20=E4=BF=AE=E6=94=B9=E6=8A=98=E7=BA=BF=E5=9B=BE.=20?= =?UTF-8?q?=E5=AE=9E=E6=97=B61S=E5=B1=95=E7=A4=BA=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E4=B8=80=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/remote-ws-store.ts | 15 +- src/views/remote-manage/chart/chart-line.vue | 12 +- src/views/remote-manage/remote-control.vue | 1727 +++++++++--------- 3 files changed, 886 insertions(+), 868 deletions(-) diff --git a/src/stores/remote-ws-store.ts b/src/stores/remote-ws-store.ts index fff5bca..69a5b63 100644 --- a/src/stores/remote-ws-store.ts +++ b/src/stores/remote-ws-store.ts @@ -2,10 +2,23 @@ import {defineStore} from "pinia"; import {Session} from "@/utils/storage"; import {ElMessage} from "element-plus"; +// 本地调试版本: const vitalUrl = "ws://" + window.location.host + "/socket.io/admin/rax/vitalSignsMedicine?token=" + Session.getToken() const medicineUrl = "ws://" + window.location.host + "/socket.io/admin/rax/addMedicine?token=" + Session.getToken() const chatUrl = "ws://" + window.location.host + "/socket.io/admin/rax/chatRoom?token=" + Session.getToken() +// 服务器部署版本 +// const vitalUrl = "wss://" + window.location.host + "/socket.io/admin/rax/vitalSignsMedicine?token=" + Session.getToken() +// const medicineUrl = "wss://" + window.location.host + "/socket.io/admin/rax/addMedicine?token=" + Session.getToken() +// const chatUrl = "wss://" + window.location.host + "/socket.io/admin/rax/chatRoom?token=" + Session.getToken() + +// 测试echars +// const vitalUrl = "wss://" + "110.41.142.124" + "/socket.io/admin/rax/vitalSignsMedicine?token=" + Session.getToken() +// const medicineUrl = "wss://" + "110.41.142.124" + "/socket.io/admin/rax/addMedicine?token=" + Session.getToken() +// const chatUrl = "wss://" + "110.41.142.124" + "/socket.io/admin/rax/chatRoom?token=" + Session.getToken() + + + export const useRemoteWsStore = defineStore("remoteWs", { state: () => { return { @@ -261,7 +274,7 @@ export const useRemoteWsStore = defineStore("remoteWs", { patientName: name, idNum: id, date: date, - msgType: "msg" + msgType: "init" })) } diff --git a/src/views/remote-manage/chart/chart-line.vue b/src/views/remote-manage/chart/chart-line.vue index a428332..65268fa 100644 --- a/src/views/remote-manage/chart/chart-line.vue +++ b/src/views/remote-manage/chart/chart-line.vue @@ -34,13 +34,15 @@ onMounted(() => { function updateChartData(data: any) { if (data) { - if (currentNode && currentNode.Time == data[0].Time) { + // if (currentNode && currentNode.Time == data[0].Time) { + if (currentNode && currentNode.Time == data.Time) { return; } else { - currentNode = data[0]; + currentNode = data; } - for (let i = (data.length - 1); i >= 0; i--) { - const item = data[i] + // for (let i = (data.length - 1); i >= 0; i--) { + // const item = data[i]; + const item = data; if (xData.indexOf(dateFormater("HH:mm:ss", item.Time)) == -1) { xData.shift(); xData.push(dateFormater("HH:mm:ss", item.Time)); @@ -58,7 +60,7 @@ function updateChartData(data: any) { series, }) } - } + // } } } diff --git a/src/views/remote-manage/remote-control.vue b/src/views/remote-manage/remote-control.vue index 4f65539..96d379e 100644 --- a/src/views/remote-manage/remote-control.vue +++ b/src/views/remote-manage/remote-control.vue @@ -1,150 +1,117 @@