0
0
Fork 0

fix: redirection when clone and styles

This commit is contained in:
Alex Moreno 2024-05-13 09:30:03 +02:00
parent daf1d4de2d
commit a28d18f1e1
2 changed files with 26 additions and 38 deletions

View File

@ -182,7 +182,3 @@ input::-webkit-inner-spin-button {
.q-scrollarea__content {
max-width: 100%;
}
.mt-15 {
margin-top: 15px;
}

View File

@ -106,13 +106,9 @@ const exprBuilder = (param, value) => {
};
async function clone(id) {
try {
await axios.post(`Zones/${id}/clone`);
notify(t('globals.dataSaved'), 'positive');
router.push({ name: 'ZoneBasicData', params: { id } });
} catch (error) {
console.error('Error cloning zone: ', error);
}
const { data } = await axios.post(`Zones/${id}/clone`);
notify(t('globals.dataSaved'), 'positive');
router.push({ name: 'ZoneBasicData', params: { id: data.id } });
}
const handleClone = (id) => {
openConfirmationModal(
@ -154,6 +150,7 @@ onMounted(async () => {
:filter="{
include: { relation: 'agencyMode', scope: { fields: ['name'] } },
}"
:limit="20"
auto-load
>
<template #body="{ rows }">
@ -184,34 +181,29 @@ onMounted(async () => {
<QTd :props="props">
<QTr :props="props" class="cursor-pointer">
{{ props.value }}
</QTr></QTd
></template
>
</QTr>
</QTd>
</template>
<template #body-cell-actions="props">
<QTd :props="props">
<div class="table-actions">
<QIcon
class="mt-15"
name="vn:clone"
size="sm"
color="primary"
@click.stop="handleClone(props.row.id)"
>
<QTooltip>{{
t('globals.clone')
}}</QTooltip> </QIcon
><QIcon
class="mt-15"
name="preview"
size="sm"
color="primary"
@click.stop="
viewSummary(props.row.id, ZoneSummary)
"
>
<QTooltip>{{ t('Preview') }}</QTooltip>
</QIcon>
</div>
<QTd :props="props" class="q-gutter-x-sm">
<QIcon
name="vn:clone"
size="sm"
color="primary"
@click.stop="handleClone(props.row.id)"
>
<QTooltip>{{ t('globals.clone') }}</QTooltip>
</QIcon>
<QIcon
name="preview"
size="sm"
color="primary"
@click.stop="
viewSummary(props.row.id, ZoneSummary)
"
>
<QTooltip>{{ t('Preview') }}</QTooltip>
</QIcon>
</QTd>
</template>
</QTable>