From 309033c6de572ca410e82739802ae63210abe46d Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 11 Dec 2024 06:05:38 +0100 Subject: [PATCH] fix: fixed panel function --- .../Item/ItemType/Card/ItemTypeSummary.vue | 23 +++++++------ src/pages/Item/ItemType/locale/en.yml | 33 ++++++++++--------- src/pages/Item/ItemType/locale/es.yml | 33 ++++++++++--------- src/pages/Zone/Card/ZoneEvents.vue | 1 + src/pages/Zone/Card/ZoneEventsPanel.vue | 27 +++++++++++---- 5 files changed, 69 insertions(+), 48 deletions(-) diff --git a/src/pages/Item/ItemType/Card/ItemTypeSummary.vue b/src/pages/Item/ItemType/Card/ItemTypeSummary.vue index c51d59e13..9ba774ca4 100644 --- a/src/pages/Item/ItemType/Card/ItemTypeSummary.vue +++ b/src/pages/Item/ItemType/Card/ItemTypeSummary.vue @@ -78,29 +78,32 @@ async function setItemTypeData(data) { {{ t('globals.summary.basicData') }} - - - - + + + + - + - - + + diff --git a/src/pages/Item/ItemType/locale/en.yml b/src/pages/Item/ItemType/locale/en.yml index 575d5e402..99c6791f2 100644 --- a/src/pages/Item/ItemType/locale/en.yml +++ b/src/pages/Item/ItemType/locale/en.yml @@ -1,16 +1,17 @@ -shared: - code: Code - name: Name - worker: Worker - category: Category - temperature: Temperature - life: Life - itemPackingType: Item packing type - maxRefs: Maximum references - fragile: Fragile -summary: - id: id - life: Life - promo: Promo - itemPackingType: Item packing type - isUnconventionalSize: Is unconventional size +itemType: + shared: + code: Code + name: Name + worker: Worker + category: Category + temperature: Temperature + life: Life + itemPackingType: Item packing type + maxRefs: Maximum references + fragile: Fragile + summary: + id: id + life: Life + promo: Promo + itemPackingType: Item packing type + isUnconventionalSize: Is unconventional size diff --git a/src/pages/Item/ItemType/locale/es.yml b/src/pages/Item/ItemType/locale/es.yml index 93f8b0d0e..c91fb4058 100644 --- a/src/pages/Item/ItemType/locale/es.yml +++ b/src/pages/Item/ItemType/locale/es.yml @@ -1,16 +1,17 @@ -shared: - code: Código - name: Nombre - worker: Trabajador - category: Reino - temperature: Temperatura - life: Vida - itemPackingType: Tipo de embalaje - maxRefs: Referencias máximas - fragile: Frágil -summary: - id: id - life: Vida - promo: Promoción - itemPackingType: Tipo de embalaje - isUnconventionalSize: Es de tamaño poco convencional +itemType: + shared: + code: Código + name: Nombre + worker: Trabajador + category: Reino + temperature: Temperatura + life: Vida + itemPackingType: Tipo de embalaje + maxRefs: Referencias máximas + fragile: Frágil + summary: + id: id + life: Vida + promo: Promoción + itemPackingType: Tipo de embalaje + isUnconventionalSize: Es de tamaño poco convencional diff --git a/src/pages/Zone/Card/ZoneEvents.vue b/src/pages/Zone/Card/ZoneEvents.vue index 6d5b37096..923a72391 100644 --- a/src/pages/Zone/Card/ZoneEvents.vue +++ b/src/pages/Zone/Card/ZoneEvents.vue @@ -52,6 +52,7 @@ onUnmounted(() => (stateStore.rightDrawer = false)); :last-day="lastDay" :events="events" v-model:formModeName="formModeName" + @open-zone-form="openForm" /> diff --git a/src/pages/Zone/Card/ZoneEventsPanel.vue b/src/pages/Zone/Card/ZoneEventsPanel.vue index da1c0cf71..bb8c15934 100644 --- a/src/pages/Zone/Card/ZoneEventsPanel.vue +++ b/src/pages/Zone/Card/ZoneEventsPanel.vue @@ -11,10 +11,6 @@ import { dashIfEmpty } from 'src/filters'; import { useWeekdayStore } from 'src/stores/useWeekdayStore'; import { useVnConfirm } from 'composables/useVnConfirm'; -const formModeName = defineModel('formModeName', { - type: String, - required: true, -}); const props = defineProps({ firstDay: { type: Date, @@ -31,8 +27,18 @@ const props = defineProps({ required: true, default: () => [], }, + formModeName: { + type: String, + required: true, + default: 'include', + }, }); +const formName = computed({ + get: () => props.formModeName, + set: (value) => emit('update:formModeName', value), +}); +const emit = defineEmits(['openZoneForm', 'update:formModeName']); const { t } = useI18n(); const route = useRoute(); const weekdayStore = useWeekdayStore(); @@ -80,6 +86,15 @@ const deleteEvent = async (id) => { await fetchData(); }; +const openInclusionForm = (event) => { + formName.value = 'include'; + emit('openZoneForm', { + date: event.dated, + event, + isNewMode: false, + }); +}; + onMounted(async () => { weekdayStore.initStore(); }); @@ -92,13 +107,13 @@ onMounted(async () => { t('eventsPanel.editMode') }}