- il catalogo si aggiorna in base alle impostazioni del template anche per la "Stampa"
This commit is contained in:
@@ -345,6 +345,8 @@ export default defineComponent({
|
|||||||
if (!myel.value.catalogo.areadistampa) {
|
if (!myel.value.catalogo.areadistampa) {
|
||||||
myel.value.catalogo.areadistampa = tools.resetRecIAreaDiStampa(null);
|
myel.value.catalogo.areadistampa = tools.resetRecIAreaDiStampa(null);
|
||||||
myel.value.catalogo.areadistampa.margini = { left: '0.59', top: '0.59', right: '0.59', bottom: '0.28' };
|
myel.value.catalogo.areadistampa.margini = { left: '0.59', top: '0.59', right: '0.59', bottom: '0.28' };
|
||||||
|
myel.value.catalogo.print_isTemplate = false;
|
||||||
|
myel.value.catalogo.print_linkIdTemplate = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
myel.value.catalogo.areadistampa = tools.resetRecIAreaDiStampa(myel.value.catalogo.areadistampa);
|
myel.value.catalogo.areadistampa = tools.resetRecIAreaDiStampa(myel.value.catalogo.areadistampa);
|
||||||
@@ -363,6 +365,8 @@ export default defineComponent({
|
|||||||
myel.value.catalogo.dimensioni_def.pagina
|
myel.value.catalogo.dimensioni_def.pagina
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('Area di stampa MOUNTED... ',myel.value.catalogo.areadistampa)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1788,15 +1788,6 @@
|
|||||||
@update:model-value="modifElem"
|
@update:model-value="modifElem"
|
||||||
>
|
>
|
||||||
</q-toggle>
|
</q-toggle>
|
||||||
<q-input
|
|
||||||
label="Nome Template"
|
|
||||||
@update:model-value="modifElem"
|
|
||||||
v-model="myel.catalogo.dimensioni_def.name"
|
|
||||||
filled
|
|
||||||
debounce="1000"
|
|
||||||
v-on:keyup.enter="saveElem"
|
|
||||||
>
|
|
||||||
</q-input>
|
|
||||||
<q-select
|
<q-select
|
||||||
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
|
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
|
||||||
v-if="enableEdit"
|
v-if="enableEdit"
|
||||||
@@ -2380,7 +2371,6 @@
|
|||||||
@saveFieldElem="saveFieldElem"
|
@saveFieldElem="saveFieldElem"
|
||||||
@update:model-value="modifElem"
|
@update:model-value="modifElem"
|
||||||
label="Testo"
|
label="Testo"
|
||||||
debounce="1000"
|
|
||||||
>
|
>
|
||||||
</CMyText>
|
</CMyText>
|
||||||
</div>
|
</div>
|
||||||
@@ -2409,7 +2399,6 @@
|
|||||||
@saveFieldElem="saveFieldElem"
|
@saveFieldElem="saveFieldElem"
|
||||||
@update:model-value="modifElem"
|
@update:model-value="modifElem"
|
||||||
label="Testo"
|
label="Testo"
|
||||||
debounce="1000"
|
|
||||||
>
|
>
|
||||||
</CMyText>
|
</CMyText>
|
||||||
</div>
|
</div>
|
||||||
@@ -2422,7 +2411,30 @@
|
|||||||
label="Per Stampa"
|
label="Per Stampa"
|
||||||
icon="fas fa-play-circle"
|
icon="fas fa-play-circle"
|
||||||
>
|
>
|
||||||
<div class="sfondo_print">
|
<q-toggle
|
||||||
|
v-model="myel.catalogo.print_isTemplate"
|
||||||
|
color="positive"
|
||||||
|
icon="fas fa-file-pdf"
|
||||||
|
label="E' un template"
|
||||||
|
@update:model-value="modifElem"
|
||||||
|
>
|
||||||
|
</q-toggle>
|
||||||
|
<q-select
|
||||||
|
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
|
||||||
|
v-if="enableEdit"
|
||||||
|
rounded
|
||||||
|
outlined
|
||||||
|
v-model="myel.catalogo.print_linkIdTemplate"
|
||||||
|
:options="Products.getOptCatalogoPrintTemplate()"
|
||||||
|
@update:model-value="modifElem"
|
||||||
|
label="Catalogo Stampa collegato:"
|
||||||
|
style="width: 250px"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
>
|
||||||
|
</q-select>
|
||||||
|
|
||||||
|
<div :class="{ 'sfondo_print': !myel.catalogo.print_linkIdTemplate, 'bg-grey': myel.catalogo.print_linkIdTemplate }">
|
||||||
Per Stampa:
|
Per Stampa:
|
||||||
<q-toggle
|
<q-toggle
|
||||||
v-model="myel.catalogo.printable"
|
v-model="myel.catalogo.printable"
|
||||||
|
|||||||
@@ -57,12 +57,14 @@ export default defineComponent({
|
|||||||
|
|
||||||
const sliderValue = computed({
|
const sliderValue = computed({
|
||||||
get: () => {
|
get: () => {
|
||||||
if (!props.modelValue)
|
if (!props.modelValue) return 0;
|
||||||
return ''
|
const clean = String(props.modelValue).replace(props.addstr, '');
|
||||||
const mystr = props.modelValue + ''
|
return Number(clean) || 0;
|
||||||
return mystr.replace(props.addstr, '')
|
|
||||||
},
|
},
|
||||||
set: (value) => emit('update:modelValue', value ? value + props.addstr : '')
|
set: (value) => {
|
||||||
|
const valWithSuffix = value ? value + props.addstr : '';
|
||||||
|
emit('update:modelValue', valWithSuffix);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
function valoreinc() {
|
function valoreinc() {
|
||||||
|
|||||||
@@ -208,6 +208,13 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (optcatalogo.value.print_linkIdTemplate) {
|
||||||
|
const reccatalog = globalStore.sovrascriviAreadistampaFromTemplate(optcatalogo.value.print_linkIdTemplate, optcatalogo.value);
|
||||||
|
if (reccatalog) {
|
||||||
|
optcatalogo.value.areadistampa = { ...reccatalog.areadistampa};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// LINK SCHEDA
|
// LINK SCHEDA
|
||||||
for (const recscheda of optcatalogo.value.arrSchede!) {
|
for (const recscheda of optcatalogo.value.arrSchede!) {
|
||||||
if (recscheda.scheda?.linkIdTemplate) {
|
if (recscheda.scheda?.linkIdTemplate) {
|
||||||
|
|||||||
@@ -903,6 +903,9 @@ export interface IOptCatalogo {
|
|||||||
last_page?: IDimensioni
|
last_page?: IDimensioni
|
||||||
areadistampa?: IAreaDiStampa
|
areadistampa?: IAreaDiStampa
|
||||||
|
|
||||||
|
print_isTemplate?: boolean
|
||||||
|
print_linkIdTemplate?: string
|
||||||
|
|
||||||
dimensioni_def?: IElementiPagina
|
dimensioni_def?: IElementiPagina
|
||||||
|
|
||||||
arrSchede?: ISchedaSingola[]
|
arrSchede?: ISchedaSingola[]
|
||||||
|
|||||||
@@ -1936,6 +1936,32 @@ export const useProducts = defineStore('Products', {
|
|||||||
|
|
||||||
return arr
|
return arr
|
||||||
},
|
},
|
||||||
|
getOptCatalogoPrintTemplate() {
|
||||||
|
// Ottieni l'array delle pagine che in cataloghi sono dimensioni_def.isTemplate
|
||||||
|
|
||||||
|
let arr: any = [];
|
||||||
|
|
||||||
|
const globalStore = useGlobalStore();
|
||||||
|
|
||||||
|
arr.push({ label: '[Nessuna]', value: '' });
|
||||||
|
|
||||||
|
for (const myelem of globalStore.myelems) {
|
||||||
|
if (myelem.catalogo && myelem.catalogo.print_isTemplate) {
|
||||||
|
const page = globalStore.getPageById(myelem.idPage);
|
||||||
|
let pagename = page ? page.title! : '';
|
||||||
|
|
||||||
|
if (pagename) {
|
||||||
|
pagename = '[Pag: ' + pagename + '] ';
|
||||||
|
}
|
||||||
|
|
||||||
|
const mylabel = pagename;
|
||||||
|
|
||||||
|
arr.push({ label: mylabel, value: myelem._id });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return arr
|
||||||
|
},
|
||||||
|
|
||||||
getSchedeOpt(arrschede: ISchedaSingola[], tag?: string): any[] {
|
getSchedeOpt(arrschede: ISchedaSingola[], tag?: string): any[] {
|
||||||
let arr: any = [];
|
let arr: any = [];
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
|||||||
},
|
},
|
||||||
|
|
||||||
sovrascriviPaginaDefaultFromTemplate:
|
sovrascriviPaginaDefaultFromTemplate:
|
||||||
(state: IGlobalState) => (idTemplate: string, origDimensioni: IDimensioni, optcatalogo: IOptCatalogo) => {
|
(state: IGlobalState) => (idTemplate: string, origDimensioni: IDimensioni) => {
|
||||||
|
|
||||||
const myfindelem = state.myelems.find((myelem: IMyElem) => myelem._id === idTemplate);
|
const myfindelem = state.myelems.find((myelem: IMyElem) => myelem._id === idTemplate);
|
||||||
|
|
||||||
@@ -261,6 +261,28 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
|||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
sovrascriviAreadistampaFromTemplate:
|
||||||
|
(state: IGlobalState) => (idTemplate: string, optCatalogo: IOptCatalogo) => {
|
||||||
|
|
||||||
|
const myfindelem = state.myelems.find((myelem: IMyElem) => myelem._id === idTemplate);
|
||||||
|
|
||||||
|
const linkIdTemplate = optCatalogo.print_linkIdTemplate;
|
||||||
|
|
||||||
|
if (myfindelem) {
|
||||||
|
const myelemtocopy = tools.jsonCopy(myfindelem);
|
||||||
|
|
||||||
|
if (myelemtocopy) {
|
||||||
|
// myelemtocopy.scheda._id = origScheda.scheda?._id;
|
||||||
|
myelemtocopy.catalogo.print_isTemplate = false;
|
||||||
|
myelemtocopy.catalogo.print_linkIdTemplate = linkIdTemplate;
|
||||||
|
|
||||||
|
return myelemtocopy.catalogo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
|
||||||
// conta: (state: IGlobalState) => { state.conta },
|
// conta: (state: IGlobalState) => { state.conta },
|
||||||
// listatodo: (state: IGlobalState) => { state.listatodo },
|
// listatodo: (state: IGlobalState) => { state.listatodo },
|
||||||
// category: (state: IGlobalState) => { state.category },
|
// category: (state: IGlobalState) => { state.category },
|
||||||
@@ -2499,6 +2521,9 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
|||||||
pagina: tools.resetRecIDimensioni(null),
|
pagina: tools.resetRecIDimensioni(null),
|
||||||
},
|
},
|
||||||
areadistampa: tools.resetRecIAreaDiStampa(null),
|
areadistampa: tools.resetRecIAreaDiStampa(null),
|
||||||
|
print_isTemplate: false,
|
||||||
|
print_linkIdTemplate: '',
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
createRaccoltaCataloghiVuoto(): IOptCatalogo {
|
createRaccoltaCataloghiVuoto(): IOptCatalogo {
|
||||||
@@ -2517,6 +2542,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
|||||||
pagina: tools.resetRecIDimensioni(null),
|
pagina: tools.resetRecIDimensioni(null),
|
||||||
},
|
},
|
||||||
areadistampa: tools.resetRecIAreaDiStampa(null),
|
areadistampa: tools.resetRecIAreaDiStampa(null),
|
||||||
|
print_isTemplate: false,
|
||||||
|
print_linkIdTemplate: '',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -90,6 +90,8 @@ export default defineComponent({
|
|||||||
const heightpdf = ref('12.31');
|
const heightpdf = ref('12.31');
|
||||||
const compressionepdf = ref('prepress');
|
const compressionepdf = ref('prepress');
|
||||||
|
|
||||||
|
const ismounting = ref(false)
|
||||||
|
|
||||||
const optDisp = ref([
|
const optDisp = ref([
|
||||||
{ label: 'Tutti', value: costanti.DISP.TUTTI },
|
{ label: 'Tutti', value: costanti.DISP.TUTTI },
|
||||||
{ label: 'Disponibili', value: costanti.DISP.DISPONIBILI },
|
{ label: 'Disponibili', value: costanti.DISP.DISPONIBILI },
|
||||||
@@ -578,7 +580,7 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
function populateDataWithlinkIdTemplate() {
|
function populateDataWithlinkIdTemplate() {
|
||||||
// console.log('populateDataWithlinkIdTemplate')
|
console.log('populateDataWithlinkIdTemplate')
|
||||||
|
|
||||||
if (optcatalogo.value) {
|
if (optcatalogo.value) {
|
||||||
// LINK PAGINA
|
// 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!) {
|
for (const recscheda of optcatalogo.value.arrSchede!) {
|
||||||
if (recscheda.scheda?.linkIdTemplate) {
|
if (recscheda.scheda?.linkIdTemplate) {
|
||||||
// ricopia da Template:
|
// ricopia da Template:
|
||||||
@@ -914,6 +935,8 @@ export default defineComponent({
|
|||||||
|
|
||||||
console.log('***** FINE calcArrPROD');
|
console.log('***** FINE calcArrPROD');
|
||||||
|
|
||||||
|
console.log('areadistampa FINITO...', optcatalogo.value.areadistampa)
|
||||||
|
|
||||||
generatinglist.value = false;
|
generatinglist.value = false;
|
||||||
rigeneraLibri.value = false;
|
rigeneraLibri.value = false;
|
||||||
}
|
}
|
||||||
@@ -1304,6 +1327,7 @@ export default defineComponent({
|
|||||||
async function mounted() {
|
async function mounted() {
|
||||||
// console.log('mounted Catalogo')
|
// console.log('mounted Catalogo')
|
||||||
|
|
||||||
|
ismounting.value = true
|
||||||
generatinglist.value = true;
|
generatinglist.value = true;
|
||||||
|
|
||||||
if (optcatalogo.value.showListaArgomenti) cat.value = tools.getCookie(getKeyCatAtLoad(), '');
|
if (optcatalogo.value.showListaArgomenti) cat.value = tools.getCookie(getKeyCatAtLoad(), '');
|
||||||
@@ -1364,6 +1388,8 @@ export default defineComponent({
|
|||||||
window.addEventListener('scroll', handleScroll);
|
window.addEventListener('scroll', handleScroll);
|
||||||
|
|
||||||
calcArrProducts();
|
calcArrProducts();
|
||||||
|
|
||||||
|
ismounting.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
function loaddata() {
|
function loaddata() {
|
||||||
@@ -1863,7 +1889,7 @@ export default defineComponent({
|
|||||||
await nextTick();
|
await nextTick();
|
||||||
|
|
||||||
$q.loading.show({
|
$q.loading.show({
|
||||||
message: 'Caricamento immagini e generazione PDF in corso...',
|
message: 'Generazione PDF in corso, attendere ...',
|
||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -2080,6 +2106,7 @@ export default defineComponent({
|
|||||||
getCollane,
|
getCollane,
|
||||||
pubblicaPDF,
|
pubblicaPDF,
|
||||||
pubblicaPDFStampa,
|
pubblicaPDFStampa,
|
||||||
|
ismounting,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -90,11 +90,6 @@
|
|||||||
id="spinner"
|
id="spinner"
|
||||||
:showing="generatinglist"
|
:showing="generatinglist"
|
||||||
>
|
>
|
||||||
<q-spinner-tail
|
|
||||||
color="primary"
|
|
||||||
size="4em"
|
|
||||||
>
|
|
||||||
</q-spinner-tail>
|
|
||||||
</q-inner-loading>
|
</q-inner-loading>
|
||||||
|
|
||||||
<q-tab-panel
|
<q-tab-panel
|
||||||
@@ -227,7 +222,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<CProductTable
|
<CProductTable
|
||||||
v-if="loadpage && lista_prodotti?.length > 0"
|
v-if="!ismounting && lista_prodotti?.length > 0"
|
||||||
:lista_prodotti="lista_prodotti"
|
:lista_prodotti="lista_prodotti"
|
||||||
@update:lista_prodotti="updateProducts"
|
@update:lista_prodotti="updateProducts"
|
||||||
:optcatalogo="optcatalogo"
|
:optcatalogo="optcatalogo"
|
||||||
@@ -244,23 +239,18 @@
|
|||||||
id="spinner"
|
id="spinner"
|
||||||
:showing="generatinglist"
|
:showing="generatinglist"
|
||||||
>
|
>
|
||||||
<q-spinner-tail
|
|
||||||
color="primary"
|
|
||||||
size="4em"
|
|
||||||
>
|
|
||||||
</q-spinner-tail>
|
|
||||||
</q-inner-loading>
|
</q-inner-loading>
|
||||||
<div class="row justify-center q-mx-auto bg-blue-1">
|
<div class="row justify-center q-mx-auto bg-blue-1">
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<q-spinner
|
<q-spinner
|
||||||
v-if="!loadpage"
|
v-if="ismounting"
|
||||||
color="primary"
|
color="primary"
|
||||||
size="3em"
|
size="3em"
|
||||||
:thickness="2"
|
:thickness="2"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="loadpage"
|
v-if="!ismounting"
|
||||||
class="panel"
|
class="panel"
|
||||||
>
|
>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
@@ -643,7 +633,7 @@
|
|||||||
<div :style="generateStyleCatalogo(optcatalogo)">
|
<div :style="generateStyleCatalogo(optcatalogo)">
|
||||||
<div class="flex-container-book">
|
<div class="flex-container-book">
|
||||||
<q-infinite-scroll
|
<q-infinite-scroll
|
||||||
v-if="!optcatalogo.pdf && arrLoaded && arrLoaded.length > 0"
|
v-if="!optcatalogo.pdf && arrLoaded && arrLoaded.length > 0 && !ismounting"
|
||||||
ref="myinfscroll"
|
ref="myinfscroll"
|
||||||
:initial-index="0"
|
:initial-index="0"
|
||||||
@load="onLoadScroll"
|
@load="onLoadScroll"
|
||||||
|
|||||||
Reference in New Issue
Block a user