DESKTOP-0GD05B0\Administrator 2 years ago
parent
commit
75d3e9c0bc

+ 6 - 5
src/utils/websocket.js

@@ -67,8 +67,9 @@ export function initWebSocket(sid, force) {
     webSocket.onclose = function () {
         if (router.currentRoute.value.path === '/login') {
             location.reload()
+        } else {
+            socketErrDialog.value = true
         }
-        socketErrDialog.value = true
         webSocket = null
         let sid
         if (router.currentRoute.value.path === '/triageRoomScreen') {
@@ -83,10 +84,10 @@ export function initWebSocket(sid, force) {
             ElMessageBox.confirm('未检测到WebSocket连接的sid,请重新登录。', '提示', {
                 showCancelButton: false,
                 type: 'warning',
-            }).then(() => {
-                router.push('/login')
-            }).catch(() => {
-                router.push('/login')
+            }).then(async () => {
+                await router.push('/login')
+            }).catch(async () => {
+                await router.push('/login')
             })
         } else {
             if (router.currentRoute.value.path === '/triageFloorScreen') {

+ 0 - 3
src/views/hospitalization/zhu-yuan-yi-sheng/cao-yao-yi-zhu/ChaXunChaoYaoYiZhu.vue

@@ -86,9 +86,7 @@ import {huanZheXinXi, youWuXuanZheHuanZhe} from '@/views/hospitalization/zhu-yua
 import {getDateRangeFormatDate} from '@/utils/date'
 import {huoQuCaoYaoShuJu, huoQuChaoYaoMingXi, shanChuCaoYao} from '@/api/zhu-yuan-yi-sheng/cao-yao-yi-zhu'
 import store from '@/store'
-import {stringIsBlank} from '@/utils/blank-utils'
 import {computed, onActivated, ref, watch} from 'vue'
-import router from '@/router'
 import {ElMessageBox} from 'element-plus'
 import XinZhengCaoYao from "@/views/hospitalization/zhu-yuan-yi-sheng/cao-yao-yi-zhu/XinZhengCaoYao";
 import {getHerbsStatusFlag} from "@/views/hospitalization/zhu-yuan-yi-sheng/cao-yao-yi-zhu/cao-yao";
@@ -182,7 +180,6 @@ onActivated(() => {
 })
 
 
-
 </script>
 
 <style scoped>