From e46aa927d231af83724683c7286d9db503e24cf7 Mon Sep 17 00:00:00 2001
From: z8018 <1282578289@qq.com>
Date: 星期二, 10 六月 2025 11:46:20 +0800
Subject: [PATCH] 1

---
 项目代码/WCS/WIDESEAWCS_Client/src/views/bigdata.vue |  108 ++++++++++++++++++++++++++++--------------------------
 1 files changed, 56 insertions(+), 52 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Client/src/views/bigdata.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Client/src/views/bigdata.vue"
index ffbeb73..28c4c25 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Client/src/views/bigdata.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Client/src/views/bigdata.vue"
@@ -7,7 +7,7 @@
       :id="item.stationCode"
       @click="handleClick"
     >
-      <h1>{{ item.stationCode }}--{{ item.orderData.length > 0 ?item.orderData[0].orderCode +"-"+ item.orderData[0].cusName + "-" +item.orderData[0].orderName : '鏆傛棤璁㈠崟'}}</h1>
+      <h1>{{ item.stationCode }}--{{ item.orderData.length > 0 ?item.orderCode +"-"+ item.cusName + "-" +item.orderName : '鏆傛棤璁㈠崟'}}</h1>
       <!-- <h1></h1> -->
       <div class="bigdata-content">
         <div class="content-item" :data-value="item.stationSortedNum">宸ヤ綅鏁�</div>
@@ -19,20 +19,18 @@
         <table>
           <thead>
             <tr>
-              <th>璁㈠崟鍙�</th>
-              <th>瀹㈡埛鍚�</th>
-              <th>璁㈠崟鍚�</th>
-              <th>鎵规</th>
               <th>宸ヤ欢鍚�</th>
+              <th>鐗╂枡鍚�</th>
+              <th>灏哄</th>
+              <th>宸ュ簭</th>
             </tr>
           </thead>
           <tbody>
             <tr v-for="(order,index) in item.orderData" :key="index">
-              <td>{{ order.orderCode }}</td>
-              <td>{{ order.cusName }}</td>
-              <td>{{ order.orderName }}</td>
-              <td>{{ order.batch }}</td>
-              <td>{{ order.productName }}</td>
+              <td>{{ order.name }}</td>
+              <td>{{ order.baseName }}</td>
+              <td>{{ order.size }}</td>
+              <td>{{ order.process }}</td>
             </tr>
           </tbody>
         </table>
@@ -204,13 +202,12 @@
       this.contentData.find(
         item => item.stationCode === stationCode
       ).stationSortedNum = 0;
