mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-25 08:34:29 +00:00
adding the reservierungen to the room plannung
This commit is contained in:
@@ -12,4 +12,10 @@ export default {
|
||||
{}
|
||||
);
|
||||
},
|
||||
getReservierungen(ort_kurzbz, start_date, end_date) {
|
||||
return this.$fhcApi.get(
|
||||
'/api/frontend/v1/Stundenplan/Reservierungen',
|
||||
{ ort_kurzbz, start_date, end_date}
|
||||
);
|
||||
},
|
||||
};
|
||||
@@ -10,13 +10,19 @@ const app = Vue.createApp({
|
||||
return {
|
||||
stunden: [],
|
||||
events: null,
|
||||
calendarWeek: new CalendarDate(new Date("2024-03-06")),
|
||||
calendarWeek: new CalendarDate(new Date("2024-06-06")),
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
currentDate: function(){
|
||||
return new Date(this.calendarWeek.y, this.calendarWeek.m, this.calendarWeek.d);
|
||||
},
|
||||
weekFirstDay: function(){
|
||||
return this.calendarDateToString(this.calendarWeek.cdFirstDayOfWeek);
|
||||
},
|
||||
weekLastDay: function(){
|
||||
return this.calendarDateToString(this.calendarWeek.cdLastDayOfWeek);
|
||||
},
|
||||
},
|
||||
methods:{
|
||||
// returns the string YYYY-MM-DD if param is instance of CalendarDate and null otherwise
|
||||
@@ -26,7 +32,8 @@ const app = Vue.createApp({
|
||||
[calendarDate.y, calendarDate.m+1, calendarDate.d].join('-'):
|
||||
null;
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
created() {
|
||||
|
||||
@@ -36,10 +43,8 @@ const app = Vue.createApp({
|
||||
});
|
||||
|
||||
|
||||
console.log(this.calendarDateToString(this.calendarWeek.cdFirstDayOfWeek),"this is the converted calendar date")
|
||||
|
||||
|
||||
this.$fhcApi.factory.stundenplan.getRoomInfo('EDV_A6.09', this.calendarDateToString(this.calendarWeek.cdFirstDayOfWeek), this.calendarDateToString(this.calendarWeek.cdLastDayOfWeek)).then(res =>{
|
||||
// old testing room EDV_A6.09
|
||||
this.$fhcApi.factory.stundenplan.getRoomInfo('SEM_E0.04', this.weekFirstDay, this.weekLastDay).then(res =>{
|
||||
let events;
|
||||
if (res.data && res.data.forEach) {
|
||||
res.data.forEach((el, i) => {
|
||||
@@ -55,7 +60,27 @@ const app = Vue.createApp({
|
||||
|
||||
this.events = res.data;
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
this.$fhcApi.factory.stundenplan.getReservierungen('SEM_E0.04', this.weekFirstDay, this.weekLastDay).then(res => {
|
||||
if (res.data && res.data.forEach) {
|
||||
res.data.forEach((el, i) => {
|
||||
el.reservierung = true;
|
||||
el.color = '#CCCCCC';
|
||||
el.start = new Date(el.datum + ' ' + this.stunden[el.stunde].beginn);
|
||||
el.end = new Date(el.datum + ' ' + this.stunden[el.stunde].ende);
|
||||
el.title = el.titel;
|
||||
if (el.lehrform)
|
||||
el.title += '-' + el.lehrform;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
let reservierungs_events = res.data;
|
||||
console.log(reservierungs_events, " this are the reserverungs event")
|
||||
this.events = [...this.events,...reservierungs_events];
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
},
|
||||
@@ -63,9 +88,13 @@ const app = Vue.createApp({
|
||||
<div>
|
||||
<fhc-calendar v-slot="{event}" :initialDate="currentDate" :events="events" initial-mode="week" show-weeks>
|
||||
<div class="d-flex flex-column align-items-center justify-content-evenly h-100">
|
||||
<span>{{event.orig.lv_info}}</span>
|
||||
<span v-for="(item, index) in event.orig.stg.split('/')" :key="index">{{item}}</span>
|
||||
<span>{{event.orig.lektor}}</span>
|
||||
|
||||
|
||||
<span>{{event.orig.reservierung? event.orig.title :event.orig.lv_info}}</span>
|
||||
<span v-if="event.orig.reservierung">{{'this is a reservierung'}}</span>
|
||||
<span v-else v-for="(item, index) in event.orig.stg.split('/')" :key="index">{{item}}</span>
|
||||
<span>{{event.orig.reservierung? event.orig.uid : event.orig.lektor}}</span>
|
||||
|
||||
</div>
|
||||
</fhc-calendar>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user