远程管理错误修复

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

@ -26,7 +26,7 @@
</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'
@ -43,6 +43,15 @@ 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());
@ -51,8 +60,7 @@ function initRemoteTask() {
const viewThumbnail = () => { const viewThumbnail = () => {
router.push({ router.push({
path: '/remote-manage/remote-thumbnail', path: '/remote-manage/remote-thumbnail',
query: { query: {}
}
}) })
} }
// //

View File

@ -2,15 +2,19 @@
<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 :ref="'remoteItemPartRef' + item.index" :index="item.index"
@addLogAfter="addLogAfter">
</RemoteItemPart> </RemoteItemPart>
</div> </div>
</div> </div>
<div class="remote-box row2"> <div class="remote-box row2">
<div class="left-box"> <div class="left-box">
<div class="remote-item" v-for="item in remoteTask.slice(4)" :key="item.title" @click="openRemote(item)"> <div class="remote-item" v-for="item in remoteTask.slice(4)" :key="item.title"
<RemoteItemPart :ref="'remoteItemPartRef' + item.index" :index="item.index" @addLogAfter="addLogAfter"> @click="openRemote(item)">
<RemoteItemPart :ref="'remoteItemPartRef' + item.index" :index="item.index"
@addLogAfter="addLogAfter">
</RemoteItemPart> </RemoteItemPart>
</div> </div>
</div> </div>
@ -26,7 +30,7 @@
</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';
@ -42,6 +46,15 @@ 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');