From 84845b795837895f72a98ad179062eae3baf19e9 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Tue, 21 May 2024 09:50:36 -0300 Subject: [PATCH] WIP --- src/components/common/VnCard.vue | 4 + src/components/ui/VnSearchbar.vue | 14 +- src/pages/Zone/Card/ZoneCalendar.vue | 256 ++++++++++++++++++++++ src/pages/Zone/Card/ZoneCalendarPanel.vue | 149 +++++++++++++ src/pages/Zone/Card/ZoneCard.vue | 30 +-- src/pages/Zone/locale/en.yml | 1 + src/pages/Zone/locale/es.yml | 1 + src/router/modules/zone.js | 17 +- 8 files changed, 449 insertions(+), 23 deletions(-) create mode 100644 src/pages/Zone/Card/ZoneCalendarPanel.vue diff --git a/src/components/common/VnCard.vue b/src/components/common/VnCard.vue index 58cb12708..e836badec 100644 --- a/src/components/common/VnCard.vue +++ b/src/components/common/VnCard.vue @@ -20,6 +20,8 @@ const props = defineProps({ searchUrl: { type: String, default: undefined }, searchbarLabel: { type: String, default: '' }, searchbarInfo: { type: String, default: '' }, + searchCustomRouteRedirect: { type: String, default: undefined }, + searchRedirect: { type: Boolean, default: false }, }); const stateStore = useStateStore(); @@ -62,6 +64,8 @@ watchEffect(() => { :url="props.searchUrl" :label="props.searchbarLabel" :info="props.searchbarInfo" + :custom-route-redirect-name="searchCustomRouteRedirect" + :redirect="searchRedirect" /> diff --git a/src/components/ui/VnSearchbar.vue b/src/components/ui/VnSearchbar.vue index 38dcf97d1..e5b2f02d2 100644 --- a/src/components/ui/VnSearchbar.vue +++ b/src/components/ui/VnSearchbar.vue @@ -1,5 +1,5 @@ + + + + diff --git a/src/pages/Zone/Card/ZoneCalendarPanel.vue b/src/pages/Zone/Card/ZoneCalendarPanel.vue new file mode 100644 index 000000000..c754d484f --- /dev/null +++ b/src/pages/Zone/Card/ZoneCalendarPanel.vue @@ -0,0 +1,149 @@ + + + diff --git a/src/pages/Zone/Card/ZoneCard.vue b/src/pages/Zone/Card/ZoneCard.vue index 6451fe00c..4c0da8d87 100644 --- a/src/pages/Zone/Card/ZoneCard.vue +++ b/src/pages/Zone/Card/ZoneCard.vue @@ -5,38 +5,30 @@ import { computed } from 'vue'; import VnCard from 'components/common/VnCard.vue'; import ZoneDescriptor from './ZoneDescriptor.vue'; -import VnSearchbar from 'src/components/ui/VnSearchbar.vue'; - -import { useStateStore } from 'stores/useStateStore'; const { t } = useI18n(); -const stateStore = useStateStore(); const route = useRoute(); const routeName = computed(() => route.name); +const customRouteRedirectName = computed(() => { + if (routeName.value === 'ZoneLocations') return null; + return routeName.value; +}); const searchBarDataKeys = { ZoneWarehouses: 'ZoneWarehouses', ZoneSummary: 'ZoneSummary', + ZoneLocations: 'ZoneLocations', + ZoneCalendar: 'ZoneCalendar', }; diff --git a/src/pages/Zone/locale/en.yml b/src/pages/Zone/locale/en.yml index dd79f6ac4..363393996 100644 --- a/src/pages/Zone/locale/en.yml +++ b/src/pages/Zone/locale/en.yml @@ -7,6 +7,7 @@ zone: deliveryDays: Delivery days upcomingList: Upcoming deliveries warehouses: Warehouses + calendar: Calendar list: clone: Clone id: Id diff --git a/src/pages/Zone/locale/es.yml b/src/pages/Zone/locale/es.yml index 43b636d4f..4c8eb6116 100644 --- a/src/pages/Zone/locale/es.yml +++ b/src/pages/Zone/locale/es.yml @@ -7,6 +7,7 @@ zone: deliveryDays: Días de entrega upcomingList: Próximos repartos warehouses: Almacenes + calendar: Calendario list: clone: Clonar id: Id diff --git a/src/router/modules/zone.js b/src/router/modules/zone.js index b79c430e5..a32ba2c49 100644 --- a/src/router/modules/zone.js +++ b/src/router/modules/zone.js @@ -12,7 +12,13 @@ export default { redirect: { name: 'ZoneMain' }, menus: { main: ['ZoneList', 'ZoneDeliveryDays', 'ZoneUpcomingList'], - card: ['ZoneBasicData', 'ZoneWarehouses', 'ZoneHistory', 'ZoneLocations'], + card: [ + 'ZoneBasicData', + 'ZoneWarehouses', + 'ZoneHistory', + 'ZoneLocations', + 'ZoneCalendar', + ], }, children: [ { @@ -110,6 +116,15 @@ export default { }, component: () => import('src/pages/Zone/Card/ZoneLog.vue'), }, + { + name: 'ZoneCalendar', + path: 'events', + meta: { + title: 'calendar', + icon: 'vn:calendar', + }, + component: () => import('src/pages/Zone/Card/ZoneCalendar.vue'), + }, ], }, ],