-      his.contentData.find(
+      this.contentData.find(
         item => item.stationCode === stationCode
       ).orderData = [];
     },
     createSocket(url) {
       // 鍒涘缓WebSocket杩炴帴
-      //"ws://127.0.0.1:9295/admin"
       this.client = new WebSocket(url);
       var _this = this; // 淇濆瓨this鐨勫紩鐢�
       this.client.onopen = function() {
@@ -226,50 +223,57 @@
       this.client.onerror = function() {};
     },
     handleMessage(event) {
+      console.log(this.contentData);
       const data = JSON.parse(event.data);
-      console.log("鏀跺埌娑堟伅锛�", event.data);
-      if (data.release == 1) {
+      if (data.release === 1) {
         this.clearStationContent(data.stationCode);
-        this.modalOverlay(data.stationCode, true); // 鏄剧ず閬僵灞�
-        for (let i = 0; i < this.contentData.length; i++) {
-          if (this.contentData[i].orderId === data.data.orderId) {
-            this.clearStationContent(this.contentData[i].stationCode);
-            this.modalOverlay(this.contentData[i].stationCode, true); // 鏄剧ず閬僵灞�
-          }
-        }
-      } else if (data.release == 2) {
-        this.clearStationContent(data.stationCode);
-        this.modalOverlay(data.stationCode, false); // 闅愯棌閬僵灞�
-        for (let i = 0; i < this.contentData.length; i++) {
-          if (this.contentData[i].orderId === data.data.orderId) {
-            this.clearStationContent(this.contentData[i].stationCode);
-            this.modalOverlay(this.contentData[i].stationCode, false); // 闅愯棌閬僵灞�
-          }
-        }
       } else {
-        this.contentData
-          .find(item => item.stationCode === data.stationCode)
-          .orderData.push(data.data.orderData);
+        const stationCode = data.stationCode;
+        const orderData = data.orderData;
+        const orderTotalNum = data.orderTotalNum;
+        const sortedNum = data.sortedNum;
+        const unsortedNum = data.unsortedNum;
+        const stationSortedNum = data.stationSortedNum;
+        const orderCode = data.orderCode;
+        const cusName = data.cusName;
+        const orderName = data.orderName;
+        const orderId = data.orderId;
         this.contentData.find(
-          item => item.stationCode === data.stationCode
-        ).orderTotalNum = data.data.orderTotalNum;
+          item => item.stationCode === stationCode
+        ).orderId = orderId;
         this.contentData.find(
-          item => item.stationCode === data.stationCode
-        ).sortedNum = data.data.sortedNum;
+          item => item.stationCode === stationCode
+        ).orderCode = orderCode;
         this.contentData.find(
-          item => item.stationCode === data.stationCode
-        ).unsortedNum = data.data.unsortedNum;
+          item => item.stationCode === stationCode
+        ).cusName = cusName;
         this.contentData.find(
-          item => item.stationCode === data.stationCode
-        ).stationSortedNum = data.data.stationSortedNum;
+          item => item.stationCode === stationCode
+        ).orderName = orderName;
+        this.contentData.find(
+          item => item.stationCode === stationCode
+        ).orderData = orderData;
+        this.contentData.find(
+          item => item.stationCode === stationCode
+        ).orderTotalNum = orderTotalNum;
+        this.contentData.find(
+          item => item.stationCode === stationCode
+        ).sortedNum = sortedNum;
+        this.contentData.find(
+          item => item.stationCode === stationCode
+        ).unsortedNum = unsortedNum;
+        this.contentData.find(
+          item => item.stationCode === stationCode
+        ).stationSortedNum = stationSortedNum;
 
-        for (let i = 0; i < this.contentData.length; i++) {
-          if (this.contentData[i].orderId === data.data.orderId) {
-            this.contentData[i].sortedNum = data.data.sortedNum;
-            this.contentData[i].unsortedNum = data.data.unsortedNum;
+        this.handleBackgroundColor(stationCode);
+
+        this.contentData.forEach(item => {
+          if (item.orderId === orderId) {
+            item.sortedNum = sortedNum;
+            item.unsortedNum = unsortedNum;
           }
-        }
-        this.handleBackgroundColor(data.stationCode);
+        });
       }
     },
     getStations(deviceCode) {
@@ -292,7 +296,7 @@
 .modal-overlay {
   display: none; /* 榛樿涓嶆樉绀� */
   position: fixed; /* 鍏ㄥ睆瀹氫綅 */
-  background-color: rgba(0, 0, 0, 0.5); /* 鍗婇�忔槑榛戣壊閬僵 */
+  background-color: rgba(0, 0, 0, 1); /* 鍗婇�忔槑榛戣壊閬僵 */
   z-index: 5; /* 纭繚閬僵鍦ㄥ唴瀹逛箣涓� */
   opacity: 1; /* 鍒濆瀹屽叏涓嶉�忔槑 */
   animation: modal-overlay 1.5s infinite; /* 1绉掗棯鐑佷竴娆★紝鏃犻檺娆¢噸澶� */
@@ -337,10 +341,10 @@
   width: 100%;
   height: 100%;
   display: grid;
-  grid-template-columns: repeat(3, 1fr);
+  grid-template-columns: repeat(2, 1fr);
   grid-template-rows: repeat(2, 1fr);
   gap: 5px;
-  padding: 5px;
+  padding: 10px;
   background: #f8f9fa;
 }
 
@@ -439,7 +443,7 @@
 .content-item::after {
   content: attr(data-value);
   color: #2d8cf0;
-  font-size: 30px;
+  font-size: 50px;
   font-weight: 800;
   margin-top: 12px;
   text-shadow: 0 2px 4px rgba(45, 140, 240, 0.15);
@@ -580,7 +584,7 @@
 .bigdata-table td:first-child {
   font-weight: 500;
   color: #2d8cf0;
-  text-align: left; /* 棣栧垪淇濇寔宸﹀榻� */
+  text-align: center; /* 棣栧垪淇濇寔宸﹀榻� */
   padding-left: 5px; /* 澧炲姞宸︿晶闂磋窛 */
 }
 

--
Gitblit v1.9.3