From 06fd17d2a1c0155e6432b2bce7e644a119fc77b5 Mon Sep 17 00:00:00 2001
From: wuyouming666 <2265557248@qq.com>
Date: 星期三, 05 六月 2024 08:25:03 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/HangZhouMes

---
 UI-Project/src/views/Returns/returns.vue |   37 ++++++++-----------------------------
 1 files changed, 8 insertions(+), 29 deletions(-)

diff --git a/UI-Project/src/views/Returns/returns.vue b/UI-Project/src/views/Returns/returns.vue
index dd2b52c..2aadf11 100644
--- a/UI-Project/src/views/Returns/returns.vue
+++ b/UI-Project/src/views/Returns/returns.vue
@@ -13,7 +13,7 @@
 const adda = ref(false)
 const flake = ref(false)
 const flakea = ref(false)
-import { WebSocketHost } from '@/utils/constants'
+import { WebSocketHost ,host} from '@/utils/constants'
 import request from "@/utils/request"
 const ida = ref(null); 
 import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
@@ -25,9 +25,9 @@
 const selectedValuea = ref('');  
 const selectedValueb = ref('');
 const selectedValuec = ref(''); 
-const upstatus = ref(''); // 鍋囪杩欎釜鐢ㄤ簬鏄剧ず鑷姩/鎵嬪姩鐘舵��  
+const upstatus = ref('涓婄墖鏈烘墜鍔ㄧ姸鎬侊細'); // 鍋囪杩欎釜鐢ㄤ簬鏄剧ず鑷姩/鎵嬪姩鐘舵��  
 const cuttingMachine = ref(''); // 鍋囪杩欎釜鐢ㄤ簬瀛樺偍鍚庣杩斿洖鐨勭姸鎬佸�硷紙0鎴�1锛�  
-const cuttingMachineStatusColor = ref(''); // 鐢ㄤ簬鍔ㄦ�佽缃甶鏍囩鐨勮儗鏅壊 
+const cuttingMachineStatusColor = ref('#911005'); // 鐢ㄤ簬鍔ㄦ�佽缃甶鏍囩鐨勮儗鏅壊 
 const inKageWord = ref(0); // 鐢ㄤ簬瀛樺偍瑕佷紶閫掔粰鎺ュ彛鐨刬nKageWord鍊� 
 const options = ref<any[]>([]); // 涓嬫媺閫夐」鍒楄〃  
 const selectOptions = ref<Array<any>>([]); // 涓嬫媺閫夐�夐」鏁扮粍  
@@ -102,7 +102,7 @@
 const titleSelectJsona = ref({
   processTypea: [],
 })
-const socketUrl = `ws://10.153.19.150:88/api/loadGlass/api/talk/loadGlass`;
+const socketUrl = `ws://${WebSocketHost}:${host}/api/loadGlass/api/talk/loadGlass`;
 // 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
 const handleMessage = (data) => {
   // 鏇存柊 tableData 鐨勬暟鎹�
@@ -497,7 +497,7 @@
 
 
 
-const wsUrl = 'ws://10.153.19.150:88/api/loadGlass/api/talk/loadGlass'; 
+const wsUrl = `ws://${WebSocketHost}:${host}/api/loadGlass/api/talk/loadGlass`;
 const ws = new WebSocket(wsUrl);  
 ws.onopen = () => {  
   console.log('WebSocket杩炴帴宸叉墦寮�');  
@@ -519,16 +519,14 @@
   
 // 鐩戝惉WebSocket鐨勬秷鎭簨浠�  
 ws.onmessage = (event) => {  
-  // 鍋囪鏈嶅姟鍣ㄥ彂閫佺殑鏄疛SON鏍煎紡鐨勫瓧绗︿覆  
   try {  
     const data = JSON.parse(event.data); // 瑙f瀽娑堟伅涓篔SON  
   
-    // 鍋囪鏈嶅姟鍣ㄥ彂閫佺殑鏁版嵁缁撴瀯鏄� { InkageStatus: ["1"] }  
     if (data && Array.isArray(data.InkageStatus) && data.InkageStatus.length > 0) {  
       const status = data.InkageStatus[0]; 
       cuttingMachine.value = status; 
       upstatus.value = status === '1' ? '涓婄墖鏈鸿仈鏈虹姸鎬侊細' : '涓婄墖鏈烘墜鍔ㄧ姸鎬侊細';
-      cuttingMachineStatusColor.value = status === '1' ? '#911005' : 'green';  
+      cuttingMachineStatusColor.value = status === '1' ? 'green' : '#911005';  
       inKageWord.value = status === '1' ? 0 : 1;  
     } else {  
       // 澶勭悊閿欒鎯呭喌鎴栨棤鏁堟暟鎹�  
@@ -546,7 +544,7 @@
     if (response.code == 200) {  
       const status = response.data.status; 
       upstatus.value = status === '1' ? '涓婄墖鏈鸿仈鏈虹姸鎬侊細' : '涓婄墖鏈烘墜鍔ㄧ姸鎬侊細';  
-      cuttingMachineStatusColor.value = status === '1' ? '#911005' : 'green';  
+      cuttingMachineStatusColor.value = status === '1' ? 'green' : '#911005';  
       // 鏄剧ず鎴愬姛娑堟伅  
       ElMessage.success(response.message);  
     } else {  
@@ -558,25 +556,6 @@
     ElMessage.error('璇锋眰鏃跺彂鐢熼敊璇�');  
   }  
 };
-// const confirmCutting = async () => {
-//   try  {
-//   const response = await request.post('/loadGlass/LoadGlass/updateMesInkageLoad', {
-//     inKageWord: inKageWord.value
-//     })
-//     if (response.code == 200) {
-//       inKageWord == '1' ? '涓婄墖鏈鸿仈鏈虹姸鎬侊細' : '涓婄墖鏈烘墜鍔ㄧ姸鎬侊細';
-//       inKageWord.value == '1' ? '#911005' : 'green';  
-//       ElMessage.success(response.message);
-//     } else {
-//       // 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭�
-//       ElMessage.error(response.msg);
-//     }
-// }
-// catch (error) {
-//     // 澶勭悊閿欒
-//     console.error(error);
-//   }
-// }
 </script>
  
 <template>
@@ -596,7 +575,7 @@
     <el-button style="margin-top: 5px;margin-left: 15px;"   id="searchButton" type="primary" @click="dialogFormVisible = true">閫夋嫨宸ョ▼</el-button>
     <el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="primary" @click="handleBind">寮�濮嬩笂鐗�</el-button>
     <el-button style="margin-top: 5px;margin-left: 20px;"  id="searchButton" type="warning" @click="handleBinda">鏆傚仠</el-button>
-    <el-button style="margin-top: 5px;margin-left: 20px;"  id="searchButton" type="danger" @click="handleBindb">鍋滄浠诲姟</el-button>
+    <!-- <el-button style="margin-top: 5px;margin-left: 20px;"  id="searchButton" type="danger" @click="handleBindb">鍋滄浠诲姟</el-button> -->
     
     <el-card style="flex: 1;margin-left: 10px;margin-top: 15px;" v-loading="loading">
       <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;">

--
Gitblit v1.8.0