From d5d0d1c7a84b996b9bbcebfaf2c2c95f1a5a3678 Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期五, 11 十月 2024 08:39:15 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 UI-Project/src/views/GlassStorage/MaterialRackManagement.vue |   21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/UI-Project/src/views/GlassStorage/MaterialRackManagement.vue b/UI-Project/src/views/GlassStorage/MaterialRackManagement.vue
index 6ca0948..7a0d18c 100644
--- a/UI-Project/src/views/GlassStorage/MaterialRackManagement.vue
+++ b/UI-Project/src/views/GlassStorage/MaterialRackManagement.vue
@@ -4,7 +4,7 @@
       <div
         slot="header"
         class="clearfix"
-        style="display: flex; align-items: center"
+        style="display: flex; align-items: center;margin-top: -20px;"
       >
         <!-- 宸︿晶鎸夐挳缁� -->
         <div>
@@ -16,9 +16,8 @@
           >
           <el-button type="success" size="mini">鍚婅浣嶅叆搴�</el-button>
         </div>
-
         <!-- 鍙充晶閫夋嫨妗� -->
-        <el-form-item style="margin-top: 15px; width: 150px">
+        <el-form-item style="margin-top: 15px; width: 150px;margin-left: 10px;">
           <el-select v-model="formData2.dzw" placeholder="璇烽�夋嫨鍚婅浣�">
             <el-option label="鍚婅浣�1" value="鍚婅浣�1"></el-option>
             <el-option label="鍚婅浣�2" value="鍚婅浣�2"></el-option>
@@ -330,7 +329,7 @@
 
 
 <script setup>
-import { ref, onMounted, onBeforeUnmount } from "vue"; // 瀵煎叆 Vue 3 鐨勬ā鍧�
+import { ref, onMounted, onBeforeUnmount,onUnmounted } from "vue"; // 瀵煎叆 Vue 3 鐨勬ā鍧�
 //import * as echarts from 'echarts';
 import { ElMessage, ElMessageBox } from "element-plus";
 // import {tableData} from '@/stores/tableData.js';
@@ -393,6 +392,7 @@
   row.enableState = 1 - row.enableState; // Toggle between 0 and 1
   // 姝ゅ鍙互娣诲姞淇濆瓨鐘舵�佺殑閫昏緫锛屾瘮濡傝皟鐢� API 鏇存柊鏁版嵁
 };
+let socket = null;
 const socketUrl = `ws://${WebSocketHost}:${host}/api/glassStorage/api/talk/storageTask`;
 // 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
 const handleMessage = (data) => {
@@ -429,16 +429,15 @@
     // 鏇挎崲鍘熸潵鐨� createTime 瀛楁涓烘牸寮忓寲鍚庣殑鏃ユ湡鏃堕棿瀛楃涓�
     item.startTime = formattedDateTime;
   });
-
-
-
-
-
 };
-
 onMounted(() => {
-  initializeWebSocket(socketUrl, handleMessage);
+  socket = initializeWebSocket(socketUrl, handleMessage);
 });
+  onUnmounted(() => {
+    if (socket) {
+    closeWebSocket(socket);
+    }
+    });
 onBeforeUnmount(() => {
   console.log("鍏抽棴浜�");
   closeWebSocket();

--
Gitblit v1.8.0