-
+
{
class="q-mr-sm"
@click="
openConfirmationModal(
- t('zone.deleteTitle'),
- t('zone.deleteSubtitle'),
+ t('eventsPanel.deleteTitle'),
+ t('eventsPanel.deleteSubtitle'),
() => deleteEvent()
)
"
diff --git a/src/pages/Zone/Card/ZoneEvents.vue b/src/pages/Zone/Card/ZoneEvents.vue
index 3452849bc..6d5b37096 100644
--- a/src/pages/Zone/Card/ZoneEvents.vue
+++ b/src/pages/Zone/Card/ZoneEvents.vue
@@ -24,13 +24,14 @@ const zoneEventsFormProps = reactive({
date: null,
});
-const openForm = (data) => {
+const openForm = (data, isBtnAdd) => {
const { date = null, isNewMode, event, eventType, geoIds = [] } = data;
zoneEventsFormProps.date = date;
zoneEventsFormProps.isNewMode = isNewMode;
zoneEventsFormProps.event = event;
zoneEventsFormProps.eventType = eventType;
if (geoIds.length) zoneEventsFormProps.geoIds = geoIds;
+ if (isBtnAdd) formModeName.value = 'include';
showZoneEventForm.value = true;
};
@@ -51,7 +52,6 @@ onUnmounted(() => (stateStore.rightDrawer = false));
:last-day="lastDay"
:events="events"
v-model:formModeName="formModeName"
- @open-zone-form="openForm"
/>
@@ -65,7 +65,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
/>
@@ -78,9 +78,12 @@ onUnmounted(() => (stateStore.rightDrawer = false));
[],
},
- formModeName: {
- type: String,
- required: true,
- default: 'include',
- },
});
-const emit = defineEmits(['openZoneForm', 'update:formModeName']);
-
const { t } = useI18n();
const route = useRoute();
const weekdayStore = useWeekdayStore();
const { openConfirmationModal } = useVnConfirm();
-const formName = computed({
- get: () => props.formModeName,
- set: (value) => emit('update:formModeName', value),
-});
-
const params = computed(() => ({
zoneFk: route.params.id,
started: props.firstDay,
@@ -88,16 +80,6 @@ const deleteEvent = async (id) => {
await fetchData();
};
-const openInclusionForm = (event) => {
- formName.value = 'include';
- emit('openZoneForm', {
- date: event.dated,
- event,
- isNewMode: false,
- eventType: 'event',
- });
-};
-
onMounted(async () => {
weekdayStore.initStore();
});
@@ -110,13 +92,13 @@ onMounted(async () => {
t('eventsPanel.editMode')
}}