- Cataloghi: qualita di stampa e margini

This commit is contained in:
Surya Paolo
2024-11-22 20:23:37 +01:00
parent 5cd9bd40f6
commit 6a6c15b62c
24 changed files with 1031 additions and 530 deletions

View File

@@ -18,7 +18,7 @@
:label="`Crea PDF ${optcatalogo.pdf_filename}`"
@click="generatePDF"
></q-btn>
<div class="row q-gutter-xs justify-center q-mx-auto bg-blue-1">
<div class="row justify-center q-mx-auto bg-blue-1">
<div class="text-center">
<q-spinner
v-if="!loadpage"
@@ -49,7 +49,7 @@
<q-tab-panels v-model="tabvisu" animated class="">
<q-tab-panel name="categorie">
<div
class="row q-gutter-xs justify-center q-mx-auto bg-blue-1"
class="row justify-center q-mx-auto bg-blue-1"
>
<div v-for="(reccat, index) in getCatProds()" :key="index">
<span
@@ -207,29 +207,35 @@
:class="{ 'fixed-width': true }"
>
<div
v-if="optcatalogo.first_page_img"
v-if="
optcatalogo.first_page &&
optcatalogo.first_page.text_html.contenuto
"
:style="{
backgroundImage: `url(${
costanti.DIR_UPLOAD +
costanti.DIR_CATALOGO +
(optcatalogo.printable
? optcatalogo.first_page_img
: optcatalogo.first_page_img)
optcatalogo.first_page.imgsfondo.imagefile
})`,
backgroundSize: `${
optcatalogo.printable
? scheda.bgSize_printable
: scheda.bgSize
}`,
height: optcatalogo.first_page_height + 'px',
width: optcatalogo.first_page_width + 'px',
backgroundSize: `${optcatalogo.first_page.imgsfondo.fit}`,
backgroundRepeat: 'no-repeat',
height:
tools.adjustSize(
optcatalogo,
optcatalogo.first_page.size.height
) + 'px',
width:
tools.adjustSize(
optcatalogo,
optcatalogo.first_page.size.width
) + 'px',
}"
>
<div
class="first_page"
v-html="optcatalogo.first_page_html"
v-html="optcatalogo.first_page.text_html.contenuto"
></div>
\ </div>
\
</div>
<div :style="generateStyleCatalogo(optcatalogo)">
<div class="flex-container-book">
<q-infinite-scroll
@@ -241,11 +247,10 @@
@load="onLoadScroll"
:offset="2000"
debounce="200"
class="q-pa-xs row items-start"
class="row items-start"
style="place-content: center"
>
<div
class="q-pa-xs"
v-for="(product, index) in arrLoaded"
:key="index"
>
@@ -294,11 +299,19 @@
<div v-if="recscheda && recscheda.scheda">
<!-- Itera sulle pagine -->
<div
v-for="(page, pageIndex) in groupedPages(
recscheda.scheda
)"
v-for="(page, pageIndex) in groupedPages(recscheda)"
:key="pageIndex"
:class="{ 'fixed-width': getWidthPagina(optcatalogo, recscheda.scheda), 'fixed-height': getHeightPagina(optcatalogo, recscheda.scheda), 'card-page': true }"
:class="{
'fixed-width': getWidthPagina(
optcatalogo,
recscheda.scheda
),
'fixed-height': getHeightPagina(
optcatalogo,
recscheda.scheda
),
'card-page': true,
}"
:style="
generateStylePageScheda(
optcatalogo,
@@ -310,116 +323,134 @@
<div
v-for="(row, rowIndex) in page"
:key="`${pageIndex}-${rowIndex}`"
class="card-row"
:style="
'margin-bottom: ' +
(scheda?.dimensioni?.riga?.bottom ?? '0px') +
';'
"
class="column"
>
<!-- Itera sui prodotti di ogni riga -->
<div
v-for="(indprod, colIndex) in row"
:key="`${pageIndex}-${rowIndex}-${colIndex}`"
class="flex-item-book image-container"
class="card-row"
:style="getStyleRow(recscheda)"
>
<!--pag: {{pageIndex}} - riga: {{rowIndex}} - col: {{colIndex}} - -->
<CContainerCatalogoCard
v-if="
getProdBySchedaRigaCol(
recscheda,
pageIndex,
rowIndex,
colIndex
) &&
getProdBySchedaRigaCol(
recscheda,
pageIndex,
rowIndex,
colIndex
).active
"
:id="
getProdBySchedaRigaCol(
recscheda,
pageIndex,
rowIndex,
colIndex
)._id
"
:complete="false"
:cosa="cosa"
:optcatalogo="optcatalogo"
:scheda="recscheda.scheda"
:options="{
show_short_descr: false,
show_price: false,
show_cat: false,
quante_col: 'c2',
in_3d: false,
}"
@selauthor="selauthor"
/>
<CProductCard
v-else-if="
getProdBySchedaRigaCol(
recscheda,
pageIndex,
rowIndex,
colIndex
) &&
(getProdBySchedaRigaCol(
recscheda,
pageIndex,
rowIndex,
colIndex
).active ||
show_hide)
"
:id="
getProdBySchedaRigaCol(
recscheda,
pageIndex,
rowIndex,
colIndex
)._id
"
:complete="false"
:cosa="cosa"
/>
<!-- Itera sui prodotti di ogni riga -->
<div class="row justify-center">
<div
v-for="(indprod, colIndex) in row"
:key="`${pageIndex}-${rowIndex}-${colIndex}`"
class="flex-item-book"
:style="getStyleSchedaProdotto(recscheda)"
>
<CContainerCatalogoCard
v-if="
getProdBySchedaRigaCol(
recscheda,
pageIndex,
rowIndex,
colIndex
) &&
getProdBySchedaRigaCol(
recscheda,
pageIndex,
rowIndex,
colIndex
).active
"
:id="
getProdBySchedaRigaCol(
recscheda,
pageIndex,
rowIndex,
colIndex
)._id
"
:complete="false"
:cosa="cosa"
:optcatalogo="optcatalogo"
:scheda="recscheda.scheda"
:options="{
show_short_descr: false,
show_price: false,
show_cat: false,
quante_col: 'c2',
in_3d: false,
}"
@selauthor="selauthor"
/>
<CProductCard
v-else-if="
getProdBySchedaRigaCol(
recscheda,
pageIndex,
rowIndex,
colIndex
) &&
(getProdBySchedaRigaCol(
recscheda,
pageIndex,
rowIndex,
colIndex
).active ||
show_hide)
"
:id="
getProdBySchedaRigaCol(
recscheda,
pageIndex,
rowIndex,
colIndex
)._id
"
:complete="false"
:cosa="cosa"
/>
</div>
<!-- Prodotti singoli -->
</div>
<!-- Separatore -->
<div
v-if="recscheda.scheda?.show_separatore && rowIndex !== page.length - 1"
class="text-center"
:style="getStyleRow(recscheda)"
>
<q-separator inset :size="tools.adjustSize(optcatalogo, '1px')"></q-separator>
</div>
</div>
<!-- Card Row -->
</div>
<!-- Righe (row) -->
</div>
<!-- Pagine -->
</div>
</div>
</div>
</div>
</div>
<div
v-if="optcatalogo.last_page_img"
v-if="
optcatalogo.last_page &&
optcatalogo.last_page.text_html.contenuto
"
:style="{
backgroundImage: `url(${
costanti.DIR_UPLOAD +
costanti.DIR_CATALOGO +
(optcatalogo.printable
? optcatalogo.last_page_img
: optcatalogo.last_page_img)
optcatalogo.last_page.imgsfondo.imagefile
})`,
backgroundSize: `${
optcatalogo.printable
? scheda.bgSize_printable
: scheda.bgSize
}`,
height: optcatalogo.last_page_height + 'px',
width: optcatalogo.last_page_width + 'px',
backgroundSize: `${optcatalogo.last_page.imgsfondo.fit}`,
backgroundRepeat: 'no-repeat',
height:
tools.adjustSize(
optcatalogo,
optcatalogo.last_page.size.height
) + 'px',
width:
tools.adjustSize(
optcatalogo,
optcatalogo.last_page.size.width
) + 'px',
}"
>
<div
class="last_page"
v-html="optcatalogo.last_page_html"
></div>
<div v-html="optcatalogo.last_page.text_html.contenuto"></div>
</div>
</div>
</div>
@@ -427,35 +458,35 @@
</div>
</q-tab-panel>
<q-tab-panel name="sfondo">
<div class="row q-gutter-xs justify-center q-mx-auto bg-blue-1">
<div class="row justify-center q-mx-auto bg-blue-1">
<div>
Sfondo:
{{
costanti.DIR_UPLOAD +
costanti.DIR_CATALOGO +
optcatalogo.imgsfondo_def?.imagefile
optcatalogo.dimensioni_def?.pagina.imgsfondo?.imagefile
}}
</div>
<q-img
v-if="optcatalogo.imgsfondo_def?.imagefile"
v-if="optcatalogo.dimensioni_def?.pagina.imgsfondo?.imagefile"
:src="
costanti.DIR_UPLOAD +
costanti.DIR_CATALOGO +
optcatalogo.imgsfondo_def?.imagefile
optcatalogo.dimensioni_def?.pagina.imgsfondo?.imagefile
"
>
</q-img>
</div>
</q-tab-panel>
<q-tab-panel name="pagine">
<div class="row q-gutter-xs justify-center q-mx-auto bg-blue-1">
<div class="row justify-center q-mx-auto bg-blue-1">
<div>
Prima Pagina:
{{
costanti.DIR_UPLOAD +
costanti.DIR_CATALOGO +
optcatalogo.first_page_img
optcatalogo.first_page.imgsfondo.imagefile
}}
</div>
@@ -463,7 +494,7 @@
:src="
costanti.DIR_UPLOAD +
costanti.DIR_CATALOGO +
optcatalogo.first_page_img
optcatalogo.first_page.imgsfondo.imagefile
"
>
</q-img>
@@ -472,7 +503,7 @@
{{
costanti.DIR_UPLOAD +
costanti.DIR_CATALOGO +
optcatalogo.last_page_img
optcatalogo.last_page.imgsfondo.imagefile
}}
</div>
@@ -480,7 +511,7 @@
:src="
costanti.DIR_UPLOAD +
costanti.DIR_CATALOGO +
optcatalogo.last_page_img
optcatalogo.last_page.imgsfondo.imagefile
"
>
</q-img>
@@ -498,6 +529,6 @@
<script lang="ts" src="./catalogo.ts">
</script>
<style lang="scss" scoped>
<style lang="scss">
@import './catalogo.scss';
</style>