- prima bozza catalogo

This commit is contained in:
Surya Paolo
2024-12-02 19:38:01 +01:00
parent 6932590f3e
commit 1cb5e6f1ad
9 changed files with 207 additions and 149 deletions

View File

@@ -512,7 +512,8 @@ export default defineComponent({
}
function click_opendetail(id: any, autore: any) {
emit('opendetail')
if (!props.optcatalogo.pdf)
emit('opendetail')
}
function escludiArticolo(variazione: IVariazione) {
let hasExcludeProductTypes = !props.optcatalogo.excludeproductTypes || (props.optcatalogo.excludeproductTypes && (props.optcatalogo.excludeproductTypes.includes(variazione.versione!)))

View File

@@ -104,51 +104,69 @@
),
}"
>
<q-img
v-if="myproduct.productInfo"
:src="
myproduct.productInfo.imagefile
? tools.getFullFileNameByImageFile(
'productInfos',
myproduct.productInfo.imagefile
)
: myproduct.productInfo.image_link
"
:alt="myproduct.productInfo.name"
:fit="scheda.dimensioni?.immagine_prodotto?.size?.fit ?? 'cover'"
:class="{
'book-image-fixed': complete,
'cursor-pointer': !complete,
'shadow-4': true,
'image-wrapper': optcatalogo.pdf,
}"
:style="{
zIndex: 2,
width:
scheda.testo_right.font?.posiz_text ===
costanti.POSIZ_TESTO.IN_BASSO
? scheda.testo_right.font?.perc_text ?? '50%'
: '45%',
...(tools.adjustSize(
optcatalogo,
scheda.dimensioni?.immagine_prodotto?.size?.width
) && {
<a :href="myproduct.productInfo.link_macro" target="_blank">
<q-img
v-if="myproduct.productInfo"
:src="
myproduct.productInfo.imagefile
? tools.getFullFileNameByImageFile(
'productInfos',
myproduct.productInfo.imagefile
)
: myproduct.productInfo.image_link
"
:alt="myproduct.productInfo.name"
:fit="scheda.dimensioni?.immagine_prodotto?.size?.fit ?? 'cover'"
:class="{
'book-image-fixed': complete,
'cursor-pointer': !complete,
'shadow-4': true,
'image-wrapper': optcatalogo.pdf,
}"
:style="{
zIndex: 2,
width:
tools.adjustSize(
optcatalogo,
scheda.dimensioni?.immagine_prodotto.size?.width
) + ' !important',
}),
height: scheda.dimensioni?.immagine_prodotto?.size?.height
? tools.adjustSize(
optcatalogo,
scheda.dimensioni?.immagine_prodotto?.size?.height
)
: undefined,
display: 'block',
}"
@click="click_opendetail()"
/>
scheda.testo_right.font?.posiz_text ===
costanti.POSIZ_TESTO.IN_BASSO
? scheda.testo_right.font?.perc_text ?? '50%'
: '45%',
...(tools.adjustSize(
optcatalogo,
scheda.dimensioni?.immagine_prodotto?.size?.width
) && {
width:
tools.adjustSize(
optcatalogo,
scheda.dimensioni?.immagine_prodotto.size?.width
) + ' !important',
}),
height: scheda.dimensioni?.immagine_prodotto?.size?.height
? tools.adjustSize(
optcatalogo,
scheda.dimensioni?.immagine_prodotto?.size?.height
)
: undefined,
display: 'block',
}"
@click="click_opendetail()"
/>
</a>
<span v-if="false && !optcatalogo.generazionePDFInCorso && editOn" class="prod_disp">
<CMyValueDb
v-if="editOn"
:editOn="editOn"
:title="t('products.stockQty')"
table="products"
:id="myproduct._id"
:rec="myproduct"
mykey="stockQty"
debounce="1000"
:save="updateproductmodif()"
:type="costanti.FieldType.number"
>
</CMyValueDb>
</span>
<!-- Testo associato all'immagine -->
<div
:style="{
@@ -209,21 +227,29 @@
>
</CBarCode>
</div>
<div v-if="scheda.etichette?.bestseller?.show && isProductBestseller()">
<div
v-if="
scheda.etichette?.bestseller?.show && isProductBestseller()
"
>
<q-img
src="images/bestseller.png"
alt="Bestseller"
width="40px"
height="40px"
:width="(40 * optcatalogo.areadistampa.scale) + 'px'"
:height="(40 * optcatalogo.areadistampa.scale) + 'px'"
fit="contain"
></q-img>
</div>
<div v-else-if="scheda.etichette?.novita?.show && isProductNovita()">
<div
v-else-if="
scheda.etichette?.novita?.show && isProductNovita()
"
>
<q-img
src="images/novita.png"
alt="Novita"
width="40px"
height="40px"
:width="(40 * optcatalogo.areadistampa.scale) + 'px'"
:height="(40 * optcatalogo.areadistampa.scale) + 'px'"
fit="contain"
></q-img>
</div>

