Funktionen fett schreiben, die schon presets hinterlegt haben, demo aus views und Controller namen entfernen, preview hinzufuegen

This commit is contained in:
Harald Bamberger
2026-03-18 15:48:57 +01:00
parent a4f2502fe6
commit 14a8e2f001
7 changed files with 114 additions and 32 deletions
@@ -55,10 +55,11 @@ export default {
params
};
},
loadFunktionen(){
loadFunktionen(dashboard_kurzbz){
return {
method: 'get',
url: 'api/frontend/v1/dashboard/DashboardAdmin/funktionen'
url: 'api/frontend/v1/dashboard/DashboardAdmin/funktionen?db='
+ encodeURIComponent(dashboard_kurzbz)
};
},
addWidgetsToPreset(params){
+17
View File
@@ -0,0 +1,17 @@
import {CoreNavigationCmpt} from '../../components/navigation/Navigation.js';
import CoreDashboard from '../../components/Dashboard/Dashboard.js';
import PluginsPhrasen from '../../plugins/Phrasen.js';
const app = Vue.createApp({
name: 'DashboardPreviewApp',
data: () => ({
appSideMenuEntries: {}
}),
components: {
CoreNavigationCmpt,
CoreDashboard
}
});
app.use(PluginsPhrasen);
app.directive('tooltip', primevue.tooltip);
app.mount('#main');
+21 -10
View File
@@ -53,6 +53,11 @@ export default {
section.widgets.push(widget);
}
});
this.funktionen.forEach(funktion => {
if(funktion.funktion_kurzbz === section_name && funktion.has_preset < 1) {
funktion.has_preset = 1;
}
});
})
.catch(this.$fhcAlert.handleSystemError);
})
@@ -151,30 +156,36 @@ export default {
})
.catch(this.$fhcAlert.handleSystemError);
},
loadFunktionen() {
this.$api
.call(ApiDashboardAdmin.loadFunktionen(this.dashboard))
.then(result => {
this.funktionen = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
}
},
created() {
this.$api
.call(ApiDashboardAdmin.loadFunktionen())
.then(result => {
//console.log(result);
result.data.forEach(funktion => {
this.funktionen[funktion.funktion_kurzbz] = funktion.beschreibung;
});
})
.catch(this.$fhcAlert.handleSystemError);
this.loadFunktionen();
},
watch: {
dashboard() {
// TODO(chris): this should be done without a watcher
this.loadSections({target:this.$refs.funktionenList});
this.loadFunktionen();
}
},
template: `<div class="dashboard-admin-presets">
<div class="row">
<div class="col-3">
<select ref="funktionenList" style="height:30em" class="form-control" multiple @input="loadSections">
<option v-for="name,id in funktionen" :key="id" :value="id">{{ name }}</option>
<option
v-for="funktion in funktionen"
:key="funktion.funktion_kurzbz"
:value="funktion.funktion_kurzbz"
:class="(funktion.has_preset > 0) ? 'fw-bold' : ''"
>{{ funktion.beschreibung }}</option>
</select>
</div>
<div class="col-9">