Przeglądaj źródła

保养计划编辑表格调整

Zimo 4 godzin temu
rodzic
commit
9892f9bd0b

+ 12 - 1
src/views/pms/maintenance/IotMaintenancePlanEdit.vue

@@ -66,6 +66,7 @@
         :cell-class-name="cellClassName"
         :max-height="420"
         scrollbar-always-on
+        :cell-style="cellStyle"
       >
         <!-- 添加序号列 -->
         <el-table-column
@@ -672,6 +673,16 @@ const pagedList = computed(() => {
   // return list.value.slice(start, end)
 })
 
+const cellStyle = ({ row, column }: any) => {
+  if (['remainH', 'remainKm', 'remainDay'].includes(column.property)) {
+    if (row[column.property] < 0) {
+      return {
+        color: 'var(--el-color-danger)'
+      }
+    }
+  }
+}
+
 // 处理页码变化
 const handlePageChange = (page: number) => {
   currentPage.value = page
@@ -1939,7 +1950,7 @@ el-table {
       background-color: var(--el-table-current-row-bg-color) !important;
     }
 
-    .all-filled{
+    .all-filled {
       background-color: #67c23a !important;
     }
   }