Add sticky form button

This commit is contained in:
William Buezas 2024-05-27 13:20:42 -03:00
parent 62443ff44b
commit cff434c1a6
2 changed files with 21 additions and 3 deletions

View File

@ -45,7 +45,7 @@ const { openConfirmationModal } = useVnConfirm();
const isNew = computed(() => props.isNewMode);
const eventInclusionFormData = ref({});
const _inclusionType = ref('day');
const _inclusionType = ref('indefinitely');
const inclusionType = computed({
get: () => _inclusionType.value,
set: (val) => {
@ -111,7 +111,10 @@ onMounted(() => {
if (props.event) {
eventInclusionFormData.value = { ...props.event };
inclusionType.value = props.event?.type || 'day';
} else if (props.date) eventInclusionFormData.value.dated = props.date;
} else if (props.date) {
eventInclusionFormData.value.dated = props.date;
inclusionType.value = 'day';
} else inclusionType.value = 'indefinitely';
});
</script>

View File

@ -25,7 +25,7 @@ const zoneEventsFormProps = reactive({
});
const openForm = (data) => {
const { date, isNewMode, event, eventType, geoIds = [] } = data;
const { date = null, isNewMode, event, eventType, geoIds = [] } = data;
zoneEventsFormProps.date = date;
zoneEventsFormProps.isNewMode = isNewMode;
zoneEventsFormProps.event = event;
@ -90,5 +90,20 @@ const onZoneEventFormClose = () => {
@close-form="onZoneEventFormClose()"
/>
</QDialog>
<QPageSticky :offset="[20, 20]">
<QBtn
@click="
openForm({
isNewMode: true,
})
"
color="primary"
fab
icon="add"
/>
<QTooltip class="text-no-wrap">
{{ t('eventsInclusionForm.addEvent') }}
</QTooltip>
</QPageSticky>
</QPage>
</template>