From 2d53c6ee0f6e8c3cfa4f6645ee5b3d17558e2f90 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Mon, 24 Feb 2025 14:17:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4websocket=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E5=A4=B1=E8=B4=A5=E6=97=B6=E7=9A=84=E5=BC=B9?= =?UTF-8?q?=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/websocket.ts | 40 +-- .../tool/Instead/components/keyboard.vue | 328 +++++++++++++++++ .../Instead/components/popup-weight-goods.vue | 330 ++++++++++++++++++ src/views/tool/Instead/index.vue | 7 + 4 files changed, 683 insertions(+), 22 deletions(-) create mode 100644 src/views/tool/Instead/components/keyboard.vue create mode 100644 src/views/tool/Instead/components/popup-weight-goods.vue diff --git a/src/utils/websocket.ts b/src/utils/websocket.ts index 3a2d7ce..a7fba09 100644 --- a/src/utils/websocket.ts +++ b/src/utils/websocket.ts @@ -58,19 +58,17 @@ class WebSocketManager { this.client.onopen = () => { this.connected = true; console.log("WebSocket 连接已建立"); - ElNotification.success('WebSocket 连接已建立') + // ElNotification.success('WebSocket 连接已建立') this.sendMessage(this.initParams) }; this.client.onclose = () => { if (!this.connected) { - ElMessageBox.alert('WebSocket 连接已断开', 'Title', { - // if you want to disable its autofocus - // autofocus: false, - confirmButtonText: '立即重连', - callback: () => { - this.sendMessage(this.initParams) - }, - }) + // ElMessageBox.alert('WebSocket 连接已断开', 'Title', { + // confirmButtonText: '立即重连', + // callback: () => { + // this.sendMessage(this.initParams) + // }, + // }) } this.connected = false; console.log("WebSocket 连接已断开"); @@ -78,19 +76,17 @@ class WebSocketManager { }; this.client.onerror = (error) => { console.error("WebSocket 发生错误:", error); - ElNotification({ - title: "提示", - message: "WebSocket 发生错误", - type: "error", - }); - ElMessageBox.alert('WebSocket 发生错误', 'Title', { - // if you want to disable its autofocus - // autofocus: false, - confirmButtonText: '立即重连', - callback: () => { - this.sendMessage(this.initParams) - }, - }) + // ElNotification({ + // title: "提示", + // message: "WebSocket 发生错误", + // type: "error", + // }); + // ElMessageBox.alert('WebSocket 发生错误', 'Title', { + // confirmButtonText: '立即重连', + // callback: () => { + // this.sendMessage(this.initParams) + // }, + // }) }; this.client.onmessage = (event) => { const message = event.data; diff --git a/src/views/tool/Instead/components/keyboard.vue b/src/views/tool/Instead/components/keyboard.vue new file mode 100644 index 0000000..1a2c624 --- /dev/null +++ b/src/views/tool/Instead/components/keyboard.vue @@ -0,0 +1,328 @@ + + + + \ No newline at end of file diff --git a/src/views/tool/Instead/components/popup-weight-goods.vue b/src/views/tool/Instead/components/popup-weight-goods.vue new file mode 100644 index 0000000..496abb9 --- /dev/null +++ b/src/views/tool/Instead/components/popup-weight-goods.vue @@ -0,0 +1,330 @@ + + + + + \ No newline at end of file diff --git a/src/views/tool/Instead/index.vue b/src/views/tool/Instead/index.vue index e4298fd..bcb7cc4 100644 --- a/src/views/tool/Instead/index.vue +++ b/src/views/tool/Instead/index.vue @@ -307,10 +307,17 @@ function goodsClick(item) { product_name: "", remark: "", }); + return; } // 多规格 if (item.type == "sku") { refSelSku.value.open(item); + return; + } + //称重 + if (item.type == "sku") { + refSelSku.value.open(item); + return; } }