From 1460aa1d5f2b5722d43ed31724594c006213bea7 Mon Sep 17 00:00:00 2001
From: huang <1532065656@qq.com>
Date: 星期五, 18 四月 2025 16:40:43 +0800
Subject: [PATCH] 看板2更新

---
 UI-Project/src/views/ScanQrCodesReport/scanQrCodesReport.vue |   97 ++++++++++++++++++++----------------------------
 1 files changed, 41 insertions(+), 56 deletions(-)

diff --git a/UI-Project/src/views/ScanQrCodesReport/scanQrCodesReport.vue b/UI-Project/src/views/ScanQrCodesReport/scanQrCodesReport.vue
index 6919e53..2b575b0 100644
--- a/UI-Project/src/views/ScanQrCodesReport/scanQrCodesReport.vue
+++ b/UI-Project/src/views/ScanQrCodesReport/scanQrCodesReport.vue
@@ -17,12 +17,13 @@
 const machineId=23;//褰撳墠椤甸潰鐨勮澶嘔D
 //浣跨敤WebSocket鏂瑰紡灞曠ず鏁版嵁
 let socket = null;
-const socketUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/edging`;
+const socketUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/scanQrCodesReport`;
 // 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
 const handleMessage = (data) => {
   // 鏇存柊 tableData 鐨勬暟鎹�
   loadData.value = data.taskingList[0];
   findMachine.value = data.machine[0];
+  // console.log(data);
 };
 onUnmounted(() => {
   if (socket) {
@@ -38,41 +39,11 @@
   //浣跨敤WebSocket鏂瑰紡灞曠ず鏁版嵁
   socket = initializeWebSocket(socketUrl, handleMessage);// 鍒濆鍖� WebSocket锛屽苟浼犻�掓秷鎭鐞嗗嚱鏁�
 
+
   //浣跨敤鎺ュ彛鏂瑰紡灞曠ず鏁版嵁
   //load();
 });
 
-// //鑾峰彇鏁版嵁
-// const load = async() => {
-//   //鑾峰彇璁惧浠诲姟鏁版嵁
-//   try {
-//     const response = await request.post('/deviceInteraction/tasking/findMachineTask',
-//     {
-//       "id": 11
-//     }); // 鏇挎崲涓轰綘鐨凙PI绔偣  
-//     if (response.code === 200) {
-//       loadData.value.findTaskingData= response.data;
-//     } else {
-//       ElMessage.warning(res.msg)
-//     }
-//   } catch (error) {
-//     // console.error('Error fetching rects :', error);  
-//   }
-//   //鑾峰彇璁惧鐘舵��
-//   try {
-//     const response = await request.post('/deviceInteraction/machine/findMachine',
-//     {
-//       "id": 11
-//     }); // 鏇挎崲涓轰綘鐨凙PI绔偣  
-//     if (response.code === 200) {
-//       findMachine.value= response.data;
-//     } else {
-//       ElMessage.warning(res.msg)
-//     }
-//   } catch (error) {
-//     // console.error('Error fetching rects :', error);  
-//   }
-// }
 //淇敼宸ヤ綔鐘舵�� 銆愬け璐�/姝e湪宸ヤ綔/瀹屽伐銆�
 const workStatus = async(row,state) => {
   let url;
@@ -86,11 +57,11 @@
     return;
   }
   ElMessageBox.confirm(
-        t('marking.tips'),
+        t('functionState.tips'),
         t('delivery.prompt'),  
         {
-          confirmButtonText: t('marking.sure'),
-          cancelButtonText: t('marking.cancel'),
+          confirmButtonText: t('functionState.sure'),
+          cancelButtonText: t('functionState.cancel'),
           type: 'warning',
         }
       )
@@ -110,7 +81,7 @@
         .catch(() => {
           ElMessage({
             type: 'info',
-            message: t('marking.cancel'),
+            message: t('functionState.cancel'),
           })
         })
 
@@ -119,11 +90,11 @@
 //寮�宸�/鏆傚仠
 const machineStatus = async(state) => {
   ElMessageBox.confirm(
-        t('marking.tips'),
+        t('functionState.tips'),
         t('delivery.prompt'),  
         {
-          confirmButtonText: t('marking.sure'),
-          cancelButtonText: t('marking.cancel'),
+          confirmButtonText: t('functionState.sure'),
+          cancelButtonText: t('functionState.cancel'),
           type: 'warning',
         }
       )
@@ -144,18 +115,18 @@
         .catch(() => {
           ElMessage({
             type: 'info',
-            message: t('marking.cancel'),
+            message: t('functionState.cancel'),
           })
         })
 }
 //鐮存崯
 const damagedTask = async(row) => {
   ElMessageBox.confirm(
-        t('marking.tips'),
+        t('functionState.tips'),
         t('delivery.prompt'),  
         {
-          confirmButtonText: t('marking.sure'),
-          cancelButtonText: t('marking.cancel'),
+          confirmButtonText: t('functionState.sure'),
+          cancelButtonText: t('functionState.cancel'),
           type: 'warning',
         }
       )
@@ -175,18 +146,18 @@
         .catch(() => {
           ElMessage({
             type: 'info',
-            message: t('marking.cancel'),
+            message: t('functionState.cancel'),
           })
         })
 }
 //涓嬬嚎(鎷胯蛋)
 const glassDownLine = async(row) => {
   ElMessageBox.confirm(
-        t('marking.tips'),
+        t('functionState.tips'),
         t('delivery.prompt'),  
         {
-          confirmButtonText: t('marking.sure'),
-          cancelButtonText: t('marking.cancel'),
+          confirmButtonText: t('functionState.sure'),
+          cancelButtonText: t('functionState.cancel'),
           type: 'warning',
         }
       )
@@ -206,7 +177,7 @@
         .catch(() => {
           ElMessage({
             type: 'info',
-            message: t('marking.cancel'),
+            message: t('functionState.cancel'),
           })
         })
 }
@@ -219,14 +190,14 @@
 <template>
   <div ref="content" style="padding:0 20px;">
     <div id="div-title" style="font-size: 20px; font-weight: bold; margin:10px 0 10px 0;padding-left: 20px;">
-      {{$t('machine.edging')}}
+      {{$t('machine.scanQrCodesReport')}}
     </div>
     <hr />
     <br>
     <div id="search" >
       <!-- 鍔熻兘 -->
-      <el-button type="primary" id="ButtonMachineStatus" @click="machineStatus((findMachine['state']=='鏆傚仠'?'寮�宸�':'鏆傚仠'))">{{findMachine['state']=='寮�宸�'?$t('functionState.start'):$t('functionState.stop')}}</el-button>
-      <el-button type="primary" id="ButtonTopLine" @click="topLine">{{$t('functionState.topLine')}}</el-button>
+      <!-- <el-button :type="(findMachine['state']=='鏆傚仠'?'danger':'success')" id="ButtonMachineStatus" @click="machineStatus((findMachine['state']=='鏆傚仠'?'寮�宸�':'鏆傚仠'))">{{findMachine['state']=='寮�宸�'?$t('functionState.start'):$t('functionState.stop')}}</el-button>
+      <el-button type="primary" id="ButtonTopLine" @click="topLine">{{$t('functionState.topLine')}}</el-button> -->
       <!-- <el-button type="primary" id="searchButton" @click="downLine('涓嬬嚎')">涓嬬嚎</el-button>
       <el-button type="primary" id="searchButton" @click="workStatus('鐮存崯')">鐮存崯</el-button>
       <el-button type="primary" id="searchButton" @click="workStatus('瀹屽伐')">瀹屽伐</el-button> -->
@@ -245,27 +216,41 @@
         <el-table-column prop="width" :label="$t('glassInfo.width')"/>
         <el-table-column prop="thickness" :label="$t('glassInfo.thickness')"/>
         <el-table-column prop="workState" :label="$t('glassInfo.workState')"/>
-        <el-table-column fixed="right" :label="$t('productStock.operate')" align="center" width="270">
+        <!-- <el-table-column fixed="right" :label="$t('productStock.operate')" align="center" width="270">
           <template #default="scope">
             <el-button size="mini" link type="primary" plain @click="workStatus(scope.row, '閲嶅彂')" >{{$t('functionState.anew')}}</el-button>
             <el-button size="mini" link type="primary" plain @click="workStatus(scope.row, '瀹屽伐')">{{$t('functionState.finish')}}</el-button>
             <el-button size="mini" link type="primary" plain @click="damagedTask(scope.row)">{{$t('functionState.lose')}}</el-button>
             <el-button size="mini" link type="primary" plain @click="glassDownLine(scope.row)">{{$t('functionState.downLine')}}</el-button>
           </template>
-        </el-table-column>
+        </el-table-column> -->
       </el-table>
     </div>
 
-    <div id="main-body"
-      style="width: 50%; height: 460px; margin: auto;background-image: url(../../src/assets/鎵爜璇嗗埆.png) ;background-size: 100% 100%;">
+    <div id="main-body1" 
+      style="width: 70%; height: 400px;margin:20px auto;background-size: 100% 100%;">
       <!-- 鐢诲浘鍐呭 -->
-      <div style="width: 150px; height: 100px; background-color: red; position: relative; top: 171px; left: 328px">
+      <div :style="{
+        width: loadData.length > 0 ? loadData[0]['length'] + 'px' : '200px',
+        height: loadData.length > 0 ? loadData[0]['width'] + 'px' : '100px',
+        backgroundColor: 'red',
+        position: 'relative',
+        top: '60px', 
+        left: '28px',
+        textAlign: 'center'
+      }">
+        <p v-if="loadData.length > 0">{{ loadData[0]['scanId'] }}</p>
+        <p v-if="loadData.length > 0">
+          {{ loadData[0]['length'] }} * {{ loadData[0]['width'] }}
+        </p>
+        <p v-else>鏆傛棤鏁版嵁</p> <!-- 鍙�夛細鏄剧ず榛樿娑堟伅 -->
       </div>
     </div>
   </div>
 </template>
 
 <style scoped>
+
 table {
   text-align: center;
   width: 100%;

--
Gitblit v1.8.0