|
|
@@ -710,9 +710,18 @@ const formatDesignWellStruct = (text: string | null | undefined) => {
|
|
|
|
|
|
// 百分比格式化函数
|
|
|
const percentageFormatter = (row: any, column: any, cellValue: any, index: number | null) => {
|
|
|
- if (cellValue === null || cellValue === undefined) return ''
|
|
|
- // 将小数转换为百分比,保留两位小数
|
|
|
- return `${(parseFloat(cellValue) * 100).toFixed(2)}%`
|
|
|
+ const capacity = Number(row?.capacity)
|
|
|
+ const dailyGasInjection = Number(row?.dailyGasInjection)
|
|
|
+
|
|
|
+ if (!capacity || !dailyGasInjection) {
|
|
|
+ return '0.00%'
|
|
|
+ }
|
|
|
+
|
|
|
+ return ((dailyGasInjection / capacity) * 100).toFixed(2) + '%'
|
|
|
+
|
|
|
+ // if (cellValue === null || cellValue === undefined) return ''
|
|
|
+ // // 将小数转换为百分比,保留两位小数
|
|
|
+ // return `${(parseFloat(cellValue) * 100).toFixed(2)}%`
|
|
|
}
|
|
|
|
|
|
// 添加打开未填报弹窗的方法
|