From da33f75322d5532e2702d6f345f4207118997e54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=BF=90=E6=A8=A1?= <1724894114@qq.com> Date: Thu, 29 May 2025 15:53:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=B4=E4=BF=AE=E5=BF=85?= =?UTF-8?q?=E5=A1=AB=E5=AD=97=E6=AE=B5=E5=92=8C=E6=B2=A1=E6=9C=89=E6=9D=83?= =?UTF-8?q?=E9=99=90=E6=8E=A8=E5=87=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/index.vue | 1 + src/layout/other/404.vue | 16 +++++++-------- src/utils/websocket.js | 23 +++++++++++++++++---- src/views/order/repair-action.vue | 26 +++++++++++++++++++----- src/views/order/repairListDown/index.vue | 19 +++++++++-------- 5 files changed, 60 insertions(+), 25 deletions(-) diff --git a/src/layout/index.vue b/src/layout/index.vue index 27c8b44..fb24fcc 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -244,6 +244,7 @@ } }, created() { + console.log('layout 再一次进入') this.onLayoutResize(); window.addEventListener('resize', this.onLayoutResize); const menu = this.$router.sc_getMenu(); diff --git a/src/layout/other/404.vue b/src/layout/other/404.vue index f1ac390..c8894b0 100644 --- a/src/layout/other/404.vue +++ b/src/layout/other/404.vue @@ -6,9 +6,9 @@

无权限或找不到页面

当前页面无权限访问或者打开了一个不存在的链接,请检查当前账户权限和链接的可访问性。

- 返回首页 - 重新登录 - 返回上一页 + 返回首页 + 重新登录 + 返回上一页
@@ -16,15 +16,15 @@ diff --git a/src/utils/websocket.js b/src/utils/websocket.js index 0834da9..46b3a19 100644 --- a/src/utils/websocket.js +++ b/src/utils/websocket.js @@ -13,7 +13,7 @@ let global_callback = function () {}; let timeoutObj = null; let timeout = 28 * 1000; //30秒一次心跳 let serverTimeoutObj = 60; //心跳倒计时 -let timeOutNum = 60; //断开 重连倒计时 +let timeOutNum = 60; // 断开 重连倒计时 let lockReconnect = false; //是否真正建立连接 const wsUri = systemConfig.WS_URL; let showNot = null; @@ -46,7 +46,8 @@ function startHeartbeat() { start(); } -function start() {//开启心跳 +//开启心跳 +function start() { timeoutObj && clearTimeout(timeoutObj); serverTimeoutObj && clearTimeout(serverTimeoutObj); timeoutObj = setTimeout(function () { @@ -65,7 +66,22 @@ function start() {//开启心跳 } function createWebSocket(callback, token) { - if (websocket == null || typeof websocket !== WebSocket) { + console.log(websocket,'websocket') + // if (websocket == null || typeof websocket !== WebSocket) { + // initWebSocket(callback, token); + // } + + // websocket.readyState 0 (CONNECTING) 1 (OPEN) 2 (CLOSING) 3 (CLOSED) + // 0 连接正在建立中,尚未连接 + // 1 已经建立,可以进行通信 + // 2 关闭握手过程,即将关闭 + // 3 闭或者根本没有建立‌ + + if(websocket && websocket.readyState === 1){ + return + } + console.log(websocket) + if (websocket === null || websocket.readyState === 3) { initWebSocket(callback, token); } } @@ -121,7 +137,6 @@ function closeSock(active) { function webSocketOnMessage(msg) { // 收到信息为Blob类型时 let result = null; - // debugger // 二进制文件 if (msg.data instanceof Blob) { const reader = new FileReader(); diff --git a/src/views/order/repair-action.vue b/src/views/order/repair-action.vue index af4175d..256b66f 100644 --- a/src/views/order/repair-action.vue +++ b/src/views/order/repair-action.vue @@ -114,14 +114,20 @@ {{scope.row.m_ascription===1?'旧部件':'新部件'}} - + - + @@ -327,7 +333,17 @@ color: var(--el-color-danger); } } - + .flexBox{ + display: flex; + align-items: center; + .requiredText{ + height: 100%; + display: flex; + align-items: center; + color: var(--el-color-danger); + margin-right: 4px; + } + } .btnBox { text-align: right; } diff --git a/src/views/order/repairListDown/index.vue b/src/views/order/repairListDown/index.vue index 5d906eb..79a0936 100644 --- a/src/views/order/repairListDown/index.vue +++ b/src/views/order/repairListDown/index.vue @@ -1,13 +1,13 @@