Fix reporter metric format
This commit is contained in:
@@ -131,7 +131,7 @@ export default {
|
||||
disabledRoutes: [
|
||||
'report.list',
|
||||
'report.create',
|
||||
'report.edit'
|
||||
'report.edit',
|
||||
],
|
||||
}
|
||||
},
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
"kind-of": "^6.0.3",
|
||||
"lodash": "^4.17.21",
|
||||
"moment": "2.29.2",
|
||||
"numeral": "^2.0.6",
|
||||
"pdfjs-dist": "2.2.228",
|
||||
"pino": "^5.16.0",
|
||||
"portal-vue": "^2.1.7",
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
<script>
|
||||
import base from './base.vue'
|
||||
import numeral from 'numeral'
|
||||
|
||||
export default {
|
||||
extends: base,
|
||||
@@ -64,10 +65,11 @@ export default {
|
||||
},
|
||||
|
||||
displayedMetric () {
|
||||
const { prefix = '', suffix = '' } = this.options
|
||||
const { prefix = '', suffix = '', format = '' } = this.options
|
||||
|
||||
if (this.value) {
|
||||
return `${prefix}${this.value}${suffix}`
|
||||
const value = format ? numeral(this.value).format(format) : this.value
|
||||
return `${prefix}${value}${suffix}`
|
||||
}
|
||||
|
||||
return ''
|
||||
|
||||
Reference in New Issue
Block a user