Compare commits
2 Commits
a8953bbae6
...
511014d043
Author | SHA1 | Date |
---|---|---|
Ferdinand Thiessen | 511014d043 | |
Ferdinand Thiessen | a0192418e2 |
|
@ -78,7 +78,7 @@
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
<q-card-section v-for="(job, index) in event.jobs" :key="index">
|
<q-card-section v-for="(job, index) in event.jobs" :key="index">
|
||||||
<q-card class="q-my-auto">
|
<q-card class="q-my-auto">
|
||||||
<job
|
<edit-job-slot
|
||||||
v-model="event.jobs[index]"
|
v-model="event.jobs[index]"
|
||||||
:job-can-delete="jobDeleteDisabled"
|
:job-can-delete="jobDeleteDisabled"
|
||||||
@remove-job="removeJob(index)"
|
@remove-job="removeJob(index)"
|
||||||
|
@ -105,12 +105,12 @@ import { date, ModifyDateOptions } from 'quasar';
|
||||||
import { useScheduleStore } from '../../store';
|
import { useScheduleStore } from '../../store';
|
||||||
import { notEmpty } from '@flaschengeist/api';
|
import { notEmpty } from '@flaschengeist/api';
|
||||||
import { IsoDateInput } from '@flaschengeist/api/components';
|
import { IsoDateInput } from '@flaschengeist/api/components';
|
||||||
import Job from './Job.vue';
|
import EditJobSlot from './EditJobSlot.vue';
|
||||||
import RecurrenceRule from './RecurrenceRule.vue';
|
import RecurrenceRule from './RecurrenceRule.vue';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'EditEvent',
|
name: 'EditEvent',
|
||||||
components: { IsoDateInput, Job, RecurrenceRule },
|
components: { IsoDateInput, EditJobSlot, RecurrenceRule },
|
||||||
props: {
|
props: {
|
||||||
modelValue: {
|
modelValue: {
|
||||||
required: false,
|
required: false,
|
||||||
|
|
|
@ -56,7 +56,7 @@ import { notEmpty } from '@flaschengeist/api';
|
||||||
import { useScheduleStore } from '../../store';
|
import { useScheduleStore } from '../../store';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'Job',
|
name: 'JobSlot',
|
||||||
components: { IsoDateInput },
|
components: { IsoDateInput },
|
||||||
props: {
|
props: {
|
||||||
modelValue: {
|
modelValue: {
|
||||||
|
@ -95,8 +95,8 @@ export default defineComponent({
|
||||||
emit('remove-job');
|
emit('remove-job');
|
||||||
}
|
}
|
||||||
|
|
||||||
function isAfterDate(val: string) {
|
function isAfterDate(val: Date) {
|
||||||
return props.modelValue.start < new Date(val) || 'Ende muss hinter dem Start liegen';
|
return props.modelValue.start < val || 'Ende muss hinter dem Start liegen';
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
|
@ -49,6 +49,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-12 col-sm-3 text-center">
|
<div class="col-xs-12 col-sm-3 text-center">
|
||||||
<q-btn-toggle
|
<q-btn-toggle
|
||||||
|
v-if="$q.screen.gt.xs"
|
||||||
v-model="calendarView"
|
v-model="calendarView"
|
||||||
flat
|
flat
|
||||||
stretch
|
stretch
|
||||||
|
@ -80,7 +81,7 @@
|
||||||
</template>
|
</template>
|
||||||
<template #day="{ scope: { timestamp } }">
|
<template #day="{ scope: { timestamp } }">
|
||||||
<div itemref="" class="q-pb-sm" style="min-height: 200px">
|
<div itemref="" class="q-pb-sm" style="min-height: 200px">
|
||||||
<eventslot
|
<event-slot
|
||||||
v-for="(agenda, index) in events[timestamp.weekday]"
|
v-for="(agenda, index) in events[timestamp.weekday]"
|
||||||
:key="index"
|
:key="index"
|
||||||
v-model="events[timestamp.weekday][index]"
|
v-model="events[timestamp.weekday][index]"
|
||||||
|
@ -98,27 +99,27 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { ComponentPublicInstance, computed, defineComponent, onBeforeMount, ref } from 'vue';
|
import { ComponentPublicInstance, computed, defineComponent, onBeforeMount, ref } from 'vue';
|
||||||
import { useScheduleStore } from '../../store';
|
import { useScheduleStore } from '../../store';
|
||||||
import Eventslot from './slots/EventSlot.vue';
|
import EventSlot from './slots/EventSlot.vue';
|
||||||
import { date } from 'quasar';
|
import { date, useQuasar } from 'quasar';
|
||||||
import { startOfWeek } from '@flaschengeist/api';
|
import { startOfWeek } from '@flaschengeist/api';
|
||||||
import EditEvent from '../management/EditEvent.vue';
|
import EditEvent from '../management/EditEvent.vue';
|
||||||
import { QCalendarAgenda } from '@quasar/quasar-ui-qcalendar';
|
import { QCalendarAgenda } from '@quasar/quasar-ui-qcalendar';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'AgendaView',
|
name: 'AgendaView',
|
||||||
components: { Eventslot, EditEvent, QCalendarAgenda: <ComponentPublicInstance>QCalendarAgenda },
|
components: { EventSlot, EditEvent, QCalendarAgenda: <ComponentPublicInstance>QCalendarAgenda },
|
||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
const store = useScheduleStore();
|
const store = useScheduleStore();
|
||||||
const windowWidth = ref(window.innerWidth);
|
const quasar = useQuasar();
|
||||||
|
|
||||||
const selectedDate = ref(date.formatDate(new Date(), 'YYYY-MM-DD'));
|
const selectedDate = ref(date.formatDate(new Date(), 'YYYY-MM-DD'));
|
||||||
const proxyDate = ref('');
|
const proxyDate = ref('');
|
||||||
const calendarView = ref('week');
|
const calendarView = ref('week');
|
||||||
|
|
||||||
const calendarRealView = computed(() => (calendarDays.value != 7 ? 'day' : 'week'));
|
const calendarRealView = computed(() => (calendarDays.value != 7 ? 'day' : 'week'));
|
||||||
const calendarDays = computed(() =>
|
const calendarDays = computed(() =>
|
||||||
// <= 1023 is the breakpoint for sm to md
|
(calendarView.value == 'day' || quasar.screen.xs) ? 1 : quasar.screen.sm ? 3 : 7
|
||||||
calendarView.value == 'day' ? 1 : windowWidth.value <= 1023 ? 3 : 7
|
|
||||||
);
|
);
|
||||||
const events = ref<Agendas>({});
|
const events = ref<Agendas>({});
|
||||||
const editor = ref<FG.Event | undefined>(undefined);
|
const editor = ref<FG.Event | undefined>(undefined);
|
||||||
|
@ -128,10 +129,6 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
|
|
||||||
onBeforeMount(async () => {
|
onBeforeMount(async () => {
|
||||||
window.addEventListener('resize', () => {
|
|
||||||
windowWidth.value = window.innerWidth;
|
|
||||||
});
|
|
||||||
|
|
||||||
await loadAgendas();
|
await loadAgendas();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -4,13 +4,13 @@
|
||||||
bordered
|
bordered
|
||||||
>
|
>
|
||||||
<q-card-section class="text-primary q-pa-xs">
|
<q-card-section class="text-primary q-pa-xs">
|
||||||
<div class="text-weight-bolder text-center" style="font-size: 1.5vw">
|
<div class="text-weight-bolder text-center">
|
||||||
{{ event.type.name }}
|
{{ event.type.name }}
|
||||||
<template v-if="event.name"
|
<template v-if="event.name"
|
||||||
>: <span style="font-size: 1.2vw">{{ event.name }}</span>
|
>: <span>{{ event.name }}</span>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="event.description" class="text-weight-medium" style="font-size: 1vw">
|
<div v-if="event.description" class="text-weight-medium">
|
||||||
{{ event.description }}
|
{{ event.description }}
|
||||||
</div>
|
</div>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
|
@ -53,7 +53,7 @@ import { PERMISSIONS } from '../../../permissions';
|
||||||
import JobSlot from './JobSlot.vue';
|
import JobSlot from './JobSlot.vue';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'Eventslot',
|
name: 'EventSlot',
|
||||||
components: { JobSlot },
|
components: { JobSlot },
|
||||||
props: {
|
props: {
|
||||||
modelValue: {
|
modelValue: {
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
<q-tab-panel name="agendaView">
|
<q-tab-panel name="agendaView">
|
||||||
<AgendaView />
|
<AgendaView />
|
||||||
</q-tab-panel>
|
</q-tab-panel>
|
||||||
<q-tab-panel name="eventtypes">
|
<q-tab-panel name="listView">
|
||||||
</q-tab-panel>
|
</q-tab-panel>
|
||||||
</q-tab-panels>
|
</q-tab-panels>
|
||||||
</q-page>
|
</q-page>
|
||||||
|
@ -44,27 +44,23 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { computed, defineComponent, ref } from 'vue';
|
import { computed, defineComponent, ref } from 'vue';
|
||||||
import AgendaView from '../components/overview/AgendaView.vue';
|
import AgendaView from '../components/overview/AgendaView.vue';
|
||||||
import { Screen } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'EventOverview',
|
name: 'EventOverview',
|
||||||
components: { AgendaView },
|
components: { AgendaView },
|
||||||
setup() {
|
setup() {
|
||||||
interface Tab {
|
const quasar = useQuasar();
|
||||||
name: string;
|
|
||||||
label: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const tabs: Tab[] = [
|
const tabs = computed(() => ([
|
||||||
|
{ name: 'listView', label: 'Liste' },
|
||||||
{ name: 'agendaView', label: 'Kalendar' }
|
{ name: 'agendaView', label: 'Kalendar' }
|
||||||
];
|
]));
|
||||||
|
|
||||||
const drawer = ref<boolean>(false);
|
const drawer = ref<boolean>(false);
|
||||||
|
|
||||||
const showDrawer = computed({
|
const showDrawer = computed({
|
||||||
get: () => {
|
get: () => !quasar.screen.gt.sm && drawer.value,
|
||||||
return !Screen.gt.sm && drawer.value;
|
|
||||||
},
|
|
||||||
set: (val: boolean) => {
|
set: (val: boolean) => {
|
||||||
drawer.value = val;
|
drawer.value = val;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue