3
0

Fix reporter metric format

This commit is contained in:
Jože Fortun
2023-10-17 11:32:00 +02:00
parent c9fca53b2b
commit 99d81ccf2e
3 changed files with 6 additions and 3 deletions

View File

@@ -131,7 +131,7 @@ export default {
disabledRoutes: [
'report.list',
'report.create',
'report.edit'
'report.edit',
],
}
},

View File

@@ -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",

View File

@@ -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 ''