fix: redirection when clone and styles
gitea/salix-front/pipeline/pr-dev This commit looks good Details

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 { .q-scrollarea__content {
max-width: 100%; max-width: 100%;
} }
.mt-15 {
margin-top: 15px;
}

View File

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