diff --git a/src/utils/filter.js b/src/utils/filter.js index 23cdbf6..27d63b7 100644 --- a/src/utils/filter.js +++ b/src/utils/filter.js @@ -6,6 +6,12 @@ const filters = { } return num.toFixed(2); }, + fix3(num) { + if (num == null) { + return num; + } + return num.toFixed(3); + }, // 缺省值 defaultValue(data) { return data == null ? '--' : data; diff --git a/src/views/system/device/detail.vue b/src/views/system/device/detail.vue index bb543a7..5ae49c7 100644 --- a/src/views/system/device/detail.vue +++ b/src/views/system/device/detail.vue @@ -116,6 +116,9 @@ {{deviceData.totalElectriQuantity | money | defaultValue}} 度 + + + {{deviceData.totalElectriQuantity - deviceData.initReading | money | defaultValue}} 度 重置 @@ -178,6 +181,11 @@ + + + + +