From 585919a4d957b9d6cc03e8f34b47ea682b7eaf32 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 6 Sep 2024 09:19:38 +0200 Subject: [PATCH] feat: refs #7889 added shortcuts to modules --- src/boot/mainShortcutMixin.js | 1 - src/pages/Dashboard/DashboardMain.vue | 6 ++++++ src/router/modules/Supplier.js | 2 ++ src/router/modules/account.js | 2 ++ src/router/modules/claim.js | 2 ++ src/router/modules/customer.js | 2 ++ src/router/modules/entry.js | 2 ++ src/router/modules/item.js | 2 ++ src/router/modules/monitor.js | 2 ++ src/router/modules/order.js | 2 ++ src/router/modules/route.js | 1 - src/router/modules/ticket.js | 2 ++ src/router/modules/worker.js | 2 ++ src/router/modules/zone.js | 2 ++ src/stores/useNavigationStore.js | 1 + 15 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/boot/mainShortcutMixin.js b/src/boot/mainShortcutMixin.js index 3b5c604b7..c684fc924 100644 --- a/src/boot/mainShortcutMixin.js +++ b/src/boot/mainShortcutMixin.js @@ -15,7 +15,6 @@ export default { const handleKeyDown = (event) => { const { ctrlKey, altKey, key } = event; - if (ctrlKey && altKey && keyBindingMap[key] && !isNotified) { event.preventDefault(); router.push(keyBindingMap[key]); diff --git a/src/pages/Dashboard/DashboardMain.vue b/src/pages/Dashboard/DashboardMain.vue index 6da39ce25..eaeddb682 100644 --- a/src/pages/Dashboard/DashboardMain.vue +++ b/src/pages/Dashboard/DashboardMain.vue @@ -55,6 +55,12 @@ const pinnedModules = computed(() => navigation.getPinnedModules()); >
{{ t(item.title) }} +
+ {{ '(' + item.subtitle + ')' }} + + {{ 'Ctrl + Alt + ' + item.subtitle }} + +
diff --git a/src/router/modules/Supplier.js b/src/router/modules/Supplier.js index b711066b2..e620e485c 100644 --- a/src/router/modules/Supplier.js +++ b/src/router/modules/Supplier.js @@ -5,8 +5,10 @@ export default { name: 'Supplier', meta: { title: 'suppliers', + subtitle: 'P', icon: 'vn:supplier', moduleName: 'Supplier', + keyBinding: 'p', }, component: RouterView, redirect: { name: 'SupplierMain' }, diff --git a/src/router/modules/account.js b/src/router/modules/account.js index cfec2b95d..dbf641c4a 100644 --- a/src/router/modules/account.js +++ b/src/router/modules/account.js @@ -5,8 +5,10 @@ export default { name: 'Account', meta: { title: 'users', + subtitle: 'U', icon: 'face', moduleName: 'Account', + keyBinding: 'u', }, component: RouterView, redirect: { name: 'AccountMain' }, diff --git a/src/router/modules/claim.js b/src/router/modules/claim.js index cced9e24d..eb7a348fe 100644 --- a/src/router/modules/claim.js +++ b/src/router/modules/claim.js @@ -5,8 +5,10 @@ export default { path: '/claim', meta: { title: 'claims', + subtitle: 'R', icon: 'vn:claims', moduleName: 'Claim', + keyBinding: 'r', }, component: RouterView, redirect: { name: 'ClaimMain' }, diff --git a/src/router/modules/customer.js b/src/router/modules/customer.js index 684b83b0f..1e74b77bd 100644 --- a/src/router/modules/customer.js +++ b/src/router/modules/customer.js @@ -5,8 +5,10 @@ export default { name: 'Customer', meta: { title: 'customers', + subtitle: 'C', icon: 'vn:client', moduleName: 'Customer', + keyBinding: 'c', }, component: RouterView, redirect: { name: 'CustomerMain' }, diff --git a/src/router/modules/entry.js b/src/router/modules/entry.js index 0d38ed626..d3639e2f1 100644 --- a/src/router/modules/entry.js +++ b/src/router/modules/entry.js @@ -5,8 +5,10 @@ export default { name: 'Entry', meta: { title: 'entries', + subtitle: 'E', icon: 'vn:entry', moduleName: 'Entry', + keyBinding: '€', }, component: RouterView, redirect: { name: 'EntryMain' }, diff --git a/src/router/modules/item.js b/src/router/modules/item.js index 4bd5df4e2..80dcf4ae0 100644 --- a/src/router/modules/item.js +++ b/src/router/modules/item.js @@ -5,8 +5,10 @@ export default { name: 'Item', meta: { title: 'items', + subtitle: 'A', icon: 'vn:item', moduleName: 'Item', + keyBinding: 'a', }, component: RouterView, redirect: { name: 'ItemMain' }, diff --git a/src/router/modules/monitor.js b/src/router/modules/monitor.js index 3353da3cf..74a2826e2 100644 --- a/src/router/modules/monitor.js +++ b/src/router/modules/monitor.js @@ -5,8 +5,10 @@ export default { name: 'Monitor', meta: { title: 'monitors', + subtitle: 'M', icon: 'grid_view', moduleName: 'Monitor', + keyBinding: 'm', }, component: RouterView, redirect: { name: 'MonitorMain' }, diff --git a/src/router/modules/order.js b/src/router/modules/order.js index 9ccdb820b..861eb7938 100644 --- a/src/router/modules/order.js +++ b/src/router/modules/order.js @@ -5,8 +5,10 @@ export default { name: 'Order', meta: { title: 'order', + subtitle: 'O', icon: 'vn:basket', moduleName: 'Order', + keyBinding: 'o', }, component: RouterView, redirect: { name: 'OrderMain' }, diff --git a/src/router/modules/route.js b/src/router/modules/route.js index 955fc9098..3c5c860cf 100644 --- a/src/router/modules/route.js +++ b/src/router/modules/route.js @@ -7,7 +7,6 @@ export default { title: 'routes', icon: 'vn:delivery', moduleName: 'Route', - keyBinding: 'r', }, component: RouterView, redirect: { name: 'RouteMain' }, diff --git a/src/router/modules/ticket.js b/src/router/modules/ticket.js index 4074f089f..9c9b2cbf3 100644 --- a/src/router/modules/ticket.js +++ b/src/router/modules/ticket.js @@ -5,8 +5,10 @@ export default { path: '/ticket', meta: { title: 'tickets', + subtitle: 'T', icon: 'vn:ticket', moduleName: 'Ticket', + keyBinding: 't', }, component: RouterView, redirect: { name: 'TicketMain' }, diff --git a/src/router/modules/worker.js b/src/router/modules/worker.js index 2a523e7fe..4395319bf 100644 --- a/src/router/modules/worker.js +++ b/src/router/modules/worker.js @@ -5,8 +5,10 @@ export default { name: 'Worker', meta: { title: 'workers', + subtitle: 'W', icon: 'vn:worker', moduleName: 'Worker', + keyBinding: 'w', }, component: RouterView, redirect: { name: 'WorkerMain' }, diff --git a/src/router/modules/zone.js b/src/router/modules/zone.js index 40358c58e..c82616286 100644 --- a/src/router/modules/zone.js +++ b/src/router/modules/zone.js @@ -5,8 +5,10 @@ export default { name: 'Zone', meta: { title: 'zones', + subtitle: 'Z', icon: 'vn:zone', moduleName: 'Zone', + keyBinding: 'z', }, component: RouterView, redirect: { name: 'ZoneMain' }, diff --git a/src/stores/useNavigationStore.js b/src/stores/useNavigationStore.js index 961e80377..67b632b00 100644 --- a/src/stores/useNavigationStore.js +++ b/src/stores/useNavigationStore.js @@ -72,6 +72,7 @@ export const useNavigationStore = defineStore('navigationStore', () => { if (meta) { item.title = `globals.pageTitles.${meta.title}`; item.icon = meta.icon; + item.subtitle = meta.subtitle; } parent.push(item);