|
|
@@ -293,15 +293,24 @@ function cellStyle(data: {
|
|
|
const { row, column } = data
|
|
|
|
|
|
if (column.property === 'transitTime') {
|
|
|
- const originalValue = row.transitTime ?? 0
|
|
|
-
|
|
|
- if (originalValue > 1.2)
|
|
|
- return {
|
|
|
- color: 'red',
|
|
|
- fontWeight: 'bold'
|
|
|
+ // 1. 获取参与计算的字段,逻辑与 formatter 保持一致
|
|
|
+ const capacity = Number(row?.capacity)
|
|
|
+ const dailyGasInjection = Number(row?.dailyGasInjection)
|
|
|
+
|
|
|
+ // 2. 只有当两个值都有效(且 capacity 不为 0)时才进行计算
|
|
|
+ // 对应 formatter 中的 if (!capacity || !dailyGasInjection) 返回 '0.00%' 的情况
|
|
|
+ if (capacity && dailyGasInjection) {
|
|
|
+ const ratio = dailyGasInjection / capacity
|
|
|
+
|
|
|
+ // 3. 判断计算结果是否大于 1.2 (即 120%)
|
|
|
+ if (ratio > 1.0) {
|
|
|
+ return {
|
|
|
+ color: 'red',
|
|
|
+ fontWeight: 'bold'
|
|
|
+ }
|
|
|
}
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
// const timeFields = ['dailyInjectGasTime', 'dailyInjectWaterTime', 'nonProductionTime']
|
|
|
// if (timeFields.includes(column.property)) {
|
|
|
// if (!checkTimeSumEquals24(row)) {
|