Просмотр исходного кода

Merge branch 'equipManage' into dev

huoyi 1 месяц назад
Родитель
Сommit
81b6f51420
1 измененных файлов с 24 добавлено и 1 удалено
  1. 24 1
      src/views/equipManage/equipLedger/index.vue

+ 24 - 1
src/views/equipManage/equipLedger/index.vue

@@ -33,7 +33,7 @@
33
     </div>
33
     </div>
34
 
34
 
35
     <!-- 数据表格 -->
35
     <!-- 数据表格 -->
36
-    <el-table v-loading="loading" :data="tableData" border @selection-change="handleSelectionChange">
36
+    <el-table v-loading="loading" :data="tableData" border @selection-change="handleSelectionChange" :row-class-name="tableRowClassName">
37
       <el-table-column type="selection" width="55" align="center" />
37
       <el-table-column type="selection" width="55" align="center" />
38
       <el-table-column label="序号" prop="rowIndex" width="70" align="center">
38
       <el-table-column label="序号" prop="rowIndex" width="70" align="center">
39
         <template #default="scope">
39
         <template #default="scope">
@@ -420,6 +420,17 @@ function handleBatchDelete() {
420
   }).catch(() => { })
420
   }).catch(() => { })
421
 }
421
 }
422
 
422
 
423
+function tableRowClassName({ row }) {
424
+  if (row.colorType === 'RED') {
425
+    return 'row-red'
426
+  } else if (row.colorType === 'ORANGE') {
427
+    return 'row-orange'
428
+  } else if (row.colorType === 'YELLOW') {
429
+    return 'row-yellow'
430
+  }
431
+  return ''
432
+}
433
+
423
 function handleExport() {
434
 function handleExport() {
424
   proxy.download('equipment/ledger/export', {
435
   proxy.download('equipment/ledger/export', {
425
     ...queryParams
436
     ...queryParams
@@ -588,4 +599,16 @@ onMounted(() => {
588
   flex-wrap: wrap;
599
   flex-wrap: wrap;
589
   gap: 10px;
600
   gap: 10px;
590
 }
601
 }
602
+
603
+:deep(.row-red) {
604
+  background-color: rgba(245, 108, 108, 0.3) !important;
605
+}
606
+
607
+:deep(.row-orange) {
608
+  background-color: rgba(230, 162, 60, 0.3) !important;
609
+}
610
+
611
+:deep(.row-yellow) {
612
+  background-color: rgba(255, 206, 86, 0.3) !important;
613
+}
591
 </style>
614
 </style>