perf: keyshortcut directive #1315
|
@ -1,6 +1,6 @@
|
|||
export default {
|
||||
mounted: function (el, binding) {
|
||||
const shortcut = binding.value ?? '+';
|
||||
mounted(el, binding) {
|
||||
const shortcut = binding.value || '+';
|
||||
|
||||
const { key, ctrl, alt, callback } =
|
||||
typeof shortcut === 'string'
|
||||
|
@ -8,25 +8,24 @@ export default {
|
|||
key: shortcut,
|
||||
ctrl: true,
|
||||
alt: true,
|
||||
callback: () =>
|
||||
document
|
||||
.querySelector(`button[shortcut="${shortcut}"]`)
|
||||
?.click(),
|
||||
callback: () => el?.click(),
|
||||
}
|
||||
: binding.value;
|
||||
|
||||
if (!el.hasAttribute('shortcut')) {
|
||||
el.setAttribute('shortcut', key);
|
||||
}
|
||||
|
||||
const handleKeydown = (event) => {
|
||||
if (event.key === key && (!ctrl || event.ctrlKey) && (!alt || event.altKey)) {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
// Attach the event listener to the window
|
||||
window.addEventListener('keydown', handleKeydown);
|
||||
|
||||
el._handleKeydown = handleKeydown;
|
||||
},
|
||||
unmounted: function (el) {
|
||||
unmounted(el) {
|
||||
if (el._handleKeydown) {
|
||||
window.removeEventListener('keydown', el._handleKeydown);
|
||||
}
|
||||
|
|
|
@ -282,7 +282,7 @@ const setCategoryList = (data) => {
|
|||
<QItem class="q-mt-lg">
|
||||
<QBtn
|
||||
icon="add_circle"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
flat
|
||||
class="fill-icon-on-hover q-px-xs"
|
||||
color="primary"
|
||||
|
|
|
@ -630,7 +630,7 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
|||
size="md"
|
||||
round
|
||||
flat
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
:disabled="!disabledAttr"
|
||||
/>
|
||||
<QTooltip>
|
||||
|
@ -648,7 +648,7 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
|||
color="primary"
|
||||
fab
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
data-cy="vnTableCreateBtn"
|
||||
/>
|
||||
<QTooltip self="top right">
|
||||
|
|
|
@ -405,7 +405,7 @@ defineExpose({
|
|||
fab
|
||||
color="primary"
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
v-shortcut
|
||||
@click="showFormDialog()"
|
||||
class="fill-icon"
|
||||
>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
import Navbar from 'src/components/NavBar.vue';
|
||||
</script>
|
||||
<template>
|
||||
<QLayout view="hHh LpR fFf" v-shortcut>
|
||||
<QLayout view="hHh LpR fFf">
|
||||
<Navbar />
|
||||
<RouterView></RouterView>
|
||||
<QFooter v-if="$q.platform.is.mobile"></QFooter>
|
||||
|
|
|
@ -86,7 +86,7 @@ watch(
|
|||
() => route.params.id,
|
||||
() => {
|
||||
getAccountData();
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
onMounted(async () => await getAccountData(false));
|
||||
|
@ -130,7 +130,8 @@ onMounted(async () => await getAccountData(false));
|
|||
openConfirmationModal(
|
||||
t('User will be removed from alias'),
|
||||
t('¿Seguro que quieres continuar?'),
|
||||
() => deleteMailAlias(row, rows, rowIndex)
|
||||
() =>
|
||||
deleteMailAlias(row, rows, rowIndex),
|
||||
)
|
||||
"
|
||||
>
|
||||
|
@ -157,7 +158,7 @@ onMounted(async () => await getAccountData(false));
|
|||
icon="add"
|
||||
color="primary"
|
||||
@click="openCreateMailAliasForm()"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
>
|
||||
<QTooltip>{{ t('warehouses.add') }}</QTooltip>
|
||||
</QBtn>
|
||||
|
|
|
@ -63,7 +63,7 @@ watch(
|
|||
store.url = urlPath.value;
|
||||
store.filter = filter.value;
|
||||
fetchSubRoles();
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
const fetchSubRoles = () => paginateRef.value.fetch();
|
||||
|
@ -109,7 +109,7 @@ const redirectToRoleSummary = (id) =>
|
|||
openConfirmationModal(
|
||||
t('El rol va a ser eliminado'),
|
||||
t('¿Seguro que quieres continuar?'),
|
||||
() => deleteSubRole(row, rows, rowIndex)
|
||||
() => deleteSubRole(row, rows, rowIndex),
|
||||
)
|
||||
"
|
||||
>
|
||||
|
@ -131,7 +131,7 @@ const redirectToRoleSummary = (id) =>
|
|||
<QBtn
|
||||
fab
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
color="primary"
|
||||
@click="openCreateSubRoleForm()"
|
||||
>
|
||||
|
|
|
@ -57,7 +57,6 @@ function onFetch(rows, newRows) {
|
|||
const price = row.quantity * sale.price;
|
||||
const discount = (sale.discount * price) / 100;
|
||||
amountClaimed.value = amountClaimed.value + (price - discount);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -208,7 +207,6 @@ async function saveWhenHasChanges() {
|
|||
selection="multiple"
|
||||
v-model:selected="selected"
|
||||
:grid="$q.screen.lt.md"
|
||||
|
||||
>
|
||||
<template #body-cell-claimed="{ row }">
|
||||
<QTd auto-width align="right" class="text-primary shrink">
|
||||
|
@ -319,7 +317,13 @@ async function saveWhenHasChanges() {
|
|||
</div>
|
||||
|
||||
<QPageSticky position="bottom-right" :offset="[25, 25]">
|
||||
<QBtn fab color="primary" shortcut="+" icon="add" @click="showImportDialog()" />
|
||||
<QBtn
|
||||
fab
|
||||
color="primary"
|
||||
v-shortcut="'+'"
|
||||
icon="add"
|
||||
@click="showImportDialog()"
|
||||
/>
|
||||
</QPageSticky>
|
||||
</template>
|
||||
|
||||
|
@ -330,9 +334,10 @@ async function saveWhenHasChanges() {
|
|||
width: 100%;
|
||||
}
|
||||
.grid-style-transition {
|
||||
transition: transform 0.28s, background-color 0.28s;
|
||||
transition:
|
||||
transform 0.28s,
|
||||
background-color 0.28s;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<i18n>
|
||||
|
|
|
@ -61,7 +61,7 @@ watch(
|
|||
() => {
|
||||
claimDmsFilter.value.where.id = router.currentRoute.value.params.id;
|
||||
claimDmsRef.value.fetch();
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
function openDialog(dmsId) {
|
||||
|
@ -249,7 +249,7 @@ function onDrag() {
|
|||
<QBtn
|
||||
fab
|
||||
@click="inputFile.nativeEl.click()"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
icon="add"
|
||||
color="primary"
|
||||
>
|
||||
|
|
|
@ -61,7 +61,7 @@ watch(
|
|||
(newValue) => {
|
||||
if (!newValue) return;
|
||||
getClientData(newValue);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
const getClientData = async (id) => {
|
||||
|
@ -137,7 +137,7 @@ const toCustomerAddressEdit = (addressId) => {
|
|||
<QIcon
|
||||
:style="{
|
||||
'font-variation-settings': `'FILL' ${isDefaultAddress(
|
||||
item
|
||||
item,
|
||||
)}`,
|
||||
}"
|
||||
color="primary"
|
||||
|
@ -150,7 +150,7 @@ const toCustomerAddressEdit = (addressId) => {
|
|||
t(
|
||||
isDefaultAddress(item)
|
||||
? 'Default address'
|
||||
: 'Set as default'
|
||||
: 'Set as default',
|
||||
)
|
||||
}}
|
||||
</QTooltip>
|
||||
|
@ -216,7 +216,7 @@ const toCustomerAddressEdit = (addressId) => {
|
|||
color="primary"
|
||||
fab
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
/>
|
||||
<QTooltip>
|
||||
{{ t('New consignee') }}
|
||||
|
|
|
@ -158,7 +158,7 @@ const columns = computed(() => [
|
|||
openConfirmationModal(
|
||||
t('Send compensation'),
|
||||
t('Do you want to report compensation to the client by mail?'),
|
||||
() => sendEmail(`Receipts/${id}/balance-compensation-email`)
|
||||
() => sendEmail(`Receipts/${id}/balance-compensation-email`),
|
||||
),
|
||||
},
|
||||
],
|
||||
|
@ -291,7 +291,7 @@ const showBalancePdf = ({ id }) => {
|
|||
color="primary"
|
||||
fab
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
/>
|
||||
<QTooltip>
|
||||
{{ t('New payment') }}
|
||||
|
|
|
@ -62,7 +62,7 @@ const customerContactsRef = ref(null);
|
|||
color="primary"
|
||||
flat
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('Add contact') }}
|
||||
|
|
|
@ -195,7 +195,7 @@ const updateData = () => {
|
|||
color="primary"
|
||||
fab
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
/>
|
||||
<QTooltip>
|
||||
{{ t('New contract') }}
|
||||
|
|
|
@ -236,7 +236,7 @@ const toCustomerFileManagementCreate = () => {
|
|||
@click.stop="toCustomerFileManagementCreate()"
|
||||
color="primary"
|
||||
fab
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
icon="add"
|
||||
/>
|
||||
<QTooltip>
|
||||
|
|
|
@ -104,7 +104,7 @@ const tableRef = ref();
|
|||
color="primary"
|
||||
fab
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
/>
|
||||
<QTooltip>
|
||||
{{ t('Send sample') }}
|
||||
|
|
|
@ -49,7 +49,7 @@ const getData = async (observations) => {
|
|||
notes.value = originalNotes
|
||||
.map((observation) => {
|
||||
const type = observationTypes.value.find(
|
||||
(type) => type.id === observation.observationTypeFk
|
||||
(type) => type.id === observation.observationTypeFk,
|
||||
);
|
||||
return type
|
||||
? {
|
||||
|
@ -112,8 +112,8 @@ function getPayload() {
|
|||
(oNote) =>
|
||||
oNote.id === note.id &&
|
||||
(note.description !== oNote.description ||
|
||||
note.observationTypeFk !== oNote.observationTypeFk)
|
||||
)
|
||||
note.observationTypeFk !== oNote.observationTypeFk),
|
||||
),
|
||||
)
|
||||
.map((note) => ({
|
||||
data: note,
|
||||
|
@ -130,9 +130,7 @@ async function handleDialog(data) {
|
|||
.dialog({
|
||||
component: VnConfirm,
|
||||
componentProps: {
|
||||
title: t(
|
||||
'confirmTicket'
|
||||
),
|
||||
title: t('confirmTicket'),
|
||||
message: t('confirmDeletionMessage'),
|
||||
},
|
||||
})
|
||||
|
@ -341,7 +339,7 @@ function handleLocation(data, location) {
|
|||
class="cursor-pointer add-icon q-mt-md"
|
||||
flat
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('Add note') }}
|
||||
|
|
|
@ -17,7 +17,7 @@ const selected = ref([]);
|
|||
|
||||
const sortEntryObservationOptions = (data) => {
|
||||
entryObservationsOptions.value = [...data].sort((a, b) =>
|
||||
a.description.localeCompare(b.description)
|
||||
a.description.localeCompare(b.description),
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -142,7 +142,7 @@ const columns = computed(() => [
|
|||
fab
|
||||
color="primary"
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
@click="entryObservationsRef.insert()"
|
||||
/>
|
||||
</QPageSticky>
|
||||
|
|
|
@ -215,7 +215,7 @@ function deleteFile(dmsFk) {
|
|||
v-else
|
||||
icon="add_circle"
|
||||
round
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
padding="xs"
|
||||
@click="
|
||||
() => {
|
||||
|
|
|
@ -232,7 +232,7 @@ async function insert() {
|
|||
<QBtn
|
||||
color="primary"
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
size="lg"
|
||||
round
|
||||
@click="!areRows ? insert() : invoiceInFormRef.insert()"
|
||||
|
|
|
@ -218,7 +218,7 @@ const columns = computed(() => [
|
|||
<QBtn
|
||||
color="primary"
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
size="lg"
|
||||
round
|
||||
@click="invoiceInFormRef.insert()"
|
||||
|
|
|
@ -117,7 +117,7 @@ const isNotEuro = (code) => code != 'EUR';
|
|||
function taxRate(invoiceInTax) {
|
||||
const sageTaxTypeId = invoiceInTax.taxTypeSageFk;
|
||||
const taxRateSelection = sageTaxTypes.value.find(
|
||||
(transaction) => transaction.id == sageTaxTypeId
|
||||
(transaction) => transaction.id == sageTaxTypeId,
|
||||
);
|
||||
const taxTypeSage = taxRateSelection?.rate ?? 0;
|
||||
const taxableBase = invoiceInTax?.taxableBase ?? 0;
|
||||
|
@ -131,14 +131,14 @@ function autocompleteExpense(evt, row, col) {
|
|||
|
||||
const param = isNaN(val) ? row[col.model] : val;
|
||||
const lookup = expenses.value.find(
|
||||
({ id }) => id == useAccountShortToStandard(param)
|
||||
({ id }) => id == useAccountShortToStandard(param),
|
||||
);
|
||||
|
||||
expenseRef.value.vnSelectDialogRef.vnSelectRef.toggleOption(lookup);
|
||||
}
|
||||
|
||||
const taxableBaseTotal = computed(() => {
|
||||
return getTotal(invoiceInFormRef.value.formData, 'taxableBase', );
|
||||
const taxableBaseTotal = computed(() => {
|
||||
return getTotal(invoiceInFormRef.value.formData, 'taxableBase');
|
||||
});
|
||||
|
||||
const taxRateTotal = computed(() => {
|
||||
|
@ -147,13 +147,9 @@ const taxRateTotal = computed(() => {
|
|||
});
|
||||
});
|
||||
|
||||
|
||||
const combinedTotal = computed(() => {
|
||||
return +taxableBaseTotal.value + +taxRateTotal.value;
|
||||
});
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<FetchData
|
||||
|
@ -283,7 +279,7 @@ const combinedTotal = computed(() => {
|
|||
row.taxableBase = await getExchange(
|
||||
val,
|
||||
row.currencyFk,
|
||||
invoiceIn.issued
|
||||
invoiceIn.issued,
|
||||
);
|
||||
}
|
||||
"
|
||||
|
@ -426,7 +422,7 @@ const combinedTotal = computed(() => {
|
|||
color="primary"
|
||||
icon="add"
|
||||
size="lg"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
round
|
||||
@click="invoiceInFormRef.insert()"
|
||||
>
|
||||
|
|
|
@ -92,7 +92,7 @@ const submit = async (rows) => {
|
|||
class="cursor-pointer fill-icon-on-hover"
|
||||
color="primary"
|
||||
icon="add_circle"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
flat
|
||||
>
|
||||
<QTooltip>
|
||||
|
|
|
@ -175,7 +175,7 @@ const insertTag = (rows) => {
|
|||
@click="insertTag(rows)"
|
||||
color="primary"
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
fab
|
||||
>
|
||||
<QTooltip>
|
||||
|
|
|
@ -110,7 +110,7 @@ const getSelectedTagValues = async (tag) => {
|
|||
</div>
|
||||
<QBtn
|
||||
icon="add_circle"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
flat
|
||||
class="filter-icon q-mb-md"
|
||||
size="md"
|
||||
|
|
|
@ -184,7 +184,7 @@ function addOrder(value, field, params) {
|
|||
{{
|
||||
t(
|
||||
categoryList.find((c) => c.id == customTag.value)?.name ||
|
||||
''
|
||||
'',
|
||||
)
|
||||
}}
|
||||
</strong>
|
||||
|
@ -296,7 +296,7 @@ function addOrder(value, field, params) {
|
|||
<template #append>
|
||||
<QBtn
|
||||
icon="add_circle"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
flat
|
||||
color="primary"
|
||||
size="md"
|
||||
|
|
|
@ -88,7 +88,7 @@ async function deleteWorCenter(id) {
|
|||
</VnPaginate>
|
||||
</div>
|
||||
<QPageSticky :offset="[18, 18]">
|
||||
<QBtn @click.stop="dialog.show()" color="primary" fab shortcut="+" icon="add">
|
||||
<QBtn @click.stop="dialog.show()" color="primary" fab v-shortcut="'+'" icon="add">
|
||||
<QDialog ref="dialog">
|
||||
<FormModelPopup
|
||||
:title="t('Add work center')"
|
||||
|
|
|
@ -68,7 +68,7 @@ const updateDefaultStop = (data) => {
|
|||
<QBtn
|
||||
flat
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
class="cursor-pointer"
|
||||
color="primary"
|
||||
@click="roadmapStopsCrudRef.insert()"
|
||||
|
|
|
@ -120,8 +120,8 @@ const deletePriorities = async () => {
|
|||
try {
|
||||
await Promise.all(
|
||||
selectedRows.value.map((ticket) =>
|
||||
axios.patch(`Tickets/${ticket?.id}/`, { priority: null })
|
||||
)
|
||||
axios.patch(`Tickets/${ticket?.id}/`, { priority: null }),
|
||||
),
|
||||
);
|
||||
} finally {
|
||||
refreshKey.value++;
|
||||
|
@ -132,8 +132,8 @@ const setOrderedPriority = async () => {
|
|||
try {
|
||||
await Promise.all(
|
||||
ticketList.value.map((ticket, index) =>
|
||||
axios.patch(`Tickets/${ticket?.id}/`, { priority: index + 1 })
|
||||
)
|
||||
axios.patch(`Tickets/${ticket?.id}/`, { priority: index + 1 }),
|
||||
),
|
||||
);
|
||||
} finally {
|
||||
refreshKey.value++;
|
||||
|
@ -162,7 +162,7 @@ const setHighestPriority = async (ticket, ticketList) => {
|
|||
const goToBuscaman = async (ticket = null) => {
|
||||
await openBuscaman(
|
||||
routeEntity.value?.vehicleFk,
|
||||
ticket ? [ticket] : selectedRows.value
|
||||
ticket ? [ticket] : selectedRows.value,
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -393,7 +393,13 @@ const openSmsDialog = async () => {
|
|||
</VnPaginate>
|
||||
</div>
|
||||
<QPageSticky :offset="[20, 20]">
|
||||
<QBtn fab icon="add" shortcut="+" color="primary" @click="openTicketsDialog">
|
||||
<QBtn
|
||||
fab
|
||||
icon="add"
|
||||
v-shortcut="'+'"
|
||||
color="primary"
|
||||
@click="openTicketsDialog"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('Add ticket') }}
|
||||
</QTooltip>
|
||||
|
|
|
@ -84,7 +84,7 @@ function exprBuilder(param, value) {
|
|||
</div>
|
||||
<QPageSticky :offset="[20, 20]">
|
||||
<RouterLink :to="{ name: 'ShelvingCreate' }">
|
||||
<QBtn fab icon="add" color="primary" shortcut="+" />
|
||||
<QBtn fab icon="add" color="primary" v-shortcut="'+'" />
|
||||
<QTooltip>
|
||||
{{ t('shelving.list.newShelving') }}
|
||||
</QTooltip>
|
||||
|
|
|
@ -71,7 +71,7 @@ function bankEntityFilter(val, update) {
|
|||
filteredBankEntitiesOptions.value = bankEntitiesOptions.value.filter(
|
||||
(bank) =>
|
||||
bank.bic.toLowerCase().startsWith(needle) ||
|
||||
bank.name.toLowerCase().includes(needle)
|
||||
bank.name.toLowerCase().includes(needle),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
@ -170,7 +170,7 @@ function bankEntityFilter(val, update) {
|
|||
<QIcon name="info" class="cursor-pointer">
|
||||
<QTooltip>{{
|
||||
t(
|
||||
'Name of the bank account holder if different from the provider'
|
||||
'Name of the bank account holder if different from the provider',
|
||||
)
|
||||
}}</QTooltip>
|
||||
</QIcon>
|
||||
|
@ -194,7 +194,7 @@ function bankEntityFilter(val, update) {
|
|||
<QBtn
|
||||
flat
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
v-shortcut
|
||||
class="cursor-pointer"
|
||||
color="primary"
|
||||
@click="supplierAccountRef.insert()"
|
||||
|
|
|
@ -89,7 +89,7 @@ const redirectToUpdateView = (addressData) => {
|
|||
icon="add"
|
||||
color="primary"
|
||||
@click="redirectToCreateView()"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
/>
|
||||
<QTooltip>
|
||||
{{ t('New address') }}
|
||||
|
|
|
@ -114,7 +114,7 @@ const redirectToCreateView = () => {
|
|||
icon="add"
|
||||
color="primary"
|
||||
@click="redirectToCreateView()"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
/>
|
||||
<QTooltip>
|
||||
{{ t('supplier.agencyTerms.addRow') }}
|
||||
|
|
|
@ -78,7 +78,7 @@ const insertRow = () => {
|
|||
<QBtn
|
||||
flat
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
class="cursor-pointer"
|
||||
color="primary"
|
||||
@click="insertRow()"
|
||||
|
|
|
@ -32,7 +32,7 @@ watch(
|
|||
crudModelFilter.where.ticketFk = route.params.id;
|
||||
store.filter = crudModelFilter;
|
||||
await ticketNotesCrudRef.value.reload();
|
||||
}
|
||||
},
|
||||
);
|
||||
function handleDelete(row) {
|
||||
ticketNotesCrudRef.value.remove([row]);
|
||||
|
@ -105,7 +105,7 @@ async function handleSave() {
|
|||
<VnRow v-if="observationTypes.length > rows.length">
|
||||
<QBtn
|
||||
icon="add_circle"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
flat
|
||||
class="fill-icon-on-hover q-ml-md"
|
||||
color="primary"
|
||||
|
|
|
@ -41,7 +41,7 @@ watch(
|
|||
crudModelFilter.where.ticketFk = route.params.id;
|
||||
store.filter = crudModelFilter;
|
||||
await ticketPackagingsCrudRef.value.reload();
|
||||
}
|
||||
},
|
||||
);
|
||||
</script>
|
||||
|
||||
|
@ -118,7 +118,7 @@ watch(
|
|||
<VnRow>
|
||||
<QBtn
|
||||
icon="add_circle"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
flat
|
||||
class="fill-icon-on-hover q-ml-md"
|
||||
color="primary"
|
||||
|
|
|
@ -56,7 +56,7 @@ const canProceed = ref();
|
|||
|
||||
watch(
|
||||
() => route.params.id,
|
||||
() => tableRef.value.reload()
|
||||
() => tableRef.value.reload(),
|
||||
);
|
||||
|
||||
const columns = computed(() => [
|
||||
|
@ -199,7 +199,7 @@ const changeQuantity = async (sale) => {
|
|||
await updateQuantity(sale);
|
||||
} catch (e) {
|
||||
const { quantity } = tableRef.value.CrudModelRef.originalData.find(
|
||||
(s) => s.id === sale.id
|
||||
(s) => s.id === sale.id,
|
||||
);
|
||||
sale.quantity = quantity;
|
||||
throw e;
|
||||
|
@ -503,7 +503,7 @@ async function isSalePrepared(item) {
|
|||
componentProps: {
|
||||
title: t('Item prepared'),
|
||||
message: t(
|
||||
'This item is already prepared. Do you want to continue?'
|
||||
'This item is already prepared. Do you want to continue?',
|
||||
),
|
||||
data: item,
|
||||
},
|
||||
|
@ -525,7 +525,7 @@ watch(
|
|||
if (newItemFk) {
|
||||
updateItem(newRow.value);
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
</script>
|
||||
|
||||
|
@ -595,7 +595,7 @@ watch(
|
|||
openConfirmationModal(
|
||||
t('Continue anyway?'),
|
||||
t('You are going to delete lines of the ticket'),
|
||||
removeSales
|
||||
removeSales,
|
||||
)
|
||||
"
|
||||
>
|
||||
|
@ -856,7 +856,7 @@ watch(
|
|||
color="primary"
|
||||
fab
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
data-cy="ticketSaleAddToBasketBtn"
|
||||
/>
|
||||
<QTooltip class="text-no-wrap">
|
||||
|
|
|
@ -40,7 +40,7 @@ watch(
|
|||
async () => {
|
||||
store.filter = crudModelFilter.value;
|
||||
await ticketServiceCrudRef.value.reload();
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
onMounted(async () => await getDefaultTaxClass());
|
||||
|
@ -59,7 +59,7 @@ const createRefund = async () => {
|
|||
t('service.createRefundSuccess', {
|
||||
ticketId: refundTicket.id,
|
||||
}),
|
||||
'positive'
|
||||
'positive',
|
||||
);
|
||||
router.push({ name: 'TicketSale', params: { id: refundTicket.id } });
|
||||
};
|
||||
|
@ -225,7 +225,7 @@ async function handleSave() {
|
|||
color="primary"
|
||||
icon="add"
|
||||
@click="ticketServiceCrudRef.insert()"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
/>
|
||||
</QPageSticky>
|
||||
</template>
|
||||
|
|
|
@ -19,7 +19,7 @@ watch(
|
|||
async (val) => {
|
||||
paginateFilter.where.ticketFk = val;
|
||||
paginateRef.value.fetch();
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
const paginateFilter = reactive({
|
||||
|
@ -119,7 +119,7 @@ const openCreateModal = () => createTrackingDialogRef.value.show();
|
|||
color="primary"
|
||||
fab
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
/>
|
||||
<QTooltip class="text-no-wrap">
|
||||
{{ t('tracking.addState') }}
|
||||
|
|
|
@ -217,7 +217,7 @@ const removeThermograph = async (id) => {
|
|||
icon="add"
|
||||
color="primary"
|
||||
@click="redirectToThermographForm('create')"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
/>
|
||||
<QTooltip class="text-no-wrap">
|
||||
{{ t('Add thermograph') }}
|
||||
|
|
|
@ -113,7 +113,7 @@ warehouses();
|
|||
<template #append>
|
||||
<QBtn
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
flat
|
||||
dense
|
||||
size="12px"
|
||||
|
|
|
@ -96,7 +96,13 @@ async function remove(row) {
|
|||
>
|
||||
</VnTable>
|
||||
<QPageSticky :offset="[18, 18]">
|
||||
<QBtn @click.stop="dialog.show()" color="primary" fab icon="add" shortcut="+">
|
||||
<QBtn
|
||||
@click.stop="dialog.show()"
|
||||
color="primary"
|
||||
fab
|
||||
icon="add"
|
||||
v-shortcut="'+'"
|
||||
>
|
||||
<QDialog ref="dialog">
|
||||
<FormModelPopup
|
||||
:title="t('Create new Wagon type')"
|
||||
|
|
|
@ -101,7 +101,7 @@ function reloadData() {
|
|||
openConfirmationModal(
|
||||
t(`Remove PDA`),
|
||||
t('Do you want to remove this PDA?'),
|
||||
() => deallocatePDA(row.deviceProductionFk)
|
||||
() => deallocatePDA(row.deviceProductionFk),
|
||||
)
|
||||
"
|
||||
>
|
||||
|
@ -114,7 +114,13 @@ function reloadData() {
|
|||
</template>
|
||||
</VnPaginate>
|
||||
<QPageSticky :offset="[18, 18]">
|
||||
<QBtn @click.stop="dialog.show()" color="primary" fab icon="add" shortcut="+">
|
||||
<QBtn
|
||||
@click.stop="dialog.show()"
|
||||
color="primary"
|
||||
fab
|
||||
icon="add"
|
||||
v-shortcut="'+'"
|
||||
>
|
||||
<QDialog ref="dialog">
|
||||
<FormModelPopup
|
||||
:title="t('Add new device')"
|
||||
|
|
|
@ -221,7 +221,7 @@ const deleteRelative = async (id) => {
|
|||
color="primary"
|
||||
flat
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
style="flex: 0"
|
||||
data-cy="addRelative"
|
||||
/>
|
||||
|
|
|
@ -69,12 +69,12 @@ const acl = useAcl();
|
|||
const selectedDateYear = computed(() => moment(selectedDate.value).isoWeekYear());
|
||||
const worker = computed(() => arrayData.store?.data);
|
||||
const canSend = computed(() =>
|
||||
acl.hasAny([{ model: 'WorkerTimeControl', props: 'sendMail', accessType: 'WRITE' }])
|
||||
acl.hasAny([{ model: 'WorkerTimeControl', props: 'sendMail', accessType: 'WRITE' }]),
|
||||
);
|
||||
const canUpdate = computed(() =>
|
||||
acl.hasAny([
|
||||
{ model: 'WorkerTimeControl', props: 'updateMailState', accessType: 'WRITE' },
|
||||
])
|
||||
]),
|
||||
);
|
||||
const isHimself = computed(() => user.value.id === Number(route.params.id));
|
||||
|
||||
|
@ -100,7 +100,7 @@ const getHeaderFormattedDate = (date) => {
|
|||
};
|
||||
|
||||
const formattedWeekTotalHours = computed(() =>
|
||||
secondsToHoursMinutes(weekTotalHours.value)
|
||||
secondsToHoursMinutes(weekTotalHours.value),
|
||||
);
|
||||
|
||||
const onInputChange = async (date) => {
|
||||
|
@ -320,7 +320,7 @@ const getFinishTime = () => {
|
|||
today.setHours(0, 0, 0, 0);
|
||||
|
||||
let todayInWeek = weekDays.value.find(
|
||||
(day) => day.dated.getTime() === today.getTime()
|
||||
(day) => day.dated.getTime() === today.getTime(),
|
||||
);
|
||||
|
||||
if (todayInWeek && todayInWeek.hours && todayInWeek.hours.length) {
|
||||
|
@ -472,7 +472,7 @@ onMounted(async () => {
|
|||
openConfirmationModal(
|
||||
t('Send time control email'),
|
||||
t('Are you sure you want to send it?'),
|
||||
resendEmail
|
||||
resendEmail,
|
||||
)
|
||||
"
|
||||
>
|
||||
|
@ -561,7 +561,7 @@ onMounted(async () => {
|
|||
@show-worker-time-form="
|
||||
showWorkerTimeForm(
|
||||
{ id: hour.id, entryCode: hour.direction },
|
||||
'edit'
|
||||
'edit',
|
||||
)
|
||||
"
|
||||
class="hour-chip"
|
||||
|
@ -577,7 +577,7 @@ onMounted(async () => {
|
|||
</span>
|
||||
<QBtn
|
||||
icon="add_circle"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
flat
|
||||
color="primary"
|
||||
class="fill-icon cursor-pointer"
|
||||
|
|
|
@ -173,7 +173,7 @@ function handleEvent(type, event, node) {
|
|||
color="primary"
|
||||
flat
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
class="cursor-pointer"
|
||||
@click.stop="showCreateNodeForm(node.id)"
|
||||
>
|
||||
|
|
|
@ -78,13 +78,13 @@ const onZoneEventFormClose = () => {
|
|||
{
|
||||
isNewMode: true,
|
||||
},
|
||||
true
|
||||
true,
|
||||
)
|
||||
"
|
||||
color="primary"
|
||||
fab
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
/>
|
||||
<QTooltip class="text-no-wrap">
|
||||
{{ t('eventsInclusionForm.addEvent') }}
|
||||
|
|
|
@ -49,7 +49,7 @@ watch(
|
|||
store.url = urlPath.value;
|
||||
store.filter.include = 'warehouse';
|
||||
fetchWarehouses();
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
const fetchWarehouses = () => paginateRef.value.fetch();
|
||||
|
@ -84,7 +84,8 @@ const openCreateWarehouseForm = () => createWarehouseDialogRef.value.show();
|
|||
openConfirmationModal(
|
||||
t('zone.deleteTitle'),
|
||||
t('zone.deleteSubtitle'),
|
||||
() => deleteWarehouse(row, rows, rowIndex)
|
||||
() =>
|
||||
deleteWarehouse(row, rows, rowIndex),
|
||||
)
|
||||
"
|
||||
>
|
||||
|
@ -108,7 +109,7 @@ const openCreateWarehouseForm = () => createWarehouseDialogRef.value.show();
|
|||
icon="add"
|
||||
color="primary"
|
||||
@click="openCreateWarehouseForm()"
|
||||
shortcut="+"
|
||||
v-shortcut="'+'"
|
||||
>
|
||||
<QTooltip>{{ t('warehouses.add') }}</QTooltip>
|
||||
</QBtn>
|
||||
|
|
|
@ -74,7 +74,7 @@ async function remove(row) {
|
|||
</VnPaginate>
|
||||
</div>
|
||||
<QPageSticky position="bottom-right" :offset="[18, 18]">
|
||||
<QBtn @click="create" fab icon="add" shortcut="+" color="primary" />
|
||||
<QBtn @click="create" fab icon="add" v-shortcut="'+'" color="primary" />
|
||||
</QPageSticky>
|
||||
</QPage>
|
||||
</template>
|
||||
|
|
|
@ -74,7 +74,7 @@ async function remove(row) {
|
|||
</VnPaginate>
|
||||
</div>
|
||||
<QPageSticky position="bottom-right" :offset="[18, 18]">
|
||||
<QBtn @click="create" fab icon="add" shortcut="+" color="primary" />
|
||||
<QBtn @click="create" fab icon="add" v-shortcut="'+'" color="primary" />
|
||||
</QPageSticky>
|
||||
</QPage>
|
||||
</template>
|
||||
|
|
|
@ -28,6 +28,17 @@ describe('VnShortcuts', () => {
|
|||
});
|
||||
|
||||
cy.url().should('include', module);
|
||||
if (['monitor', 'claim'].includes(module)) {
|
||||
return;
|
||||
}
|
||||
cy.waitForElement('.q-page').should('exist');
|
||||
cy.dataCy('vnTableCreateBtn').should('exist');
|
||||
cy.get('.q-page').trigger('keydown', {
|
||||
ctrlKey: true,
|
||||
altKey: true,
|
||||
key: '+',
|
||||
});
|
||||
cy.get('#formModel').should('exist');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue