Jelajahi Sumber

-破锁管理页面优化

jiangbiao 2 tahun lalu
induk
melakukan
e21f97f455

+ 14 - 9
master/src/main/java/com/ruoyi/project/apply/controller/TApplyLockController.java

@@ -65,7 +65,7 @@ public class TApplyLockController extends BaseController {
         } else {
             map.put("type", 3);
         }
-       return AjaxResult.success(map);
+        return AjaxResult.success(map);
     }
 
     /**
@@ -82,18 +82,23 @@ public class TApplyLockController extends BaseController {
     @PreAuthorize("@ss.hasPermi('apply:lock:list')")
     @GetMapping("/listLockBranch")
     public AjaxResult listLockBranch(TApplyLock tApplyLock) {
+        //查询所有锁数据
         List<TApplyLock> list = tApplyLockService.selectTApplyLockList(tApplyLock);
-        List<List<TApplyLock>> result = new ArrayList<>();
-        List<TApplyLock> item = new ArrayList<>();
-        int count = 1;
+        List<List<TApplyLock>> result = new ArrayList<>();//行元素
+        List<TApplyLock> item = new ArrayList<>();//列元素
+        int count = 1;//列统计
         for (int i = 0; i < list.size(); i++) {
-            item.add(list.get(i));
-            if (count == 35) {
+            item.add(list.get(i));//添加列
+            if (count == 35) {//当列达到35个
                 count = 0;
-                result.add(item);
+                result.add(item);//将所有列添加到行
                 item = new ArrayList<>();
-            } else if ((list.size() % 35) == (list.size() - i)) {
-                result.add(list.subList(i, list.size()));
+            } else if ((list.size() % 35) == (list.size() - i)) {//总数%35=它本身,即剩余锁个数不满35个时
+                item = new ArrayList<>(list.subList(i, list.size()));//将剩下的所有锁添加到列
+                for (int j = 0; j < (35 - (list.size() - i)); j++) {//填充空对象充满该行
+                    item.add(new TApplyLock());
+                }
+                result.add(item);
                 break;
             }
             count++;

+ 12 - 8
ui/src/views/apply/lock/lock-aeu.vue

@@ -13,7 +13,7 @@
             <th colspan="5">
             </th>
             <th colspan="25">
-              <span style="font-size: 40px">锁开&锁关摆放看板(AEU)</span><br/>
+              <span style="font-size: 40px">蒸汽裂解装置锁开&锁关摆放看板(AEU)</span><br/>
             </th>
             <th colspan="5">
               <el-tag type="success" style="font-size: 20px;margin: 0px 10px;background-color: #67C23A" size="medium"
@@ -28,15 +28,15 @@
             <td v-for="(item) in list">
               <el-button type="text" @click="handleClick,openDialog(item.id,item.status,item.lockCode)"
                          style="color: #fff;padding: 5px;height: 100%;font-weight: bold"
-                         :class=" item.status===2? 'grey' : (item.status===1 ? 'red':'green')">
-                <svg-icon icon-class="key" style="font-size: 300%" v-if="item.status===1"/>
-                <i class="el-icon-circle-close" style="font-size: 300%" v-else-if="item.status===2"/>
-                <svg-icon icon-class="key" style="font-size: 300%" v-else/>
+                         :class="item.lockCode==null?'fff':( item.status===2? 'grey' : (item.status===1 ? 'red':'green'))">
+                <svg-icon icon-class="key" style="font-size: 300%" v-if="item.status!==2"/>
+                <i class="el-icon-circle-close" style="font-size: 300%" v-if="item.status===2"/>
                 <br/>
                 <br/>
-                <span>{{ item.lockCode.substring(0, item.lockCode.indexOf('-')) }}</span>
-                <br><br>
-                <span>{{ item.lockCode.substring(item.lockCode.indexOf('-'), item.lockCode.length) }}</span>
+                <div  v-if="item.lockCode!=null">
+                  <span>{{ item.lockCode.substring(0, item.lockCode.indexOf('-')) }}</span>
+                  <br><br>
+                  <span>{{ item.lockCode.substring(item.lockCode.indexOf('-'), item.lockCode.length) }}</span></div>
               </el-button>
             </td>
           </tr>
@@ -476,6 +476,10 @@ el-button {
   height: auto;
 }
 
+.fff {
+  background-color: #fff;
+}
+
 .green {
   background-color: #67C23A;
 }

+ 4 - 0
ui/src/views/apply/lock/lock-dashboard.vue

@@ -47,21 +47,25 @@ export default {
         this.isSecond = false
         this.isThird = false
         this.isFourth = false
+        this.isFifth = false
       } else if (tab.name === 'second') {
         this.isFirst = false
         this.isSecond = true
         this.isThird = false
         this.isFourth = false
+        this.isFifth = false
       }else if (tab.name === 'third') {
         this.isFirst = false
         this.isSecond = false
         this.isThird = true
         this.isFourth = false
+        this.isFifth = false
       }else if (tab.name === 'fourth') {
         this.isFirst = false
         this.isSecond = false
         this.isThird = false
         this.isFourth = true
+        this.isFifth = false
       }else if (tab.name === 'fifth') {
         this.isFirst = false
         this.isSecond = false

+ 11 - 8
ui/src/views/apply/lock/lock-eu.vue

@@ -14,7 +14,6 @@
             </th>
             <th colspan="25">
               <span style="font-size: 40px">蒸汽裂解装置锁开&锁关摆放看板(EU)</span><br/>
-              <!--              <span style="font-size: 18px">LO&LC display board of Steam Cracker plant(EU)</span>-->
             </th>
             <th colspan="5">
               <el-tag type="success" style="font-size: 20px;margin: 0px 10px;background-color: #67C23A" size="medium"
@@ -29,15 +28,15 @@
             <td v-for="(item) in list">
               <el-button type="text" @click="handleClick,openDialog(item.id,item.status,item.lockCode)"
                          style="color: #fff;padding: 5px;height: 100%;font-weight: bold"
-                         :class=" item.status===2? 'grey' : (item.status===1 ? 'red':'green')">
-                <svg-icon icon-class="key" style="font-size: 300%" v-if="item.status===1"/>
-                <i class="el-icon-circle-close" style="font-size: 300%" v-else-if="item.status===2"/>
-                <svg-icon icon-class="key" style="font-size: 300%" v-else/>
+                         :class="item.lockCode==null?'fff':( item.status===2? 'grey' : (item.status===1 ? 'red':'green'))">
+                <svg-icon icon-class="key" style="font-size: 300%" v-if="item.status!==2"/>
+                <i class="el-icon-circle-close" style="font-size: 300%" v-if="item.status===2"/>
                 <br/>
                 <br/>
-                <span>{{ item.lockCode.substring(0, item.lockCode.indexOf('-')) }}</span>
-                <br><br>
-                <span>{{ item.lockCode.substring(item.lockCode.indexOf('-'), item.lockCode.length) }}</span>
+                <div  v-if="item.lockCode!=null">
+                  <span>{{ item.lockCode.substring(0, item.lockCode.indexOf('-')) }}</span>
+                  <br><br>
+                  <span>{{ item.lockCode.substring(item.lockCode.indexOf('-'), item.lockCode.length) }}</span></div>
               </el-button>
             </td>
           </tr>
@@ -477,6 +476,10 @@ el-button {
   height: auto;
 }
 
+.fff {
+  background-color: #fff;
+}
+
 .green {
   background-color: #67C23A;
 }

+ 12 - 8
ui/src/views/apply/lock/lock-pgu.vue

@@ -13,7 +13,7 @@
             <th colspan="5">
             </th>
             <th colspan="25">
-              <span style="font-size: 40px">锁开&锁关摆放看板(PGU)</span><br/>
+              <span style="font-size: 40px">蒸汽裂解装置锁开&锁关摆放看板(PGU)</span><br/>
             </th>
             <th colspan="5">
               <el-tag type="success" style="font-size: 20px;margin: 0px 10px;background-color: #67C23A" size="medium"
@@ -28,15 +28,15 @@
             <td v-for="(item) in list">
               <el-button type="text" @click="handleClick,openDialog(item.id,item.status,item.lockCode)"
                          style="color: #fff;padding: 5px;height: 100%;font-weight: bold"
-                         :class=" item.status===2? 'grey' : (item.status===1 ? 'red':'green')">
-                <svg-icon icon-class="key" style="font-size: 300%" v-if="item.status===1"/>
-                <i class="el-icon-circle-close" style="font-size: 300%" v-else-if="item.status===2"/>
-                <svg-icon icon-class="key" style="font-size: 300%" v-else/>
+                         :class="item.lockCode==null?'fff':( item.status===2? 'grey' : (item.status===1 ? 'red':'green'))">
+                <svg-icon icon-class="key" style="font-size: 300%" v-if="item.status!==2"/>
+                <i class="el-icon-circle-close" style="font-size: 300%" v-if="item.status===2"/>
                 <br/>
                 <br/>
-                <span>{{ item.lockCode.substring(0, item.lockCode.indexOf('-')) }}</span>
-                <br><br>
-                <span>{{ item.lockCode.substring(item.lockCode.indexOf('-'), item.lockCode.length) }}</span>
+                <div  v-if="item.lockCode!=null">
+                  <span>{{ item.lockCode.substring(0, item.lockCode.indexOf('-')) }}</span>
+                  <br><br>
+                  <span>{{ item.lockCode.substring(item.lockCode.indexOf('-'), item.lockCode.length) }}</span></div>
               </el-button>
             </td>
           </tr>
@@ -476,6 +476,10 @@ el-button {
   height: auto;
 }
 
+.fff {
+  background-color: #fff;
+}
+
 .green {
   background-color: #67C23A;
 }

+ 12 - 8
ui/src/views/apply/lock/lock-sctu.vue

@@ -13,7 +13,7 @@
             <th colspan="5">
             </th>
             <th colspan="25">
-              <span style="font-size: 40px">锁开&锁关摆放看板(SCTU)</span><br/>
+              <span style="font-size: 40px">蒸汽裂解装置锁开&锁关摆放看板(SCTU)</span><br/>
             </th>
             <th colspan="5">
               <el-tag type="success" style="font-size: 20px;margin: 0px 10px;background-color: #67C23A" size="medium"
@@ -28,15 +28,15 @@
             <td v-for="(item) in list">
               <el-button type="text" @click="handleClick,openDialog(item.id,item.status,item.lockCode)"
                          style="color: #fff;padding: 5px;height: 100%;font-weight: bold"
-                         :class=" item.status===2? 'grey' : (item.status===1 ? 'red':'green')">
-                <svg-icon icon-class="key" style="font-size: 300%" v-if="item.status===1"/>
-                <i class="el-icon-circle-close" style="font-size: 300%" v-else-if="item.status===2"/>
-                <svg-icon icon-class="key" style="font-size: 300%" v-else/>
+                         :class="item.lockCode==null?'fff':( item.status===2? 'grey' : (item.status===1 ? 'red':'green'))">
+                <svg-icon icon-class="key" style="font-size: 300%" v-if="item.status!==2"/>
+                <i class="el-icon-circle-close" style="font-size: 300%" v-if="item.status===2"/>
                 <br/>
                 <br/>
-                <span>{{ item.lockCode.substring(0, item.lockCode.indexOf('-')) }}</span>
-                <br><br>
-                <span>{{ item.lockCode.substring(item.lockCode.indexOf('-'), item.lockCode.length) }}</span>
+                <div  v-if="item.lockCode!=null">
+                  <span>{{ item.lockCode.substring(0, item.lockCode.indexOf('-')) }}</span>
+                  <br><br>
+                  <span>{{ item.lockCode.substring(item.lockCode.indexOf('-'), item.lockCode.length) }}</span></div>
               </el-button>
             </td>
           </tr>
@@ -476,6 +476,10 @@ el-button {
   height: auto;
 }
 
+.fff {
+  background-color: #fff;
+}
+
 .green {
   background-color: #67C23A;
 }

+ 12 - 8
ui/src/views/apply/lock/lock-sub.vue

@@ -13,7 +13,7 @@
             <th colspan="5">
             </th>
             <th colspan="25">
-              <span style="font-size: 40px">锁开&锁关摆放看板(SUB)</span><br/>
+              <span style="font-size: 40px">蒸汽裂解装置锁开&锁关摆放看板(SUB)</span><br/>
             </th>
             <th colspan="5">
               <el-tag type="success" style="font-size: 20px;margin: 0px 10px;background-color: #67C23A" size="medium"
@@ -28,15 +28,15 @@
             <td v-for="(item) in list">
               <el-button type="text" @click="handleClick,openDialog(item.id,item.status,item.lockCode)"
                          style="color: #fff;padding: 5px;height: 100%;font-weight: bold"
-                         :class=" item.status===2? 'grey' : (item.status===1 ? 'red':'green')">
-                <svg-icon icon-class="key" style="font-size: 300%" v-if="item.status===1"/>
-                <i class="el-icon-circle-close" style="font-size: 300%" v-else-if="item.status===2"/>
-                <svg-icon icon-class="key" style="font-size: 300%" v-else/>
+                         :class="item.lockCode==null?'fff':( item.status===2? 'grey' : (item.status===1 ? 'red':'green'))">
+                <svg-icon icon-class="key" style="font-size: 300%" v-if="item.status!==2"/>
+                <i class="el-icon-circle-close" style="font-size: 300%" v-if="item.status===2"/>
                 <br/>
                 <br/>
-                <span>{{ item.lockCode.substring(0, item.lockCode.indexOf('-')) }}</span>
-                <br><br>
-                <span>{{ item.lockCode.substring(item.lockCode.indexOf('-'), item.lockCode.length) }}</span>
+                <div  v-if="item.lockCode!=null">
+                  <span>{{ item.lockCode.substring(0, item.lockCode.indexOf('-')) }}</span>
+                  <br><br>
+                  <span>{{ item.lockCode.substring(item.lockCode.indexOf('-'), item.lockCode.length) }}</span></div>
               </el-button>
             </td>
           </tr>
@@ -476,6 +476,10 @@ el-button {
   height: auto;
 }
 
+.fff {
+  background-color: #fff;
+}
+
 .green {
   background-color: #67C23A;
 }