|
|
@@ -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="注气量(万方)"
|