远程管理错误修复

This commit is contained in:
yy 2024-06-07 11:14:48 +08:00
parent ce62495c16
commit 69c6cd10f7
5 changed files with 272 additions and 241 deletions

View File

@ -22,13 +22,13 @@
<Search/> <Search/>
</el-icon> </el-icon>
</el-button>--> </el-button>-->
<el-button text @click="userStore.showHomeMsg=true"> <!-- <el-button text @click="userStore.showHomeMsg=true">
<el-badge is-dot> <el-badge is-dot>
<el-icon> <el-icon>
<Bell/> <Bell/>
</el-icon> </el-icon>
</el-badge> </el-badge>
</el-button> </el-button>-->
<el-button text @click="toggleFullscreen"> <el-button text @click="toggleFullscreen">
<el-icon> <el-icon>
<FullScreen/> <FullScreen/>

View File

@ -156,6 +156,10 @@ function showData(i: any) {
remoteWsStore.setCurrentTaskIndex(i) remoteWsStore.setCurrentTaskIndex(i)
currentIndex = remoteWsStore.getCurrentTaskIndex() currentIndex = remoteWsStore.getCurrentTaskIndex()
remoteItem.value = remoteWsStore.getRemoteTask()[currentIndex] remoteItem.value = remoteWsStore.getRemoteTask()[currentIndex]
currentException = {}
if (remoteItem.value && remoteItem.value.patient) {
remoteWsStore.createVital(remoteItem.value.patient, remoteItem.value.patientId, remoteItem.value.date, currentIndex)
}
getData() getData()
} }

View File

