Schedule UX tweaks
This commit is contained in:
@@ -56,9 +56,10 @@
|
|||||||
:model-resources="boatStore.boats"
|
:model-resources="boatStore.boats"
|
||||||
resource-key="id"
|
resource-key="id"
|
||||||
resource-label="name"
|
resource-label="name"
|
||||||
:interval-start="6"
|
:interval-start="12"
|
||||||
:interval-count="18"
|
:interval-count="36"
|
||||||
cell-width="64"
|
:interval-minutes="30"
|
||||||
|
cell-width="48"
|
||||||
resource-min-height="40"
|
resource-min-height="40"
|
||||||
animated
|
animated
|
||||||
bordered
|
bordered
|
||||||
@@ -96,15 +97,6 @@
|
|||||||
stack-label
|
stack-label
|
||||||
><template v-slot:append><q-icon name="timelapse" /></template></q-select
|
><template v-slot:append><q-icon name="timelapse" /></template></q-select
|
||||||
></q-card-section>
|
></q-card-section>
|
||||||
<q-card-section>
|
|
||||||
<q-btn
|
|
||||||
color="primary"
|
|
||||||
class="full-width"
|
|
||||||
icon="keyboard_arrow_down"
|
|
||||||
icon-right="keyboard_arrow_down"
|
|
||||||
label="Next: Crew & Passengers"
|
|
||||||
@click="onCloseSection"
|
|
||||||
/></q-card-section>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@@ -200,7 +192,7 @@ function getStyle(event: {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const emit = defineEmits(['onClickTime', 'onCloseSection', 'onUpdateDuration']);
|
const emit = defineEmits(['onClickTime', 'onUpdateDuration']);
|
||||||
|
|
||||||
function onPrev() {
|
function onPrev() {
|
||||||
calendar.value.prev();
|
calendar.value.prev();
|
||||||
@@ -215,9 +207,6 @@ function onClickTime(data) {
|
|||||||
// TODO: Add a duration picker, here.
|
// TODO: Add a duration picker, here.
|
||||||
emit('onClickTime', data);
|
emit('onClickTime', data);
|
||||||
}
|
}
|
||||||
function onCloseSection() {
|
|
||||||
emit('onCloseSection');
|
|
||||||
}
|
|
||||||
function onUpdateDuration(value) {
|
function onUpdateDuration(value) {
|
||||||
emit('onUpdateDuration', value);
|
emit('onUpdateDuration', value);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,32 +23,40 @@
|
|||||||
<q-separator />
|
<q-separator />
|
||||||
<resource-schedule-viewer-component
|
<resource-schedule-viewer-component
|
||||||
@on-click-time="onClickTime"
|
@on-click-time="onClickTime"
|
||||||
@on-close-section="() => (resourceView = !resourceView)"
|
|
||||||
@on-update-duration="
|
@on-update-duration="
|
||||||
(value) => {
|
(value) => {
|
||||||
bookingForm.duration = value;
|
bookingForm.duration = value;
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
/></q-expansion-item>
|
/>
|
||||||
|
<q-banner
|
||||||
<q-banner
|
rounded
|
||||||
rounded
|
class="bg-warning text-grey-10"
|
||||||
class="bg-warning text-grey-10"
|
v-if="bookingForm.boat?.defects"
|
||||||
v-if="bookingForm.boat?.defects"
|
>
|
||||||
>
|
<template v-slot:avatar>
|
||||||
<template v-slot:avatar>
|
<q-icon name="warning" color="grey-10" />
|
||||||
<q-icon name="warning" color="grey-10" />
|
</template>
|
||||||
</template>
|
{{ bookingForm.boat.name }} currently has the following notices:
|
||||||
This boat currently has the following notices:
|
<ol>
|
||||||
<ol>
|
<li
|
||||||
<li
|
v-for="defect in bookingForm.boat.defects"
|
||||||
v-for="defect in bookingForm.boat.defects"
|
:key="defect.description"
|
||||||
:key="defect.description"
|
>
|
||||||
>
|
{{ defect.description }}
|
||||||
{{ defect.description }}
|
</li>
|
||||||
</li>
|
</ol>
|
||||||
</ol>
|
</q-banner>
|
||||||
</q-banner>
|
<q-card-section>
|
||||||
|
<q-btn
|
||||||
|
color="primary"
|
||||||
|
class="full-width"
|
||||||
|
icon="keyboard_arrow_down"
|
||||||
|
icon-right="keyboard_arrow_down"
|
||||||
|
label="Next: Crew & Passengers"
|
||||||
|
@click="resourceView = false"
|
||||||
|
/></q-card-section>
|
||||||
|
</q-expansion-item>
|
||||||
<q-expansion-item
|
<q-expansion-item
|
||||||
expand-separator
|
expand-separator
|
||||||
icon="people"
|
icon="people"
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ export const useScheduleStore = defineStore('schedule', () => {
|
|||||||
return (
|
return (
|
||||||
(x.start.getDate() == curDate.getDate() ||
|
(x.start.getDate() == curDate.getDate() ||
|
||||||
x.end.getDate() == curDate.getDate()) &&
|
x.end.getDate() == curDate.getDate()) &&
|
||||||
|
x.resource != undefined &&
|
||||||
(typeof boat == 'number'
|
(typeof boat == 'number'
|
||||||
? x.resource.id == boat
|
? x.resource.id == boat
|
||||||
: x.resource.name == boat)
|
: x.resource.name == boat)
|
||||||
@@ -107,6 +108,7 @@ export const useScheduleStore = defineStore('schedule', () => {
|
|||||||
const isOverlapped = (res: Reservation) => {
|
const isOverlapped = (res: Reservation) => {
|
||||||
const lapped = reservations.value.filter(
|
const lapped = reservations.value.filter(
|
||||||
(entry: Reservation) =>
|
(entry: Reservation) =>
|
||||||
|
entry.id != res.id &&
|
||||||
entry.resource == res.resource &&
|
entry.resource == res.resource &&
|
||||||
((entry.start <= res.start && entry.end > res.start) ||
|
((entry.start <= res.start && entry.end > res.start) ||
|
||||||
(entry.end >= res.end && entry.start <= res.end))
|
(entry.end >= res.end && entry.start <= res.end))
|
||||||
|
|||||||
Reference in New Issue
Block a user