From 8f38a93c9c9ddaf547200a542aecced93f8857a3 Mon Sep 17 00:00:00 2001
From: zhaowei <zhaowei>
Date: 星期一, 11 十一月 2024 15:11:50 +0800
Subject: [PATCH] 报警分析页面子表格持续时间增加默认升序排序功能

---
 src/views/mdc/base/SubControlWorkshopSignage.vue |   27 +++++++++++++++++++--------
 1 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/src/views/mdc/base/SubControlWorkshopSignage.vue b/src/views/mdc/base/SubControlWorkshopSignage.vue
index 40fcfcb..49b6eda 100644
--- a/src/views/mdc/base/SubControlWorkshopSignage.vue
+++ b/src/views/mdc/base/SubControlWorkshopSignage.vue
@@ -86,6 +86,7 @@
           <img src="@/assets/page/subControlWorkshopSignage/grey.png" v-if="item.oporation===0">
           <img src="@/assets/page/subControlWorkshopSignage/green.png" v-if="item.oporation===3">
           <img src="@/assets/page/subControlWorkshopSignage/yellow.png" v-if="item.oporation===2">
+          <img src="@/assets/page/subControlWorkshopSignage/yellow.png" v-if="item.oporation===1">
           <img src="@/assets/page/subControlWorkshopSignage/red.png" v-if="item.oporation===22">
         </div>
         <div class="device-image-container">
@@ -133,7 +134,7 @@
                 <tr>
                   <td>褰撳墠瀵垮懡</td>
                   <template v-for="(item,index) in toolLife.brandList">
-                    <td :style="{backgroundColor:getToolCurrentLifeDataBgColor(item)}">
+                    <td :style="{backgroundColor:getToolCurrentLifeDataBgColor(toolLife.lifeList[index][listIndex])}">
                       {{toolLife.lifeList[index][listIndex]?toolLife.lifeList[index][listIndex]?toolLife.lifeList[index][listIndex].currentLife:'':''}}
                     </td>
                   </template>
@@ -454,20 +455,30 @@
                 lifeList.push(currentBrandLifeList)
               })
               this.maxBrandToolLifeListLength = Object.assign([], lifeList).sort((a, b) => b.length - a.length)[0].length
-              console.log('brandList', brandList)
-              console.log('lifeList', lifeList)
-              console.log('maxBrandToolLifeListLength', this.maxBrandToolLifeListLength)
+              // console.log('brandList', brandList)
+              // console.log('lifeList', lifeList)
+              // console.log('maxBrandToolLifeListLength', this.maxBrandToolLifeListLength)
               this.toolLife = { brandList, lifeList }
             }
           })
       },
 
       getToolCurrentLifeDataBgColor(record) {
-        if (record.currentLife / record.ratedLife > 0.8) {
-          return '#FF9A10'
-        } else {
-          return '#218A21'
+        if (record && record.currentLife) {
+          if (record.currentLife > 10) {
+            return '#218A21'
+          } else if (record.currentLife >= 5 && record.currentLife <= 10) {
+            return '#FF9A10'
+          } else {
+            return '#f00'
+          }
         }
+
+        // if (record.currentLife / record.ratedLife > 0.8) {
+        //   return '#FF9A10'
+        // } else {
+        //   return '#218A21'
+        // }
       },
 
       mouseEnterItem(e) {

--
Gitblit v1.9.3