use teaching units for calendar

This commit is contained in:
chfhtw
2025-07-29 15:47:17 +02:00
parent b0f8b316af
commit 868c15f47d
2 changed files with 29 additions and 5 deletions
+12 -1
View File
@@ -43,7 +43,8 @@ export default {
studiensemester_kurzbz: null,
studiensemester_start: null,
studiensemester_ende: null,
uid: null
uid: null,
teachingunits: null
};
},
computed:{
@@ -158,6 +159,15 @@ export default {
.then(res => {
this.uid = res.data.uid;
});
this.$api
.call(ApiLvPlan.getStunden())
.then(res => {
return this.teachingunits = res.data.map(el => ({
id: el.stunde,
start: el.beginn,
end: el.ende
}));
});
},
template:/*html*/`
<div class="fhc-lvplan d-flex flex-column h-100" v-if="renderers">
@@ -186,6 +196,7 @@ export default {
show-btns
:events="events || []"
:backgrounds="backgrounds"
:time-grid="teachingunits"
>
<template v-slot="{ event, mode }">
<div
@@ -1,6 +1,6 @@
import FhcCalendar from "../../Calendar/Base.js";
import ApiStudenplan from '../../../api/factory/lvPlan.js';
import ApiLvPlan from '../../../api/factory/lvPlan.js';
import { useEventLoader } from '../../../composables/EventLoader.js';
@@ -37,7 +37,8 @@ export default {
week: {
collapseEmptyDays: false
}
}
},
teachingunits: null
}
},
computed: {
@@ -100,8 +101,8 @@ export default {
const { events } = useEventLoader(rangeInterval, (start, end) => {
return [
$api.call(ApiStudenplan.getRoomInfo(props.propsViewData.ort_kurzbz, start.toISODate(), end.toISODate())),
$api.call(ApiStudenplan.getOrtReservierungen(props.propsViewData.ort_kurzbz, start.toISODate(), end.toISODate()))
$api.call(ApiLvPlan.getRoomInfo(props.propsViewData.ort_kurzbz, start.toISODate(), end.toISODate())),
$api.call(ApiLvPlan.getOrtReservierungen(props.propsViewData.ort_kurzbz, start.toISODate(), end.toISODate()))
];
});
@@ -110,6 +111,17 @@ export default {
events
};
},
created() {
this.$api
.call(ApiLvPlan.getStunden())
.then(res => {
return this.teachingunits = res.data.map(el => ({
id: el.stunde,
start: el.beginn,
end: el.ende
}));
});
},
template: /*html*/`
<div class="fhc-roominformation d-flex flex-column h-100">
<h2>{{ $p.t('rauminfo/rauminfo') }} {{ propsViewData.ort_kurzbz }}</h2>
@@ -129,6 +141,7 @@ export default {
show-btns
:events="events || []"
:backgrounds="backgrounds"
:time-grid="teachingunits"
>
<template v-slot="{ event, mode }">
<div