From 0958c3c13aea022975193afcff4b6b2c9a06f334 Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期二, 04 六月 2024 11:44:56 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 UI-Project/src/views/Slicecage/slicecage.vue |  178 +++++++++++++++++++++++++----------------------------------
 1 files changed, 75 insertions(+), 103 deletions(-)

diff --git a/UI-Project/src/views/Slicecage/slicecage.vue b/UI-Project/src/views/Slicecage/slicecage.vue
index 2b36cd4..eccab95 100644
--- a/UI-Project/src/views/Slicecage/slicecage.vue
+++ b/UI-Project/src/views/Slicecage/slicecage.vue
@@ -3,6 +3,7 @@
 import {reactive} from "vue";
 import {useRouter} from "vue-router"
 const router = useRouter()
+import { WebSocketHost } from '@/utils/constants'
  
 import { ref, onMounted , onBeforeUnmount} from "vue";
 import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
@@ -15,6 +16,9 @@
 const tableDatab = ref([])
 const tableDatac = ref([])
 const tableDatad = ref([])
+const tableDatae = ref([])
+const adjustedRects = ref([]);
+const height = ref([]);
  
 const carposition1 = ref(60);
 const carposition2 = ref(220);
@@ -24,7 +28,6 @@
 const timers2 =ref(true);
 const timers3 =ref(true);
 const timers4 =ref(true);
-const cellshow=ref(false);
 const cellshow5=ref(false);
 const c1=ref(false);
 const c2=ref(false);
@@ -36,6 +39,14 @@
 const million1=ref(0);
 const million3=ref(0);
 const million4=ref(0);
+const cell1=ref(true);
+const cell2=ref(true);
+const cell3=ref(true);
+const cell4=ref(true);
+const cell5=ref(true);
+const cell6=ref(true);
+const cell7=ref(true);
+const cell8=ref(true);
  
 const currentPage4 = ref(4)
 const pageSize4 = ref(100)
