远程管理错误修复

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/>
</el-icon>
</el-button>-->
<el-button text @click="userStore.showHomeMsg=true">
<!-- <el-button text @click="userStore.showHomeMsg=true">
<el-badge is-dot>
<el-icon>
<Bell/>
</el-icon>
</el-badge>
</el-button>
</el-button>-->
<el-button text @click="toggleFullscreen">
<el-icon>
<FullScreen/>

View File

@ -156,6 +156,10 @@ function showData(i: any) {
remoteWsStore.setCurrentTaskIndex(i)
currentIndex = remoteWsStore.getCurrentTaskIndex()
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()
}

View File

@ -271,6 +271,12 @@ onUnmounted(() => {
// 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.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() {

View File

@ -3,7 +3,7 @@
<div class="header-box">
<div class="thumbnail" @click="viewThumbnail">
<el-icon>
<Menu />
<Menu/>
</el-icon>
<span>缩略图</span>
</div>
@ -15,23 +15,23 @@
</div>
<div class="content-box">
<div class="remote-box">
<RemotePart ref="remotePartRef" @addLogAfter="addLogAfter" @breakRemote="breakRemote" />
<RemotePart ref="remotePartRef" @addLogAfter="addLogAfter" @breakRemote="breakRemote"/>
</div>
<div class="message-box">
<MessagePart ref="messagePartRef" />
<MessagePart ref="messagePartRef"/>
</div>
</div>
</div>
<RemoteDialog ref="remoteDialogRef" @confirmRemote="confirmRemote" @errorRemote="errorRemote" />
<RemoteDialog ref="remoteDialogRef" @confirmRemote="confirmRemote" @errorRemote="errorRemote"/>
</template>
<script lang='ts' setup>
import { onMounted, ref } from 'vue'
import { useRouter } from 'vue-router'
import {onMounted, onUnmounted, ref} from 'vue'
import {useRouter} from 'vue-router'
import RemoteDialog from './part/remote-dialog.vue'
import RemotePart from './part/remote-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 remotePartRef = ref()
@ -43,6 +43,15 @@ onMounted(() => {
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() {
remoteWsStore.initRemoteTask()
remotePartRef.value.showData(remoteWsStore.getCurrentTaskIndex());
@ -51,8 +60,7 @@ function initRemoteTask() {
const viewThumbnail = () => {
router.push({
path: '/remote-manage/remote-thumbnail',
query: {
}
query: {}
})
}
//
@ -133,7 +141,7 @@ const addLogAfter = () => {
font-size: 1.4em;
}
&>span {
& > span {
display: none;
margin-left: 5px;
line-height: 1;
@ -144,7 +152,7 @@ const addLogAfter = () => {
width: 160px;
transition: all .3s;
&>span {
& > span {
display: block;
}
}

View File

@ -2,15 +2,19 @@
<el-scrollbar style="width: 100%;height: 100%;">
<div class="remote-thumbnail-page">
<div class="remote-box row1">
<div class="remote-item" v-for="item in remoteTask.slice(0, 4)" :key="item.title" @click="openRemote(item)">
<RemoteItemPart :ref="'remoteItemPartRef' + item.index" :index="item.index" @addLogAfter="addLogAfter">
<div class="remote-item" v-for="item in remoteTask.slice(0, 4)" :key="item.title"
@click="openRemote(item)">
<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">
<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>
@ -26,11 +30,11 @@
</template>
<script lang='ts' setup>
import { onMounted, ref } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import {onMounted, onUnmounted, ref} from 'vue';
import {useRoute, useRouter} from 'vue-router';
import RemoteItemPart from './part/remote-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 router = useRouter();
@ -42,6 +46,15 @@ onMounted(() => {
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) => {
remoteWsStore.setCurrentTaskIndex(params.index)
router.push('/remote-manage/remote-manage');