@ -271,6 +271,12 @@ onUnmounted(() => {
// remoteWsStore.unsubscribeMedicine(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date, index); // remoteWsStore.unsubscribeMedicine(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date, index);
remoteWsStore.unsubscribeVital(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date, currentIndex); remoteWsStore.unsubscribeVital(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date, currentIndex);
remoteWsStore.disconnectChat(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date, currentIndex) remoteWsStore.disconnectChat(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date, currentIndex)
if (!router.currentRoute.value.path.startsWith("/remote-manage/")) {
const tasks: any = remoteWsStore.getRemoteTask()
tasks.forEach((task: any) => {
remoteWsStore.disconnect(task.patient, task.patientId, task.date, task.index)
})
}
}) })
function subscribeWS() { function subscribeWS() {

View File

@ -1,37 +1,37 @@
<template> <template>
<div class="remote-manage-page"> <div class="remote-manage-page">
<div class="header-box"> <div class="header-box">
<div class="thumbnail" @click="viewThumbnail"> <div class="thumbnail" @click="viewThumbnail">
<el-icon> <el-icon>
<Menu /> <Menu/>
</el-icon> </el-icon>
<span>缩略图</span> <span>缩略图</span>
</div> </div>
<div class="task-btn-item" v-for="(item, index) in remoteWsStore.remoteTasks" :key="'task-' + index" <div class="task-btn-item" v-for="(item, index) in remoteWsStore.remoteTasks" :key="'task-' + index"
:class="{ 'connecting': item.patient || item.patientId, 'alarm': item.isException }" :class="{ 'connecting': item.patient || item.patientId, 'alarm': item.isException }"
@click="editTask(item)" @dblclick="toRemoteControl(item)"> @click="editTask(item)" @dblclick="toRemoteControl(item)">
<span>{{ item.taskName || ('新建任务' + (index + 1)) }}</span> <span>{{ item.taskName || ('新建任务' + (index + 1)) }}</span>
</div> </div>
</div> </div>
<div class="content-box"> <div class="content-box">
<div class="remote-box"> <div class="remote-box">
<RemotePart ref="remotePartRef" @addLogAfter="addLogAfter" @breakRemote="breakRemote" /> <RemotePart ref="remotePartRef" @addLogAfter="addLogAfter" @breakRemote="breakRemote"/>
</div> </div>
<div class="message-box"> <div class="message-box">
<MessagePart ref="messagePartRef" /> <MessagePart ref="messagePartRef"/>
</div> </div>
</div> </div>
</div> </div>
<RemoteDialog ref="remoteDialogRef" @confirmRemote="confirmRemote" @errorRemote="errorRemote" /> <RemoteDialog ref="remoteDialogRef" @confirmRemote="confirmRemote" @errorRemote="errorRemote"/>
</template> </template>
<script lang='ts' setup> <script lang='ts' setup>
import { onMounted, ref } from 'vue' import {onMounted, onUnmounted, ref} from 'vue'
import { useRouter } from 'vue-router' import {useRouter} from 'vue-router'
import RemoteDialog from './part/remote-dialog.vue' import RemoteDialog from './part/remote-dialog.vue'
import RemotePart from './part/remote-part.vue' import RemotePart from './part/remote-part.vue'
import MessagePart from './part/message-part.vue' import MessagePart from './part/message-part.vue'
import { useRemoteWsStore } from "@/stores/remote-ws-store"; import {useRemoteWsStore} from "@/stores/remote-ws-store";
const router = useRouter() const router = useRouter()
const remotePartRef = ref() const remotePartRef = ref()
@ -40,179 +40,187 @@ const remoteDialogRef = ref()
const remoteWsStore = useRemoteWsStore(); const remoteWsStore = useRemoteWsStore();
onMounted(() => { onMounted(() => {
initRemoteTask() initRemoteTask()
})
onUnmounted(() => {
if (!router.currentRoute.value.path.startsWith("/remote-manage/")) {
const tasks: any = remoteWsStore.getRemoteTask()
tasks.forEach((task: any) => {
remoteWsStore.disconnect(task.patient, task.patientId, task.date, task.index)
})
}
}) })
function initRemoteTask() { function initRemoteTask() {
remoteWsStore.initRemoteTask() remoteWsStore.initRemoteTask()
remotePartRef.value.showData(remoteWsStore.getCurrentTaskIndex()); remotePartRef.value.showData(remoteWsStore.getCurrentTaskIndex());
} }
const viewThumbnail = () => { const viewThumbnail = () => {
router.push({ router.push({
path: '/remote-manage/remote-thumbnail', path: '/remote-manage/remote-thumbnail',
query: { query: {}
} })
})
} }
// //
const editTask = (item: any) => { const editTask = (item: any) => {
// content // content
if (item.isRemote) { if (item.isRemote) {
remotePartRef.value.showData(item.index) remotePartRef.value.showData(item.index)
} else { } else {
remoteDialogRef.value.open(item.index) remoteDialogRef.value.open(item.index)
} }
} }
// //
const toRemoteControl = (item: any) => { const toRemoteControl = (item: any) => {
// //
if (item.isRemote) { if (item.isRemote) {
remoteWsStore.setCurrentTaskIndex(item.index) remoteWsStore.setCurrentTaskIndex(item.index)
router.push('/remote-manage/remote-control') router.push('/remote-manage/remote-control')
} else { } else {
remoteDialogRef.value.open(item.index) remoteDialogRef.value.open(item.index)
} }
} }
// //
const confirmRemote = () => { const confirmRemote = () => {
messagePartRef.value.scrollToBottom() messagePartRef.value.scrollToBottom()
// //
remotePartRef.value.initData() remotePartRef.value.initData()
} }
// //
const errorRemote = () => { const errorRemote = () => {
messagePartRef.value.scrollToBottom() messagePartRef.value.scrollToBottom()
} }
// //
const breakRemote = () => { const breakRemote = () => {
messagePartRef.value.scrollToBottom() messagePartRef.value.scrollToBottom()
} }
const addLogAfter = () => { const addLogAfter = () => {
messagePartRef.value.scrollToBottom() messagePartRef.value.scrollToBottom()
} }
</script> </script>
<style lang='scss' scoped> <style lang='scss' scoped>
.remote-manage-page { .remote-manage-page {
width: 100%; width: 100%;
height: 100%; height: 100%;
padding-top: 15px; padding-top: 15px;
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
.header-box { .header-box {
position: relative; position: relative;
width: 100%; width: 100%;
min-height: 180px; min-height: 180px;
background: white; background: white;
padding: 0 30px; padding: 0 30px;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
.thumbnail { .thumbnail {
cursor: pointer; cursor: pointer;
position: absolute; position: absolute;
width: 70px; width: 70px;
height: 70px; height: 70px;
top: 0; top: 0;
right: 0; right: 0;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
background: #f8b300; background: #f8b300;
border-top-left-radius: 35px; border-top-left-radius: 35px;
border-bottom-left-radius: 35px; border-bottom-left-radius: 35px;
box-shadow: -3px 3px 5px 0 rgba(black, .2); box-shadow: -3px 3px 5px 0 rgba(black, .2);
font-size: 20px; font-size: 20px;
color: white; color: white;
transition: all .1s; transition: all .1s;
.el-icon { .el-icon {
font-size: 1.4em; font-size: 1.4em;
} }
&>span { & > span {
display: none; display: none;
margin-left: 5px; margin-left: 5px;
line-height: 1; line-height: 1;
white-space: nowrap; white-space: nowrap;
} }
&:hover { &:hover {
width: 160px; width: 160px;
transition: all .3s; transition: all .3s;
&>span { & > span {
display: block; display: block;
} }
} }
} }
.task-btn-item { .task-btn-item {
cursor: pointer; cursor: pointer;
flex-grow: 1; flex-grow: 1;
width: 17%; width: 17%;
min-width: 200px; min-width: 200px;
height: 70px; height: 70px;
margin: 10px 20px; margin: 10px 20px;
border: 2px solid $main-color; border: 2px solid $main-color;
color: $main-color; color: $main-color;
border-radius: 5px; border-radius: 5px;
font-size: 20px; font-size: 20px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
transition: all .6s; transition: all .6s;
&:hover { &:hover {
background: rgba($main-color, .1); background: rgba($main-color, .1);
transition: all .6s; transition: all .6s;
} }
&.connecting { &.connecting {
background: $main-color; background: $main-color;
color: white; color: white;
&:hover { &:hover {
background: rgba($main-color, .8); background: rgba($main-color, .8);
} }
} }
&.alarm { &.alarm {
background: #f80000; background: #f80000;
border-color: #f80000; border-color: #f80000;
color: white; color: white;
&:hover { &:hover {
background: rgba(#f80000, .8); background: rgba(#f80000, .8);
} }
} }
} }
} }
.content-box { .content-box {
width: 100%; width: 100%;
height: calc(100% - 195px); height: calc(100% - 195px);
min-height: 600px; min-height: 600px;
margin-top: 15px; margin-top: 15px;
background: white; background: white;
padding: 20px 50px; padding: 20px 50px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
.remote-box { .remote-box {
width: calc(100% - 370px); width: calc(100% - 370px);
flex-grow: 1; flex-grow: 1;
height: 100%; height: 100%;
} }
.message-box { .message-box {
width: 350px; width: 350px;
height: 100%; height: 100%;
margin-left: 20px; margin-left: 20px;
} }
} }
} }
</style> </style>

View File

@ -1,36 +1,40 @@
<template> <template>
<el-scrollbar style="width: 100%;height: 100%;"> <el-scrollbar style="width: 100%;height: 100%;">
<div class="remote-thumbnail-page"> <div class="remote-thumbnail-page">
<div class="remote-box row1"> <div class="remote-box row1">
<div class="remote-item" v-for="item in remoteTask.slice(0, 4)" :key="item.title" @click="openRemote(item)"> <div class="remote-item" v-for="item in remoteTask.slice(0, 4)" :key="item.title"
<RemoteItemPart :ref="'remoteItemPartRef' + item.index" :index="item.index" @addLogAfter="addLogAfter"> @click="openRemote(item)">
</RemoteItemPart> <RemoteItemPart :ref="'remoteItemPartRef' + item.index" :index="item.index"
@addLogAfter="addLogAfter">
</RemoteItemPart>
</div>
</div>
<div class="remote-box row2">
<div class="left-box">
<div class="remote-item" v-for="item in remoteTask.slice(4)" :key="item.title"
@click="openRemote(item)">
<RemoteItemPart :ref="'remoteItemPartRef' + item.index" :index="item.index"
@addLogAfter="addLogAfter">
</RemoteItemPart>
</div>
</div>
<div class="right-box">
<div class="message-title">异常信息</div>
<div class="message-item" v-for="item in remoteTask" :key="'message-item' + item">
<MessageItemPart ref="messageItemPartRef" :index="item.index"></MessageItemPart>
</div>
</div>
</div>
</div> </div>
</div> </el-scrollbar>
<div class="remote-box row2">
<div class="left-box">
<div class="remote-item" v-for="item in remoteTask.slice(4)" :key="item.title" @click="openRemote(item)">
<RemoteItemPart :ref="'remoteItemPartRef' + item.index" :index="item.index" @addLogAfter="addLogAfter">
</RemoteItemPart>
</div>
</div>
<div class="right-box">
<div class="message-title">异常信息</div>
<div class="message-item" v-for="item in remoteTask" :key="'message-item' + item">
<MessageItemPart ref="messageItemPartRef" :index="item.index"></MessageItemPart>
</div>
</div>
</div>
</div>
</el-scrollbar>
</template> </template>
<script lang='ts' setup> <script lang='ts' setup>
import { onMounted, ref } from 'vue'; import {onMounted, onUnmounted, ref} from 'vue';
import { useRoute, useRouter } from 'vue-router'; import {useRoute, useRouter} from 'vue-router';
import RemoteItemPart from './part/remote-item-part.vue'; import RemoteItemPart from './part/remote-item-part.vue';
import MessageItemPart from './part/message-item-part.vue'; import MessageItemPart from './part/message-item-part.vue';
import { useRemoteWsStore } from "@/stores/remote-ws-store"; import {useRemoteWsStore} from "@/stores/remote-ws-store";
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
@ -39,15 +43,24 @@ const remoteTask = ref([] as any);
const remoteWsStore = useRemoteWsStore(); const remoteWsStore = useRemoteWsStore();
onMounted(() => { onMounted(() => {
remoteTask.value = remoteWsStore.getRemoteTask(); remoteTask.value = remoteWsStore.getRemoteTask();
})
onUnmounted(() => {
if (!router.currentRoute.value.path.startsWith("/remote-manage/")) {
const tasks: any = remoteWsStore.getRemoteTask()
tasks.forEach((task: any) => {
remoteWsStore.disconnect(task.patient, task.patientId, task.date, task.index)
})
}
}) })
const openRemote = (params: any) => { const openRemote = (params: any) => {
remoteWsStore.setCurrentTaskIndex(params.index) remoteWsStore.setCurrentTaskIndex(params.index)
router.push('/remote-manage/remote-manage'); router.push('/remote-manage/remote-manage');
} }
const addLogAfter = (index: number) => { const addLogAfter = (index: number) => {
messageItemPartRef.value[index].scrollToBottom() messageItemPartRef.value[index].scrollToBottom()
} }
</script> </script>
@ -56,66 +69,66 @@ const addLogAfter = (index: number) => {
$size: 20px; $size: 20px;
.remote-thumbnail-page { .remote-thumbnail-page {
width: 100%;
height: 1010px;
overflow: auto;
.remote-box {
width: 100%; width: 100%;
height: 33.33%; height: 1010px;
display: flex; overflow: auto;
.remote-item { .remote-box {
width: 25%; width: 100%;
height: 100%; height: 33.33%;
padding: $size*0.2;
}
&.row2 {
height: 66.67%;
.left-box {
width: 75%;
height: 100%;
display: flex; display: flex;
flex-wrap: wrap;
.remote-item { .remote-item {
width: 33.33%; width: 25%;
height: 50%; height: 100%;
} padding: $size*0.2;
}
.right-box {
position: relative;
width: 25%;
height: 100%;
padding: $size*0.1;
padding-top: $size*0.2 + $size;
display: flex;
flex-wrap: wrap;
.message-title {
position: absolute;
height: $size;
top: $size*0.2;
left: $size*0.2;
right: $size*0.2;
background-color: $red;
text-align: center;
font-size: $size*0.7;
line-height: $size;
color: white;
font-weight: 600;
} }
.message-item { &.row2 {
width: 50%; height: 66.67%;
height: 20%;
padding: $size*0.2; .left-box {
width: 75%;
height: 100%;
display: flex;
flex-wrap: wrap;
.remote-item {
width: 33.33%;
height: 50%;
}
}
.right-box {
position: relative;
width: 25%;
height: 100%;
padding: $size*0.1;
padding-top: $size*0.2 + $size;
display: flex;
flex-wrap: wrap;
.message-title {
position: absolute;
height: $size;
top: $size*0.2;
left: $size*0.2;
right: $size*0.2;
background-color: $red;
text-align: center;
font-size: $size*0.7;
line-height: $size;
color: white;
font-weight: 600;
}
.message-item {
width: 50%;
height: 20%;
padding: $size*0.2;
}
}
} }
}
} }
}
} }
</style> </style>