From 9afdf0e2256420cf8157f886808ec67794d11098 Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期日, 17 九月 2023 11:18:18 +0800
Subject: [PATCH] 主页面修改理片笼玻璃与表格显示

---
 CanadaMes-ui/src/views/home/index.vue                                       |   36 +++++++++++++++++++++++-------------
 springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java |   10 +++++-----
 2 files changed, 28 insertions(+), 18 deletions(-)

diff --git a/CanadaMes-ui/src/views/home/index.vue b/CanadaMes-ui/src/views/home/index.vue
index 72685ec..b87e524 100644
--- a/CanadaMes-ui/src/views/home/index.vue
+++ b/CanadaMes-ui/src/views/home/index.vue
@@ -60,6 +60,8 @@
 
 .gezi {
     height: 35px;
+    
+    position: absolute;
     width: 3.07px;
     /* width: 4.22px; */
 }
@@ -75,19 +77,20 @@
 
 
 .blocks {
+
     
-    max-width: 94vw;
     background-image: url('../../img/xmjc.png');
     margin: 0 auto;
     background-repeat: no-repeat;
     background-attachment: local;
     width: 1660px;
     min-height: 55vh;
+    max-width: 94vw;
     background-size: 1200px 510px;
     /* max-width: 100vw;
     background-size: 1660px 560px; */
-    
-    
+
+
 }
 
 .blocks-img {
@@ -239,18 +242,21 @@
             <div class="blocks" style="position: relative;">
                 <div style="display:flex;position: absolute;float:left;z-index: 999;top:102px;left:237px;">
                     <div :class="getStatusClass(item.state)" v-for="item in cagelist1" :key="item['date']"
-                        @click="showcageinfo(item['cage'])"></div>
+                        :style="{ height: 35 * item['glassWidth'] + 'px' }" @click="showcageinfo(item['cage'])"></div>
                 </div>
                 <div style="display:flex;position: absolute;float:left;z-index: 999;top:102px;left:640px;">
                     <div :class="getStatusClass(item.state)" v-for="item in cagelist2" :key="item['date']"
-                        @click="showcageinfo(item['cage'])"></div>
+                        :style="{ height: 35 * item['glassWidth'] + 'px' }" @click="showcageinfo(item['cage'])"></div>
                 </div>
-                <div style="display:flex;position: absolute;float:left;z-index: 999;top:138px;left:237px;">
+                <div style="display:flex;position: absolute;float:left;z-index: 999;top:139px;left:237px;">
                     <div :class="getStatusClass(item.state)" v-for="item in cagelist3" :key="item['date']"
-                        @click="showcageinfo(item['cage'])"></div>
+                        :style="{ height: 35 * item['glassWidth'] + 'px', top: item['width'] * 35 - 35 + 'px' }"
+                        @click="showcageinfo(item['cage'])">
+                    </div>
                 </div>
-                <div style="display:flex;position: absolute;float:left;z-index: 999;top:138px;left:640px;">
+                <div style="display:flex;position: absolute;float:left;z-index: 999;top:139px;left:640px;">
                     <div :class="getStatusClass(item.state)" v-for="item in cagelist4" :key="item['date']"
+                        :style="{ height: 35 * item['glassWidth'] + 'px', top: item['width'] * 35 - 35 + 'px' }"
                         @click="showcageinfo(item['cage'])"></div>
                 </div>
                 <div class="blocks-img" :style="{ left: car1 + 'px', top: '16px' }"></div>
@@ -259,18 +265,22 @@
                 <div class="blocks-img3"></div>
                 <!-- <div style="display:flex;position: absolute;float:left;z-index: 999;top:112px;left:328px;">
                     <div :class="getStatusClass(item.state)" v-for="item in cagelist1" :key="item['date']"
+                        :style="{ height: 35 * item['glassWidth'] + 'px' }"
                         @click="showcageinfo(item['cage'])"></div>
                 </div>
                 <div style="display:flex;position: absolute;float:left;z-index: 999;top:112px;left:885px;">
                     <div :class="getStatusClass(item.state)" v-for="item in cagelist2" :key="item['date']"
+                        :style="{ height: 35 * item['glassWidth'] + 'px' }"
                         @click="showcageinfo(item['cage'])"></div>
                 </div>
                 <div style="display:flex;position: absolute;float:left;z-index: 999;top:154px;left:328px;">
                     <div :class="getStatusClass(item.state)" v-for="item in cagelist3" :key="item['date']"
+                        :style="{ height: 35 * item['glassWidth'] + 'px', top: item['width'] * 35 - 35 + 'px' }"
                         @click="showcageinfo(item['cage'])"></div>
                 </div>
                 <div style="display:flex;position: absolute;float:left;z-index: 999;top:154px;left:885px;">
                     <div :class="getStatusClass(item.state)" v-for="item in cagelist4" :key="item['date']"
+                        :style="{ height: 35 * item['glassWidth'] + 'px', top: item['width'] * 35 - 35 + 'px' }"
                         @click="showcageinfo(item['cage'])"></div>
                 </div>
                 <div class="blocks-img" :style="{ left: car1 + 'px', top: '16px' }"></div>
@@ -424,10 +434,10 @@
                     //console.log("鏀跺埌鏁版嵁====" + msg.data);
                     let obj = JSON.parse(msg.data);
                     if (obj.params != null) {
-                        this.car1 = 107 + 17.62 * obj.params[0][0];
-                        this.car2 = 175 + 17.62 * obj.params[0][1];
-                        // this.car1 = 150 + 24.6 * obj.params[0][0];
-                        // this.car2 = 242 + 24.6 * obj.params[0][1];
+                        this.car1 = 107 + 17.62 * obj.params[0][0]/1000;
+                        this.car2 = 175 + 17.62 * obj.params[0][1]/1000;
+                        // this.car1 = 150 + 24.6 * obj.params[0][0]/1000;
+                        // this.car2 = 242 + 24.6 * obj.params[0][1]/1000;
                     }
                     this.tableData = obj.tableData[0];
                     this.cagelist1 = obj.cagelist1[0];
@@ -625,7 +635,7 @@
                     OutByGlassID(glassid).then(res => {
                         if (res.data.message3 == 200) {
                             this.$message.success(this.$t('Operation successful'));
-                        } 
+                        }
                         else if (res.data.message2 == 300) {
                             this.$message.success(this.$t('There is no such grid'));
                         }
diff --git a/springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java b/springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
index 3e22d2c..8c8b53b 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
@@ -14,19 +14,19 @@
   List<StorageCage> selectAll();
 
   // 鏌ヨ1-5绗煎唴灞傛牸瀛愮姸鎬�
-  @Select("SELECT cage,state from storage_cage where cage<=5 and tier=1")
+  @Select("SELECT cage,state,glasswidth/width*2 as glasswidth from storage_cage where cage<=5 and tier=2")
   List<StorageCage> selectRack1();
 
   // 鏌ヨ6-10绗煎唴灞傛牸瀛愮姸鎬�
-  @Select("SELECT cage,state from storage_cage where cage>5 and tier=1")
+  @Select("SELECT cage,state,glasswidth/width*2 as glasswidth from storage_cage where cage>5 and tier=2")
   List<StorageCage> selectRack2();
 
   // 鏌ヨ1-5绗煎灞傛牸瀛愮姸鎬�
-  @Select("SELECT cage,state from storage_cage where cage<=5 and tier=2")
+  @Select("SELECT case when tier=1 then cage else 0 end as cage,case when tier=1 then state else 0 end as state,sum(case when tier=1 then glasswidth/width*2 else 0 end) as glasswidth,sum(case when tier=2 then glasswidth/width*2 else 0 end) as width  from storage_cage where cage<=5  group by cell")
   List<StorageCage> selectRack3();
 
   // 鏌ヨ6-10绗煎灞傛牸瀛愮姸鎬�
-  @Select("SELECT cage,state from storage_cage where cage>5 and tier=2")
+  @Select("SELECT case when tier=1 then cage else 0 end as cage,case when tier=1 then state else 0 end as state,sum(case when tier=1 then glasswidth/width*2 else 0 end) as glasswidth,sum(case when tier=2 then glasswidth/width*2 else 0 end) as width  from storage_cage where cage>5  group by cell")
   List<StorageCage> selectRack4();
 
   // 鏍规嵁浠诲姟绫诲瀷鏌ヨ褰撳墠姝e湪鍑虹墖锛岃繘鐗囩殑鐜荤拑淇℃伅
@@ -66,7 +66,7 @@
   List<alarmmg> SelectAlarmmgInfo();
 
   //鑾峰彇鐞嗙墖绗煎唴鐜荤拑淇℃伅
-  @Select("select *,concat(glasswidth,' x ',glassheight) as lengthwidth from storage_cage where cage=#{cage} ")
+  @Select("select *,concat(glasswidth,' x ',glassheight) as lengthwidth from storage_cage where cage=#{cage} and state!=0 ")
   List<StorageCage> SelectCageInfo(short cage);
 
   @Update("update storage_cage set state=0,glass_id=null,order_id=null,glasswidth=null,glassheight=null,coating=null where glass_id=#{glassid}")

--
Gitblit v1.8.0