diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a973777a..31b8831f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -113,7 +113,10 @@ - refs #7355 fix lists redirects summary by:carlossa - refs #7355 fix roles by:carlossa - refs #7355 fix search exprBuilder by:carlossa -- refs #7355 fix vnTable by:carlos + <<<<<<< HEAD +- # refs #7355 fix vnTable by:carlos +- refs #7355 fix vnTable by:carlossa + > > > > > > > 1b8a72175cc1dbae0590217b03d855bf2ff6d07d # Version 24.32 - 2024-08-06 diff --git a/package.json b/package.json index 72bada823..f25e570a3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "salix-front", - "version": "24.34.0", + "version": "24.36.0", "description": "Salix frontend", "productName": "Salix", "author": "Verdnatura", diff --git a/src/boot/mainShortcutMixin.js b/src/boot/mainShortcutMixin.js new file mode 100644 index 000000000..3b5c604b7 --- /dev/null +++ b/src/boot/mainShortcutMixin.js @@ -0,0 +1,38 @@ +import routes from 'src/router/modules'; +import { useRouter } from 'vue-router'; + +let isNotified = false; + +export default { + created: function () { + const router = useRouter(); + const keyBindingMap = routes + .filter((route) => route.meta.keyBinding) + .reduce((map, route) => { + map[route.meta.keyBinding.toLowerCase()] = route.path; + return map; + }, {}); + + const handleKeyDown = (event) => { + const { ctrlKey, altKey, key } = event; + + if (ctrlKey && altKey && keyBindingMap[key] && !isNotified) { + event.preventDefault(); + router.push(keyBindingMap[key]); + isNotified = true; + } + }; + + const handleKeyUp = (event) => { + const { ctrlKey, altKey } = event; + + // Resetea la bandera cuando se sueltan las teclas ctrl o alt + if (!ctrlKey || !altKey) { + isNotified = false; + } + }; + + window.addEventListener('keydown', handleKeyDown); + window.addEventListener('keyup', handleKeyUp); + }, +}; diff --git a/src/boot/quasar.js b/src/boot/quasar.js index a8d9b7ad9..caf573ac7 100644 --- a/src/boot/quasar.js +++ b/src/boot/quasar.js @@ -1,6 +1,8 @@ import { boot } from 'quasar/wrappers'; import qFormMixin from './qformMixin'; +import mainShortcutMixin from './mainShortcutMixin'; export default boot(({ app }) => { app.mixin(qFormMixin); + app.mixin(mainShortcutMixin); }); diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue index 22ef1622c..05f947cf3 100644 --- a/src/components/FormModel.vue +++ b/src/components/FormModel.vue @@ -22,7 +22,7 @@ const { t } = useI18n(); const { validate } = useValidator(); const { notify } = useNotify(); const route = useRoute(); - +const myForm = ref(null); const $props = defineProps({ url: { type: String, @@ -109,11 +109,14 @@ const defaultButtons = computed(() => ({ color: 'primary', icon: 'save', label: 'globals.save', + click: () => myForm.value.submit(), + type: 'submit', }, reset: { color: 'primary', icon: 'restart_alt', label: 'globals.reset', + click: () => reset(), }, ...$props.defaultButtons, })); @@ -276,7 +279,14 @@ defineExpose({ - - + + + + + + + + + + + diff --git a/src/components/common/VnCard.vue b/src/components/common/VnCard.vue index 03a7ce7da..a7fe651ad 100644 --- a/src/components/common/VnCard.vue +++ b/src/components/common/VnCard.vue @@ -8,7 +8,6 @@ import VnSubToolbar from '../ui/VnSubToolbar.vue'; import VnSearchbar from 'components/ui/VnSearchbar.vue'; import LeftMenu from 'components/LeftMenu.vue'; import RightMenu from 'components/common/RightMenu.vue'; - const props = defineProps({ dataKey: { type: String, required: true }, baseUrl: { type: String, default: undefined }, @@ -74,7 +73,7 @@ if (props.baseUrl) {
- +
diff --git a/src/components/common/VnInput.vue b/src/components/common/VnInput.vue index 33b97e29d..75d4b8a28 100644 --- a/src/components/common/VnInput.vue +++ b/src/components/common/VnInput.vue @@ -1,6 +1,7 @@ + + + es: + Id: Id + Nickname: Nickname + Name: Nombre + diff --git a/src/pages/Account/Card/AccountCard.vue b/src/pages/Account/Card/AccountCard.vue index a9857b283..67fa15898 100644 --- a/src/pages/Account/Card/AccountCard.vue +++ b/src/pages/Account/Card/AccountCard.vue @@ -15,7 +15,6 @@ const { t } = useI18n(); url: 'VnUsers/preview', label: t('account.search'), info: t('account.searchInfo'), - searchUrl: 'table', }" /> diff --git a/src/pages/Account/Card/AccountPrivileges.vue b/src/pages/Account/Card/AccountPrivileges.vue index 1300f5018..0574e08d2 100644 --- a/src/pages/Account/Card/AccountPrivileges.vue +++ b/src/pages/Account/Card/AccountPrivileges.vue @@ -1,5 +1,5 @@