From eae89f75a208938dba8787a73f68a8ae2e44e165 Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期一, 23 十二月 2024 10:20:37 +0800
Subject: [PATCH] 1、指定钢化工程接口

---
 UI-Project/src/views/Caching/cachingbefore.vue |   74 ++++++++++++------------------------
 1 files changed, 25 insertions(+), 49 deletions(-)

diff --git a/UI-Project/src/views/Caching/cachingbefore.vue b/UI-Project/src/views/Caching/cachingbefore.vue
index e4c67f3..f97f343 100644
--- a/UI-Project/src/views/Caching/cachingbefore.vue
+++ b/UI-Project/src/views/Caching/cachingbefore.vue
@@ -1,37 +1,27 @@
 <script setup>
-import {Search} from "@element-plus/icons-vue";
-import {reactive} from "vue";
+import {onBeforeUnmount, onMounted, onUnmounted, ref} from "vue";
 import {useRouter} from "vue-router"
-const router = useRouter()
-const adda = ref(false)
-import { WebSocketHost ,host} from '@/utils/constants'
-
+import {host, WebSocketHost} from '@/utils/constants'
 import request from "@/utils/request"
-import { ref, onMounted , onBeforeUnmount,onUnmounted} from "vue";
-import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
-// import { ref } from 'vue'
-import { ElMessage, ElMessageBox } from 'element-plus'
-//  import LanguageMixin from './lang/LanguageMixin'
-
-import { useI18n } from 'vue-i18n'
-  const { t } = useI18n()
-  let language = ref(localStorage.getItem('lang') || 'zh')
+import {closeWebSocket, initializeWebSocket} from '@/utils/WebSocketService';
+import {ElMessage, ElMessageBox} from 'element-plus'
+import {useI18n} from 'vue-i18n'
+const {t} = useI18n()
+let language = ref(localStorage.getItem('lang') || 'zh')
 const tableData = ref([])
 const slot = ref('')
 const adjustedRects = ref([]);
-onMounted(async () => {  
-  try {  
-    const response = await request.post('/cacheGlass/edgStorageCage/selectEdgStorageCage'); // 鏇挎崲涓轰綘鐨凙PI绔偣  
-    if (response.code === 200) {  
-      const rawRects = response.data; // 璁剧疆鐭╁舰鏁版嵁  
-          tableData.value = response.data
-          console.log(response.data);
-          adjustedRects.value = rawRects.map(rect => ({  
-            ...rect, // 澶嶅埗鍘熷瀵硅薄鐨勫叾浠栧睘鎬�  
-            width: rect.width * 0.5 ,
-            id: rect.id * 10,
-          })); 
-          console.log(adjustedRects.value);
+onMounted(async () => {
+  try {
+    const response = await request.post('/cacheGlass/edgStorageCage/selectEdgStorageCage');
+    if (response.code === 200) {
+      const rawRects = response.data;
+      tableData.value = response.data
+      adjustedRects.value = rawRects.map(rect => ({
+        ...rect,
+        width: rect.width * 0.5 ,
+        id: rect.id * 10,
+      }));
     } else {  
       ElMessage.warning(res.msg)
     }  
@@ -41,7 +31,6 @@
 }); 
 const toggleEnableState = async (row) => {  
   const newState = row.enable_state === 1 ? 0 : 1;
-  // 鍙戦�佽姹傚埌鍚庣鏇存柊鐘舵�侊紙杩欓噷鐪佺暐浜嗗疄闄呯殑璇锋眰閫昏緫锛�  
   const response = await request.post('/cacheGlass/edgStorageCage/updateEdgStorageCage', { id: row.id, enableState: newState });  
   if (response.code === 200) {
       ElMessage.success(response.message);
@@ -63,9 +52,8 @@
     );  
     if (confirmResult === 'confirm') {  
       var url="/cacheGlass/edgStorageCage/edgStorageCageGlass?edgStorageCageId="+row.id;
-      console.log(url);
       const response = await request.post(url, {
-        esdId: row.esdId
+        glassId:row.glass_id
     })
     if (response.code === 200) {
       ElMessage.success(response.message);
@@ -79,17 +67,13 @@
 };   
 let socket = null;
 const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlass`;
-// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
 const handleMessage = (data) => {
-  // 鏇存柊 tableData 鐨勬暟鎹�
   tableData.value = data.EdgStorageCageinfos[0]
-  // adjustedRects.value = data.EdgStorageCageinfos[0]
   adjustedRects.value = data.EdgStorageCageinfos[0].map(rect => ({  
-            ...rect, // 澶嶅埗鍘熷瀵硅薄鐨勫叾浠栧睘鎬�  
-            width: rect.width * 0.5 ,
-            id: rect.id * 10,
-          })); 
-
+      ...rect,
+      width: rect.width * 0.5 ,
+      id: rect.id * 10,
+    })); 
 };
 // 鍒濆鍖� WebSocket锛屽苟浼犻�掓秷鎭鐞嗗嚱鏁�
 onMounted(() => {
@@ -105,12 +89,11 @@
   closeWebSocket();
 });
 </script>
-
 <template>
   <div style="height: 500px;">
     <el-card style="flex: 1;margin-left: 10px;margin-top: 20px;" v-loading="loading">
       <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;">
-        <el-table height="240" ref="table" 
+        <el-table height="340" ref="table" 
         @selection-change="handleSelectionChange"
         :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}">
           <el-table-column prop="slot" align="center" :label="$t('sorter.gridnumber')" min-width="80" />
@@ -130,14 +113,10 @@
           >  
             {{ scope.row.enable_state === 1 ?  $t('sorter.start') : $t('sorter.disable') }}
           </el-tag>  
-        </template> 
-          <!-- <template #default="scope">
-            <el-tag type="success" >{{ scope.row.enable_state==1?"鍚敤":"鏈惎鐢�"  }}</el-tag>
-          </template> -->
+        </template>
           </el-table-column>
           <el-table-column fixed="right" :label="$t('sorter.operate')" align="center" width="200">
             <template #default="scope">
-              <!-- <el-button size="mini" type="text" plain @click="handleBindRacka(scope.row)">鎶ョ己</el-button> -->
               <el-button size="mini" type="text" plain  @click="open(scope.row)">{{ $t('sorter.deficiencieste') }}</el-button>
             </template>
         </el-table-column>
@@ -160,9 +139,7 @@
 </div>
 </div>
 </template>
-
 <style scoped>
-
 #dt { display:block; float:left;line-height: 20px;margin-left: 100px;}
 #dta { display:block; float:left;line-height: 20px;margin-left: 80%;}
 #dialog-footer{
@@ -183,5 +160,4 @@
   width: 1500px;
   max-width: 100%;
 }
-
 </style>

--
Gitblit v1.8.0