2024年10月17日17点31分: 修改折线图. 实时1S展示更新一次

This commit is contained in:
republicline 2024-10-17 17:31:20 +08:00
parent 33fcd07dde
commit d90d5e4eef
3 changed files with 886 additions and 868 deletions

View File

@ -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"
}))
}

View File

@ -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,
})
}
}
// }
}
}

View File

@ -106,8 +106,8 @@
<el-dropdown-item command="速度(ml/h)">速度(ml/h)</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</template> -->
</el-dropdown>
</template> -->
</el-table-column>
<el-table-column prop="total" label="累计药量(ml)" width="100"/>
<!-- <el-table-column prop="state" label="工作状态" width="150" align="center"/>-->
@ -302,12 +302,15 @@ const subscribeVital = () => {
remoteWsStore.subscribeVital(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date, currentIndex,
function (res: any) {
const data = JSON.parse(res.data);
// 1 2 3
if (data.vitalSignsList != null) {
chartDom1.value.updateChartData(data.vitalSignsList);
chartDom2.value.updateChartData(data.vitalSignsList);
chartDom3.value.updateChartData(data.vitalSignsList);
// chartDom4.value.updateChartData(data.vitalSignsList);
// updateMedicineTable(data.aiMedicineList[0], data.docMedicineList[0]);
updateMedicineTable(data.aiMedicineList[0], undefined);
}
})
remoteWsStore.vitalOnclose(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date, currentIndex, () => {
setTimeout(() => {