mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-10-12 15:04:04 +00:00
Allow params in Report/KPI Aggregator names
This commit is contained in:
@@ -21,11 +21,23 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
calledVars: {},
|
||||
data: undefined,
|
||||
hasErrors: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
activeLabel() {
|
||||
if (!this.activeAggregator.label)
|
||||
return '';
|
||||
|
||||
return this.activeAggregator.label.replace(
|
||||
/\{\s*([^\}]+)\s*\}/g,
|
||||
(match, key) => this.calledVars[key] === undefined
|
||||
? match
|
||||
: this.calledVars[key]
|
||||
);
|
||||
},
|
||||
activeAggregator() {
|
||||
if (this.config.aggregators.length == 1)
|
||||
return this.config.aggregators[0];
|
||||
@@ -128,6 +140,8 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
this.calledVars = vars;
|
||||
|
||||
try {
|
||||
const result = await this.$api.call(
|
||||
ApiReport.get(this.config.statistik_kurzbz, vars),
|
||||
@@ -177,7 +191,7 @@ export default {
|
||||
<report-error v-if="hasErrors" :errors="hasErrors" />
|
||||
<template v-else-if="kpi !== false">
|
||||
<div class="h1 text-center">{{ kpi }}</div>
|
||||
<small>{{ activeAggregator.label }}</small>
|
||||
<small>{{ activeLabel }}</small>
|
||||
</template>
|
||||
<i v-else class="fa-solid fa-spinner fa-pulse fa-3x"></i>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user