Bladeren bron

fix: 调整日生产报表运行时效展示

- 使用后端返回的 transitTimeRate 展示运行时效
- 移除前端运行时效比例计算逻辑
- 按 transitTimeRate 超过 100% 判断并高亮异常数据
Zimo 2 dagen geleden
bovenliggende
commit
f852d24ea6
1 gewijzigde bestanden met toevoegingen van 9 en 27 verwijderingen
  1. 9 27
      src/views/pms/iotrhdailyreport/rh-table.vue

+ 9 - 27
src/views/pms/iotrhdailyreport/rh-table.vue

@@ -46,6 +46,7 @@ interface ListItem {
   yearTotalFuel: number
   capacity: number
   techniqueNames: string
+  transitTimeRate: string
 }
 
 const props = defineProps({
@@ -87,17 +88,6 @@ const { ZmTable, ZmTableColumn } = useTableComponents<ListItem>()
 
 const GAS_ELECTRICITY_RATIO_WARNING_THRESHOLD = 15
 
-function percentageFormatter(row: ListItem) {
-  const capacity = Number(row?.capacity)
-  const dailyGasInjection = Number(row?.dailyGasInjection)
-
-  if (!capacity || !dailyGasInjection) {
-    return '0.00%'
-  }
-
-  return ((dailyGasInjection / capacity) * 100).toFixed(2) + '%'
-}
-
 function unitformatter(
   _row: ListItem,
   _column: TableColumnCtx<ListItem>,
@@ -116,17 +106,13 @@ const isGasElectricityRatioWarning = (value: unknown) => {
 }
 
 const cellStyle = ({ row, column }: { row: any; column: any }) => {
-  if (column.property === 'transitTime') {
-    const capacity = Number(row?.capacity)
-    const dailyGasInjection = Number(row?.dailyGasInjection)
-    if (capacity && dailyGasInjection) {
-      const ratio = dailyGasInjection / capacity
-      if (ratio > 1.0) {
-        return {
-          color: 'red',
-          fontWeight: 'bold',
-          backgroundColor: 'var(--el-color-danger-light-9)'
-        }
+  if (column.property === 'transitTimeRate') {
+    const ratio = Number(row?.transitTimeRate.replace('%', ''))
+    if (ratio > 100.0) {
+      return {
+        color: 'red',
+        fontWeight: 'bold',
+        backgroundColor: 'var(--el-color-danger-light-9)'
       }
     }
   }
@@ -214,11 +200,7 @@ function handleCurrentChange(val: number) {
             <zm-table-column label="施工工艺" prop="techniqueNames" />
             <zm-table-column label="设备号" prop="deviceNo" />
             <zm-table-column label="设计注气量(万方)" prop="designInjection" />
-            <zm-table-column
-              label="运行时效"
-              prop="transitTime"
-              cover-formatter
-              :real-value="percentageFormatter" />
+            <zm-table-column label="运行时效" prop="transitTimeRate" />
             <zm-table-column label="当日">
               <zm-table-column
                 label="注气量(万方)"