@@ -97,13 +108,7 @@
       }
     }else{
       million1.value=million.value;
-      if(cellshow.value==true){
-        cellshow.value=false;
-        
-      }else{
-        cellshow.value=true;
-        
-      }
+    
       if(cellshow1.value==true){
         cellshow1.value=false;
       }else{
@@ -187,7 +192,7 @@
 }
  
 
-const socketUrl = `ws://10.153.19.150:88/api/cacheVerticalGlass/api/talk/slicecage`;
+const socketUrl = `ws://${WebSocketHost}:88/api/cacheVerticalGlass/api/talk/slicecage`;
 // 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
 const handleMessage = (data) => {
   // 鏇存柊 tableData 鐨勬暟鎹�
@@ -195,8 +200,21 @@
   tableDatad.value = data.bigStorageCageDetailsFeedTask[0]
   tableData.value = data.bigStorageCageInfo[0]
   tableDatab.value = data.temperingGlassInfoList[0]
-
+  tableDatae.value = data.bigStorageCageUsage[0]
+  adjustedRects.value = data.bigStorageCageInfo1[0]
+  // adjustedRects.value = data.bigStorageCageInfo1[0].map(rect => ({  
+  //           ...rect, // 澶嶅埗鍘熷瀵硅薄鐨勫叾浠栧睘鎬�  
+  //           height: rect.length *0.5,
+            
+  //         })); 
+  window.localStorage.setItem('length', data.bigStorageCageInfo1[0].length)
+  let length = window.localStorage.getItem('length')
+  console.log(length);
+  
 };
+// function getRectHeight(length: number) {  
+//   return length > 0 ? 29 / length : 29;
+// } 
 // 鍒濆鍖� WebSocket锛屽苟浼犻�掓秷鎭鐞嗗嚱鏁�
 onMounted(() => {
   // fetchFlowCardId();
@@ -313,96 +331,16 @@
       </div>
     </el-card>
     <div style="padding: 10px;display: flex;height:110px;">
-      <div  id="occupy">
-                    <el-col style="text-align:left;font-weight: bold;">#1</el-col>
-                    <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
-                        <span id="biao">浣跨敤鐜�</span><span id="zhi">35%</span>
-                    </el-col>
-                    <hr style="width:80%;margin: 0 auto;" />
-                    <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
-                        <span id="biao">绌洪棽锛堟牸瀛愭暟锛�</span><span id="zhi">555</span>
-                    </el-col>
-                </div> 
-                <div  id="occupy">
-                    <el-col style="text-align:left;font-weight: bold;">#2</el-col>
-                    <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
-                        <span id="biao">浣跨敤鐜�</span><span id="zhi">35%</span>
-                    </el-col>
-                    <hr style="width:80%;margin: 0 auto;" />
-                    <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
-                        <span id="biao">绌洪棽锛堟牸瀛愭暟锛�</span><span id="zhi">555</span>
-                    </el-col>
-                </div> 
-                <div  id="occupy">
-                    <el-col style="text-align:left;font-weight: bold;">#3</el-col>
-                    <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
-                        <span id="biao">浣跨敤鐜�</span><span id="zhi">35%</span>
-                    </el-col>
-                    <hr style="width:80%;margin: 0 auto;" />
-                    <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
-                        <span id="biao">绌洪棽锛堟牸瀛愭暟锛�</span><span id="zhi">555</span>
-                    </el-col>
-                </div> 
-                <div  id="occupy">
-                    <el-col style="text-align:left;font-weight: bold;">#4</el-col>
-                    <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
-                        <span id="biao">浣跨敤鐜�</span><span id="zhi">35%</span>
-                    </el-col>
-                    <hr style="width:80%;margin: 0 auto;" />
-                    <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
-                        <span id="biao">绌洪棽锛堟牸瀛愭暟锛�</span><span id="zhi">555</span>
-                    </el-col>
-                </div> 
-                <div  id="occupy">
-                    <el-col style="text-align:left;font-weight: bold;">#5</el-col>
-                    <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
-                        <span id="biao">浣跨敤鐜�</span><span id="zhi">35%</span>
-                    </el-col>
-                    <hr style="width:80%;margin: 0 auto;" />
-                    <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
-                        <span id="biao">绌洪棽锛堟牸瀛愭暟锛�</span><span id="zhi">555</span>
-                    </el-col>
-                </div> 
-                <div  id="occupy">
-                    <el-col style="text-align:left;font-weight: bold;">#6</el-col>
-                    <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
-                        <span id="biao">浣跨敤鐜�</span><span id="zhi">35%</span>
-                    </el-col>
-                    <hr style="width:80%;margin: 0 auto;" />
-                    <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
-                        <span id="biao">绌洪棽锛堟牸瀛愭暟锛�</span><span id="zhi">555</span>
-                    </el-col>
-                </div> 
-                <div  id="occupy">
-                    <el-col style="text-align:left;font-weight: bold;">#7</el-col>
-                    <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
-                        <span id="biao">浣跨敤鐜�</span><span id="zhi">35%</span>
-                    </el-col>
-                    <hr style="width:80%;margin: 0 auto;" />
-                    <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
-                        <span id="biao">绌洪棽锛堟牸瀛愭暟锛�</span><span id="zhi">555</span>
-                    </el-col>
-                </div> 
-                <div  id="occupy">
-                    <el-col style="text-align:left;font-weight: bold;">#8</el-col>
-                    <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
-                        <span id="biao">浣跨敤鐜�</span><span id="zhi">35%</span>
-                    </el-col>
-                    <hr style="width:80%;margin: 0 auto;" />
-                    <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
-                        <span id="biao">绌洪棽锛堟牸瀛愭暟锛�</span><span id="zhi">555</span>
-                    </el-col>
-                </div> 
-                <!-- <div v-for="n in 8" :key="n" id="occupy">
-                    <el-col style="text-align:left;font-weight: bold;">#1</el-col>
-                    <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
-                        <span id="biao">浣跨敤鐜�</span><span id="zhi">35%</span>
-                    </el-col>
-                    <hr style="width:80%;margin: 0 auto;" />
-                    <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">
-                        <span id="biao">绌洪棽锛堟牸瀛愭暟锛�</span><span id="zhi">555</span>
-                    </el-col>
-                </div> -->
+            <div v-for="(item, index) in tableDatae" :key="index" id="occupy">  
+               <el-col style="text-align:left;font-weight: bold;">#{{ item.device_id }}</el-col>  
+               <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">  
+                 <span>浣跨敤鐜�</span><span>{{ item.percentage }}</span>  
+               </el-col>  
+               <hr style="width:80%;margin: 0 auto;" />  
+               <el-col style="text-align:left;display:flex;justify-content: space-between;align-items: center;">  
+                 <span>绌洪棽锛堟牸瀛愭暟锛�</span><span>{{ item.count }}</span>  
+               </el-col>  
+             </div>  
     </div>
     <!-- <div id="awatch">
   <img src="../../assets/cp.png" alt="" style="width: 70%;height: 70%;margin-left: 160px;">
@@ -417,15 +355,49 @@
     </div>
     
     <div v-show="c2" class="img-car3" :style="'z-index:999;left:247px;top:' + carposition3 + 'px;position:absolute;'">
-      <div v-show="cellshow3" style="margin-top:10px;width:200px;height:5px;background-color:#409EFF;"></div>
+      <div v-show="cellshow3" style="margin-top:10px;width:220px;height:5px;background-color:#409EFF;"></div>
     </div>
     <div class="img-car4" :style="'z-index:999;left:704px;top:' + carposition4 + 'px;position:absolute;'">
       <div v-show="cellshow4" style="margin-top:10px;width:200px;height:5px;background-color:#409EFF;"></div>
     </div>
-    <div v-show="cellshow" style="width: 200px;height: 5px;position: absolute;top:70px;left: 480px;background-color: #409EFF;">
+    <div v-show="cell1" style="width: 227px;height: 29px;position: absolute;top:55px;left: 465px;">
+      <div  
+      v-for="(item, index) in adjustedRects"  
+      :key="index"  
+      :style="{
+       top: `1px`, width: `227px`,
+      backgroundColor: '#409EFF',
+      height: `height`+ `px`
+       }"  
+    >
     </div>
-    <div v-show="cellshow5" style="width: 200px;height: 5px;position: absolute;top:70px;left: 480px;background-color: #409EFF;">
+      <!-- <div   
+        v-for="(item, index) in adjustedRects" 
+        height: `${rect.height}px`,  
+        :key="index"   
+        :style="{  
+        width: '227px',  
+        height: '1px',
+        backgroundColor: '#409EFF',  
+        top: '1px'
+      }"  
+      >  
+      </div> -->
     </div>
+   <!-- <div v-show="cell2" style="width: 227px;height: 29px;position: absolute;top:86px;left: 465px;background-color: #409EFF;">
+    </div>
+     <div v-show="cell3" style="width: 227px;height: 29px;position: absolute;top:117px;left: 465px;background-color: #409EFF;">
+    </div>
+  <div v-show="cell4" style="width: 227px;height: 29px;position: absolute;top:148px;left: 465px;background-color: #409EFF;">
+    </div>
+  <div v-show="cell5" style="width: 227px;height: 29px;position: absolute;top:208px;left: 465px;background-color: #409EFF;">
+    </div>
+  <div v-show="cell6" style="width: 227px;height: 29px;position: absolute;top:238px;left: 465px;background-color: #409EFF;">
+    </div>
+  <div v-show="cell7" style="width: 227px;height: 29px;position: absolute;top:269px;left: 465px;background-color: #409EFF;">
+    </div>
+  <div v-show="cell8" style="width: 227px;height: 29px;position: absolute;top:300px;left: 465px;background-color: #409EFF;">
+    </div> -->
 </div>
     
   </div>

--
Gitblit v1.8.0