View File

@@ -56,7 +56,7 @@
<div>
Parole Chiave: {autore} {titolo} {descrizione} {date_pub} {ranking}
{descrizione_breve_macro} {descrizione_completa_macro} {sottotitolo} {prezzo}
{sottotitolo} {prezzo} {descrizione_estesa}
</div>
<q-select

View File

@@ -819,6 +819,7 @@ export interface ICatalogo {
pdf?: boolean
pdf_filename?: string
printable?: boolean
generazionePDFInCorso?: boolean
first_page?: IDimensioni
last_page?: IDimensioni

View File

@@ -5,6 +5,7 @@ export interface IProductInfo {
_id?: any
code?: string
id_wp?: string
sku?: string
name?: string
description?: string
department?: string

View File

@@ -1310,13 +1310,16 @@ export const useProducts = defineStore('Products', {
const formato = myproduct.arrvariazioni ? myproduct.arrvariazioni[0].formato : ''
const pagine = myproduct.arrvariazioni ? myproduct.arrvariazioni[0].pagine : ''
const scale = optcatalogo.printable ? optcatalogo.areadistampa?.scale : 1
// Crea una mappa di sostituzioni
const replacements = {
'{autore}': autori || '',
'{titolo}': myproduct.productInfo.name || '',
'{descrizione}': truncatedDescription || '',
'{descrizione_estesa}': truncatedlongDescription || '',
'{sottotitolo}': sottotitolo || '',
'{descrizione_da_fdv}': truncatedDescription || '',
'{descrizione_estesa_fdv}': truncatedlongDescription || '',
'{descrizione_estesa}': descrizione_completa_macro || '',
'{pagine}': pagine || '',
'{misure}': misure || '',
'{date_pub}': date_pub || '',
@@ -1330,7 +1333,6 @@ export const useProducts = defineStore('Products', {
'{descrizione_completa_macro}': descrizione_completa_macro || '',
'{descrizione_breve_macro}': descrizione_breve_macro || '',
'{link_macro}': link_macro || '',
'{sottotitolo}': sottotitolo || '',
};
// Esegue le sostituzioni

View File

@@ -75,19 +75,25 @@ body {
text-transform: uppercase;
margin-top: calc(5 * var(--scalecatalog) * 1px);
margin-bottom: calc(5 * var(--scalecatalog) * 1px);
font-size: calc(18 * var(--scalecatalog) * 1px);
}
.book-author {
font-family: 'DIN-Pro-Condensed-Regular', sans-serif;
font-size: calc(16 * var(--scalecatalog) * 1px);
}
.book-descr {
font-family: 'DINPro-BoldItalic', sans-serif;
font-size: calc(12 * var(--scalecatalog) * 1px);
}
.book-details {
font-family: 'DINPro', sans-serif;
margin-bottom: calc(5 * var(--scalecatalog) * 1px);
font-size: calc(12 * var(--scalecatalog) * 1px);
text-align: left !important;
margin-left: calc(8 * var(--scalecatalog) * 1px);
}
@@ -96,6 +102,11 @@ body {
font-size: calc(14 * var(--scalecatalog) * 1px);
}
.book-link{
font-style: italic;
font-size: calc(14 * var(--scalecatalog) * 1px);
}
.book-novita {
font-size: calc(20 * var(--scalecatalog) * 1px);
}

View File

@@ -411,7 +411,7 @@ export default defineComponent({
}
function getProductsSorted(arrprod: IProduct[], sort: number) {
console.log('getProductsSorted', sort)
// console.log('getProductsSorted', sort)
if (sort === costanti.SORT_PUBDATE) {
arrprod = arrprod.sort((a: IProduct, b: IProduct) => {
@@ -546,7 +546,7 @@ export default defineComponent({
recscheda.arrProdToShow[pagina][riga] = [];
}
console.log('RANKING: ', result.myrec.indiceRanking!)
// console.log('RANKING: ', result.myrec.indiceRanking!)
recscheda.arrProdToShow[pagina][riga][col] = result.myrec
@@ -726,12 +726,15 @@ export default defineComponent({
}
const generatePDF = async () => {
//props.optcatalogo.generazionePDFInCorso = true
await nextTick()
$q.loading.show({
message: 'Caricamento immagini e generazione PDF in corso...'
})
try {
let defaultMargin = 0.1
@@ -795,6 +798,8 @@ export default defineComponent({
await html2pdf().set(opt).from(element).save()
// props.optcatalogo.generazionePDFInCorso = false
$q.loading.hide()
$q.notify({
color: 'positive',
@@ -987,6 +992,10 @@ export default defineComponent({
};
}
function containsProducts(page: IProduct[][]) {
return page && page.length > 0 && page[0] && page[0].length > 0
}
onMounted(mounted)
@@ -1037,6 +1046,7 @@ export default defineComponent({
getHeightPagina,
getStyleRowSeparator,
generateStyleByPageDim,
containsProducts,
}
}
})

View File

@@ -282,114 +282,120 @@
<div
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,
}"
:style="
generateStylePageScheda(
optcatalogo,
recscheda.scheda
)
"
>
<div
v-if="
recscheda.scheda.dimensioni.pagina?.testo_up
?.contenuto
"
:style="{
'--scalecatalog':
optcatalogo.areadistampa.scale,
'line-height':
recscheda.scheda.dimensioni.pagina?.testo_up
?.font.line_height,
display: 'flex',
flexDirection: 'column',
v-if="containsProducts(page)"
:class="{
'fixed-width': getWidthPagina(
optcatalogo,
recscheda.scheda
),
'fixed-height': getHeightPagina(
optcatalogo,
recscheda.scheda
),
'card-page': true,
}"
:style="
generateStylePageScheda(
optcatalogo,
recscheda.scheda
)
"
>
<div
v-html="
v-if="
recscheda.scheda.dimensioni.pagina?.testo_up
?.contenuto
"
style="display: flex; flex-direction: row"
></div>
</div>
<!-- Itera sulle righe di ogni pagina -->
<div
v-for="(row, rowIndex) in page"
:key="`${pageIndex}-${rowIndex}`"
class="column"
>
<div
class="card-row"
:style="getStyleRow(recscheda)"
:style="{
'--scalecatalog':
optcatalogo.areadistampa.scale,
'line-height':
recscheda.scheda.dimensioni.pagina?.testo_up
?.font.line_height,
display: 'flex',
flexDirection: 'column',
}"
>
<!-- Itera sui prodotti di ogni riga -->
<div class="row justify-center">
<div
v-for="(prod, colIndex) in row"
:key="`${pageIndex}-${rowIndex}-${colIndex}`"
class="flex-item-book"
:style="getStyleSchedaProdotto(recscheda)"
>
<CContainerCatalogoCard
v-if="prod && prod.active"
:id="prod._id"
:product="prod"
: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="
prod && (prod.active || show_hide)
"
:id="prod._id"
:complete="false"
:cosa="cosa"
/>
</div>
<!-- Prodotti singoli -->
</div>
<!-- Separatore -->
<div
v-if="
recscheda.scheda?.show_separatore &&
rowIndex !== page.length - 1
v-html="
recscheda.scheda.dimensioni.pagina?.testo_up
?.contenuto
"
class="text-center"
style="display: flex; flex-direction: row"
></div>
</div>
<!-- Itera sulle righe di ogni pagina -->
<div
v-for="(row, rowIndex) in page"
:key="`${pageIndex}-${rowIndex}`"
class="column"
>
<div
class="card-row"
:style="getStyleRow(recscheda)"
>
<q-separator
inset
:size="tools.adjustSize(optcatalogo, '1px')"
></q-separator>
<!-- Itera sui prodotti di ogni riga -->
<div class="row justify-center">
<div
v-for="(prod, colIndex) in row"
:key="`${pageIndex}-${rowIndex}-${colIndex}`"
class="flex-item-book"
:style="getStyleSchedaProdotto(recscheda)"
>
<CContainerCatalogoCard
v-if="prod && prod.active"
:id="prod._id"
:product="prod"
: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="
prod && (prod.active || show_hide)
"
:id="prod._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>
<!-- Card Row -->
<!-- Righe (row) -->
</div>
<!-- Righe (row) -->
</div>
<!-- Pagine -->
</div>