错误修复

This commit is contained in:
yy 2024-05-30 09:24:07 +08:00
parent 134d202f67
commit 63ccb81c9b
5 changed files with 944 additions and 941 deletions

View File

@ -50,7 +50,7 @@ if (token) {
router.addRoute({
name: "root",
path: "/",
redirect: "/home"
redirect: "/remote-manage"
})
} else {
router.addRoute({

View File

@ -36,7 +36,7 @@
</el-button>
<el-dropdown trigger="click" @command="userCommand">
<span class="el-dropdown-link">
{{ userInfo.name }}
{{ userInfo?.name }}
<el-icon class="el-icon--right">
<arrow-down/>
</el-icon>

View File

@ -34,17 +34,20 @@ onMounted(() => {
function updateChartData(data: any) {
if (data) {
if (currentNode && currentNode.Time == data.Time) {
if (currentNode && currentNode.Time == data[0].Time) {
return;
} else {
currentNode = data;
currentNode = data[0];
}
for (let i = data.length - 1; i >= 0; i--) {
const item = data[i]
if (xData.indexOf(dateFormater("HH:mm:ss", item.Time)) == -1) {
xData.shift();
xData.push(dateFormater("HH:mm:ss", data.Time ? data.Time - 8 * 60 * 60 * 1000 : ''));
series.forEach(serie => {
xData.push(dateFormater("HH:mm:ss", item.Time));
series.forEach((serie: any) => {
serie.data.shift();
serie.data.push(data[serie.name]);
if (data[serie.name + '_except']) {
serie.data.push(item[serie.name]);
if (item[serie.name + '_except']) {
emit("exceptionEvent", remoteWsStore.exceptionMsg[serie.name + '_except']);
}
})
@ -55,6 +58,8 @@ function updateChartData(data: any) {
series,
})
}
}
}
}
function chartInit() {

View File

@ -140,7 +140,9 @@ onMounted(() => {
})
onUnmounted(() => {
if (remoteItem.value) {
remoteWsStore.unsubscribeVital(remoteItem.value.patient, remoteItem.value.patientId, remoteItem.value.date, currentIndex);
}
})
function showData(i: any) {

View File

@ -16,7 +16,7 @@
<div class="center-box">
<div class="body-box">
<div class="body-img">
<img src="@/assets/imgs/main_body.png" style="width: 100%;height: 100%;" />
<img src="@/assets/imgs/main_body.png" style="width: 100%;height: 100%;"/>
<img class="lung-img" :class="{ 'shake_1': lungAlarm }"
:src="lungAlarm ? imgLungAlarm : imgLung">
<img class="heart-img" :class="{ 'shake_1': heartAlarm }"
@ -44,11 +44,11 @@
<!-- </el-select>-->
<el-button color="#C77000" style="width: 150px;" @click="viewPatientInfo">患者信息</el-button>
<el-button color="#C77000" style="width: 150px;">已连接</el-button>
<!-- <el-button color="#C77000" >机器人运行正常</el-button>-->
<!-- <el-button color="#C77000" >机器人运行正常</el-button>-->
</div>
<el-button color="#e0e0e0" @click="backRemote">
<el-icon>
<Back />
<Back/>
</el-icon>
返回
</el-button>
@ -83,7 +83,7 @@
</li>
</ul>
<div class="send-box">
<el-input v-model="msgVal" placeholder="请输入消息" />
<el-input v-model="msgVal" placeholder="请输入消息"/>
<el-button color="#006080" @click="sendMsg">发送消息</el-button>
</div>
</div>
@ -110,8 +110,8 @@
</template> -->
</el-table-column>
<el-table-column prop="total" label="累计药量(ml)" width="100"/>
<el-table-column prop="state" label="工作状态" width="70" align="center" />
<!-- <el-table-column label="特殊情况人为干预" align="center">
<el-table-column prop="state" label="工作状态" width="70" align="center"/>
<!-- <el-table-column label="特殊情况人为干预" align="center">
<template #default="scope">
<div class="table-btn-box">
<el-button size="small" color="#006080" @click="tableItemPlus(scope)">
@ -125,8 +125,8 @@
<Minus/>
</el-icon>
</el-button>
<!--<el-button size="small" color="#006080" @click="tableItemConfirm(scope)"
:disabled="tableDataStore[scope.$index].speed === scope.row.speed">确定-->
&lt;!&ndash; <el-button size="small" color="#006080" @click="tableItemConfirm(scope)"
:disabled="tableDataStore[scope.$index].speed === scope.row.speed">确定&ndash;&gt;-->
<!--<el-button size="small" color="#006080" @click="tableItemConfirm(scope, varTableData)">确定
</el-button>
<el-button size="small" color="#006080" @click="tableItemCancel(scope)">取消
@ -139,11 +139,11 @@
<!-- table2 -->
<div class="table-box">
<el-table :data="fixedTableData" height="100%" style="width: 100%">
<el-table-column type="index" label="序号" width="40" align="center" />
<el-table-column prop="name" label="药物名称" align="center" />
<el-table-column prop="speed" label="速度(ml/h)" width="100" />
<el-table-column type="index" label="序号" width="40" align="center"/>
<el-table-column prop="name" label="药物名称" align="center"/>
<el-table-column prop="speed" label="速度(ml/h)" width="100"/>
<el-table-column prop="total" label="累计药量(ml)" width="100"/>
<el-table-column prop="state" label="工作状态" width="70" align="center" />
<el-table-column prop="state" label="工作状态" width="70" align="center"/>
<!-- <el-table-column label="特殊情况人为干预" align="center">
<template #default="scope">
<div class="table-btn-box">
@ -172,7 +172,7 @@
<el-dialog v-model="setDatabaseDialog" title="请选择需要查询的病人" width="300px" align-center>
<el-select v-model="database" filterable placeholder="Select" style="width: 100%;">
<el-option v-for="item in databaseOptions" :key="item.value" :label="item.label" :value="item.value" />
<el-option v-for="item in databaseOptions" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
<template #footer>
<span class="dialog-footer">
@ -182,16 +182,16 @@
</template>
</el-dialog>
<el-dialog v-model="isPatientDialog" title="患者信息" width="50%">
<PatientsForm ref="patientsFormRef" type="view" @close="isPatientDialog = false" />
<PatientsForm ref="patientsFormRef" type="view" @close="isPatientDialog = false"/>
</el-dialog>
</div>
</template>
<script lang="ts" setup>
import { onMounted, onUnmounted, reactive, ref } from 'vue';
import { useRouter } from 'vue-router'
import { ElMessage } from 'element-plus';
import { dateFormater } from '@/utils/date-util';
import {onMounted, onUnmounted, reactive, ref} from 'vue';
import {useRouter} from 'vue-router'
import {ElMessage} from 'element-plus';
import {dateFormater} from '@/utils/date-util';
import chartLine from './chart/chart-line.vue';
import chartEcg from './chart/chart-ecg.vue';
import PatientsForm from '@/views/patients-manage/form/patients-form.vue'
@ -199,23 +199,23 @@ import imgLung from '@/assets/imgs/lung.png';
import imgHeart from '@/assets/imgs/heart.png';
import imgLungAlarm from '@/assets/imgs/lung_alarm.png';
import imgHeartAlarm from '@/assets/imgs/heart_alarm.png';
import { useRemoteWsStore } from "@/stores/remote-ws-store";
import { useUserStore } from "@/stores/user-info-store";
import { getPatientInfo, getPatientInfoM } from "@/api/patient";
import {useRemoteWsStore} from "@/stores/remote-ws-store";
import {useUserStore} from "@/stores/user-info-store";
import {getPatientInfo, getPatientInfoM} from "@/api/patient";
const router = useRouter()
const medicineCustom: any[] = [
{ name: '丙泊酚', plus: 0.5, total: 50 },
{ name: '舒芬太尼', plus: 1, total: 100 },
{ name: '瑞芬太尼', plus: 0.05, total: 5 },
{ name: '顺阿曲库胺', plus: 0.02, total: 2 },
{ name: '尼卡地平', plus: 1, total: 100 },
{ name: '艾司洛尔', plus: 1, total: 100 },
{ name: '麻黄素', plus: 1, total: 100 },
{ name: '阿托品', plus: 1, total: 100 },
{ name: '罗库溴铵', plus: 0.1, total: 10 }
{name: '丙泊酚', plus: 0.5, total: 50},
{name: '舒芬太尼', plus: 1, total: 100},
{name: '瑞芬太尼', plus: 0.05, total: 5},
{name: '顺阿曲库胺', plus: 0.02, total: 2},
{name: '尼卡地平', plus: 1, total: 100},
{name: '艾司洛尔', plus: 1, total: 100},
{name: '麻黄素', plus: 1, total: 100},
{name: '阿托品', plus: 1, total: 100},
{name: '罗库溴铵', plus: 0.1, total: 10}
]
const remoteWsStore = useRemoteWsStore()
const currentRemote = ref()
@ -237,7 +237,7 @@ const messageSum = ref(10)
const userName = ref(userInfo.userInfo.name)
const setDatabaseDialog = ref(false);
const featureTable = ref([] as any[]);
let chartNowData = reactive({ ID: 0 });
let chartNowData = reactive({ID: 0});
const lungAlarm = ref(false); //
const heartAlarm = ref(false); //
const isAIDose = ref(false); // AI
@ -277,10 +277,10 @@ function subscribeWS() {
remoteWsStore.subscribeVital(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date, index,
function (res: any) {
const data = JSON.parse(res.data);
chartDom1.value.updateChartData(data.vitalSignsList[0]);
chartDom2.value.updateChartData(data.vitalSignsList[0]);
chartDom3.value.updateChartData(data.vitalSignsList[0]);
chartDom4.value.updateChartData(data.vitalSignsList[0]);
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]);
})
@ -323,8 +323,7 @@ function updateMedicineTable(aiMedicine: any, doctorMedicine: any) {
if (aiMedicine) {
delete aiMedicine._id;
delete aiMedicine.Time;
if (currentAIMedicine && currentAIMedicine.Time == aiMedicine.Time) {
} else {
currentAIMedicine = aiMedicine;
const keys = Object.keys(aiMedicine);
keys.forEach(key => {
@ -358,13 +357,11 @@ function updateMedicineTable(aiMedicine: any, doctorMedicine: any) {
fixedTableData.value = fixedTable;
}
}
}
if (doctorMedicine) {
delete doctorMedicine._id;
delete doctorMedicine.Time;
if (currentDocMedicine && currentDocMedicine.Time == doctorMedicine.Time) {
} else {
currentDocMedicine = doctorMedicine;
const keys = Object.keys(doctorMedicine);
keys.forEach(key => {
@ -373,12 +370,12 @@ function updateMedicineTable(aiMedicine: any, doctorMedicine: any) {
if (varTableData.value.length > 0) {
varTableData.value.forEach((medicine: any) => {
medicine.speed = Number(doctorMedicine[medicine.name]) + Number(aiMedicine[medicine.name]);
medicine.total = Number(doctorMedicine[medicine.name + "sum"]) + Number(aiMedicine[medicine.name + "sum"]);
medicine.speed = (Number(doctorMedicine[medicine.name]) + Number(aiMedicine[medicine.name])).toFixed(2);
medicine.total = (Number(doctorMedicine[medicine.name + "sum"]) + Number(aiMedicine[medicine.name + "sum"])).toFixed(2);
});
fixedTableData.value.forEach((medicine: any) => {
medicine.speed = Number(doctorMedicine[medicine.name]) + Number(aiMedicine[medicine.name]);
medicine.total = Number(doctorMedicine[medicine.name + "sum"]) + Number(aiMedicine[medicine.name + "sum"]);
medicine.speed = (Number(doctorMedicine[medicine.name]) + Number(aiMedicine[medicine.name])).toFixed(2);
medicine.total = (Number(doctorMedicine[medicine.name + "sum"]) + Number(aiMedicine[medicine.name + "sum"])).toFixed(2);
})
} else {
const varTable: any = [];
@ -401,7 +398,6 @@ function updateMedicineTable(aiMedicine: any, doctorMedicine: any) {
fixedTableData.value = fixedTable;
}
}
}
}
function vitalExcepEvent(data: any) {
@ -510,13 +506,13 @@ function msgLogScrollBottom() {
}
const tableItemPlus = (e: any) => {
const obj = medicineCustom.find(item => item.name === e.row.name) || { plus: 1 };
const obj = medicineCustom.find(item => item.name === e.row.name) || {plus: 1};
e.row.speed += obj.plus;
e.row.speed = Number(e.row.speed.toFixed(2));
}
const tableItemMinus = (e: any) => {
const obj = medicineCustom.find(item => item.name === e.row.name) || { plus: 1 };
const obj = medicineCustom.find(item => item.name === e.row.name) || {plus: 1};
if (!isAIDose.value && e.row.speed - obj.plus <= 0) return;
e.row.speed -= obj.plus;
if (e.row.speed < 0) e.row.speed = 0;
@ -582,7 +578,7 @@ function startAI() {
width: 37%;
height: 100%;
&>h3 {
& > h3 {
font-size: 26px;
color: $main-color;
line-height: 30px;
@ -751,7 +747,7 @@ function startAI() {
color: #c77000;
}
&>.el-button {
& > .el-button {
border-radius: 4px;
background-color: #f2f3f5;
color: $main-color;
@ -765,7 +761,7 @@ function startAI() {
display: flex;
justify-content: space-between;
&>.left-box {
& > .left-box {
position: relative;
width: 200px;
height: 100%;
@ -799,7 +795,7 @@ function startAI() {
}
}
&>.right-box {
& > .right-box {
width: calc(100% - 205px);
height: 100%;