Browse Source

pms 瑞鹰日报 钻井 修井 列表预警字段

zhangcl 1 tuần trước cách đây
mục cha
commit
8918db2ea8

+ 25 - 1
src/views/pms/iotrydailyreport/index.vue

@@ -249,7 +249,13 @@
                 prop="dailyFuel"
                 :min-width="columnWidths.dailyFuel.width"
                 resizable
-              />
+              >
+                <template #default="scope">
+                <span :class="{'fuel-warning': shouldShowFuelWarning(scope.row)}">
+                  {{ scope.row.dailyFuel }}
+                </span>
+                </template>
+              </el-table-column>
             </el-table-column>
 
             <el-table-column
@@ -850,6 +856,18 @@ const cellStyle = ({
   rowIndex: number
   columnIndex: number
 }) => {
+
+  // 处理当日油耗预警
+  if (column.property === 'dailyFuel') {
+    if (shouldShowFuelWarning(row)) {
+      return {
+        color: 'red',
+        fontWeight: 'bold',
+        backgroundColor: '#fff5f5' // 可选:添加背景色突出显示
+      };
+    }
+  }
+
   // 处理三个时间字段:当日注气时间、当日注水时间、非生产时间
   const timeFields = [
     'drillingWorkingTime',
@@ -894,6 +912,12 @@ const getList = async () => {
   }
 }
 
+// 在 cellStyle 函数附近添加油耗预警判断函数
+const shouldShowFuelWarning = (row: any): boolean => {
+  const dailyFuel = parseFloat(row.dailyFuel);
+  return !isNaN(dailyFuel) && dailyFuel > 15;
+};
+
 // 计算列宽度
 
 /** 搜索按钮操作 */

+ 18 - 0
src/views/pms/iotrydailyreport/xjindex.vue

@@ -800,6 +800,19 @@ const cellStyle = ({
   rowIndex: number
   columnIndex: number
 }) => {
+  // 当日油耗预警逻辑
+  if (column.property === 'dailyFuel') {
+    const dailyFuel = parseFloat(row.dailyFuel) || 0;
+    if (dailyFuel > 5) {
+      return {
+        backgroundColor: '#e6f8ff', // 浅黄色背景
+        color: '#0a35c4', // 橙色文字
+        fontWeight: 'bold',
+        border: '1px solid #ffd591' // 可选:添加边框突出显示
+      };
+    }
+  }
+
   // 1. 检查三个时间字段:额定生产时间、生产时间、非生产时间
   const timeFields = ['ratedProductionTime', 'productionTime', 'nonProductionTime']
   if (timeFields.includes(column.property)) {
@@ -1118,6 +1131,11 @@ watch(
 .color-indicator.orange {
   background-color: orange;
 }
+
+/* 在原有样式基础上添加黄色指示器 */
+.color-indicator.yellow {
+  background-color: #0a35c4; /* 黄色,与警告颜色一致 */
+}
 </style>
 
 <style>