- il catalogo si aggiorna in base alle impostazioni del template anche per la "Stampa"

This commit is contained in:
Surya Paolo
2025-05-14 20:18:04 +02:00
parent f30cbf072a
commit 300b8434ef
9 changed files with 132 additions and 34 deletions

View File

@@ -90,6 +90,8 @@ export default defineComponent({
const heightpdf = ref('12.31');
const compressionepdf = ref('prepress');
const ismounting = ref(false)
const optDisp = ref([
{ label: 'Tutti', value: costanti.DISP.TUTTI },
{ label: 'Disponibili', value: costanti.DISP.DISPONIBILI },
@@ -578,7 +580,7 @@ export default defineComponent({
}
function populateDataWithlinkIdTemplate() {
// console.log('populateDataWithlinkIdTemplate')
console.log('populateDataWithlinkIdTemplate')
if (optcatalogo.value) {
// LINK PAGINA
@@ -589,6 +591,25 @@ export default defineComponent({
}
}
if (optcatalogo.value.print_linkIdTemplate) {
const reccat2 = globalStore.sovrascriviAreadistampaFromTemplate(optcatalogo.value.print_linkIdTemplate, optcatalogo.value);
if (reccat2) {
const optcatalogo2 = { ...optcatalogo.value };
// optcatalogo2.areadistampa = { ...reccat2.areadistampa};
optcatalogo2.areadistampa.margini = reccat2.areadistampa.margini;
optcatalogo2.areadistampa.unit = reccat2.areadistampa.unit;
optcatalogo2.areadistampa.scalecanvas = reccat2.areadistampa.scalecanvas;
optcatalogo2.areadistampa.scale_printable = reccat2.areadistampa.scale_printable;
optcatalogo2.areadistampa.format = reccat2.areadistampa.format;
optcatalogo2.areadistampa.orientation = reccat2.areadistampa.orientation;
optcatalogo2.areadistampa.compress = reccat2.areadistampa.compress;
// optcatalogo.value = optcatalogo2;
// optcatalogo.value.areadistampa.margini = { left: '50'};
}
// console.log('areadistampa', optcatalogo.value.areadistampa)
}
for (const recscheda of optcatalogo.value.arrSchede!) {
if (recscheda.scheda?.linkIdTemplate) {
// ricopia da Template:
@@ -914,6 +935,8 @@ export default defineComponent({
console.log('***** FINE calcArrPROD');
console.log('areadistampa FINITO...', optcatalogo.value.areadistampa)
generatinglist.value = false;
rigeneraLibri.value = false;
}
@@ -1304,6 +1327,7 @@ export default defineComponent({
async function mounted() {
// console.log('mounted Catalogo')
ismounting.value = true
generatinglist.value = true;
if (optcatalogo.value.showListaArgomenti) cat.value = tools.getCookie(getKeyCatAtLoad(), '');
@@ -1364,6 +1388,8 @@ export default defineComponent({
window.addEventListener('scroll', handleScroll);
calcArrProducts();
ismounting.value = false
}
function loaddata() {
@@ -1863,7 +1889,7 @@ export default defineComponent({
await nextTick();
$q.loading.show({
message: 'Caricamento immagini e generazione PDF in corso...',
message: 'Generazione PDF in corso, attendere ...',
});
try {
@@ -2080,6 +2106,7 @@ export default defineComponent({
getCollane,
pubblicaPDF,
pubblicaPDFStampa,
ismounting,
};
},
});