- Cataloghi: BestSeller, Novità

This commit is contained in:
Surya Paolo
2024-11-28 16:04:48 +01:00
parent e10ff192bf
commit 6932590f3e
30 changed files with 1086 additions and 456 deletions

View File

@@ -33,9 +33,11 @@ else
rm -R ./public/upload/products/* rm -R ./public/upload/products/*
rm -R ./public/upload/pages/* rm -R ./public/upload/pages/*
rm -R ./public/upload/catalogo/* rm -R ./public/upload/catalogo/*
rm -R ./public/upload/scheda/*
cp -R _ALL_SITES/$site/upload/products/* ./public/upload/products/ cp -R _ALL_SITES/$site/upload/products/* ./public/upload/products/
cp -R _ALL_SITES/$site/upload/pages/* ./public/upload/pages/ cp -R _ALL_SITES/$site/upload/pages/* ./public/upload/pages/
cp -R _ALL_SITES/$site/upload/catalogo/* ./public/upload/catalogo/ cp -R _ALL_SITES/$site/upload/catalogo/* ./public/upload/catalogo/
cp -R _ALL_SITES/$site/upload/scheda/* ./public/upload/scheda/
rm -R ./public/images/* rm -R ./public/images/*
cp -R _ALL_SITES/$site/images/* ./public/images/ cp -R _ALL_SITES/$site/images/* ./public/images/

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
public/images/novita.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -379,6 +379,8 @@ export const shared_consts = {
PRODUCTS_V2: 22, PRODUCTS_V2: 22,
INVENTARIO: 30, INVENTARIO: 30,
MACRO_CATALOGO_JSON: 40, MACRO_CATALOGO_JSON: 40,
MACRO_RANKING: 50,
MACRO_DESCRELINKSITOWEB: 60,
}, },
BotType: [ BotType: [
@@ -2229,6 +2231,25 @@ export const shared_consts = {
PRODUCT: 1000, PRODUCT: 1000,
}, },
ORDINAMENTO_CATALOGHI: [
{
label: '[Default]',
value: 0,
},
{
label: 'Data di Uscita',
value: 1,
},
{
label: 'Bestseller',
value: 2,
},
{
label: 'Alfabetico',
value: 0,
},
],
VERSIONI_PRODOTTO: [ VERSIONI_PRODOTTO: [
{ {
label: '[Nessuno]', label: '[Nessuno]',

View File

@@ -160,7 +160,7 @@ export default defineComponent({
if (myproduct.value) { if (myproduct.value) {
const ris = await products.addtoCartBase({ $q, t, id: myproduct.value._id, order: myorder, addqty: add }) const ris = await products.addtoCartBase({ $q, t, id: myproduct.value._id, order: myorder, addqty: add })
updateproduct() updateproduct(false)
if (ris && ris.myord) { if (ris && ris.myord) {
} }
@@ -217,10 +217,22 @@ export default defineComponent({
} }
async function updateproduct() { async function updateproduct(atload: boolean) {
myproduct.value = null; let carica = true
myproduct.value = await products.getProductById(props.id)
if (atload) {
if (props.product) {
myproduct.value = props.product
carica = false
}
} else {
}
if (carica) {
myproduct.value = null;
myproduct.value = await products.getProductById(props.id)
}
// products.updateQuantityAvailable(myproduct.value._id) // products.updateQuantityAvailable(myproduct.value._id)
} }
@@ -360,7 +372,7 @@ export default defineComponent({
async function load() { async function load() {
indvariazSel.value = -1 indvariazSel.value = -1
initproduct() initproduct()
await updateproduct() await updateproduct(true)
labelDataArrivoMerce.value = '' labelDataArrivoMerce.value = ''
labelDataRitiro.value = '' labelDataRitiro.value = ''
@@ -512,6 +524,31 @@ export default defineComponent({
return !escludiArticolo(variazione) return !escludiArticolo(variazione)
} }
function isProductNovita() {
const monthsAgo = props.scheda.etichette?.novita?.months ?? 6; // Numero di mesi da considerare "recenti"
const publishingDate = new Date(myproduct.value!.productInfo.date_publishing!);
// Calcola i millisecondi corrispondenti a X mesi fa
const monthsInMilliseconds = monthsAgo * 30 * 24 * 60 * 60 * 1000; // Approssimazione, non tutti i mesi hanno 30 giorni
// Crea una data che rappresenta X mesi fa
const monthsAgoDate = new Date(tools.getTimeNow() - monthsInMilliseconds);
// Confronta la data di pubblicazione con la data X mesi fa
return publishingDate > monthsAgoDate;
}
function isProductBestseller() {
try {
//return myproduct.value!.productInfo.rank1Y! > 0 && (myproduct.value!.productInfo.rank1Y! < props.scheda.etichette?.bestseller?.primiNInClassifica!)
return myproduct.value!.indiceRanking! > 0 && (myproduct.value!.indiceRanking! < props.scheda.etichette?.bestseller?.primiNInClassifica!)
} catch (e) {
return false
}
}
onMounted(mounted) onMounted(mounted)
onBeforeUnmount(beforeDestroy) onBeforeUnmount(beforeDestroy)
@@ -568,6 +605,8 @@ export default defineComponent({
click_author, click_author,
click_opendetail, click_opendetail,
checkIfVariazioneDaVisu, checkIfVariazioneDaVisu,
isProductNovita,
isProductBestseller,
} }
} }
}) })

View File

@@ -76,13 +76,15 @@
'flex', // Classi comuni 'flex', // Classi comuni
'image-container', 'image-container',
{ 'shadow-2': options.in_3d }, // Classe condizionale { 'shadow-2': options.in_3d }, // Classe condizionale
scheda.posiz_text === costanti.POSIZ_TESTO.IN_BASSO scheda.testo_right.font?.posiz_text ===
costanti.POSIZ_TESTO.IN_BASSO
? 'flex-col' ? 'flex-col'
: 'flex-row', // Layout flessibile : 'flex-row', // Layout flessibile
]" ]"
:style="{ :style="{
justifyContent: justifyContent:
scheda.posiz_text === costanti.POSIZ_TESTO.IN_BASSO scheda.testo_right.font?.posiz_text ===
costanti.POSIZ_TESTO.IN_BASSO
? 'center' ? 'center'
: 'flex-start', : 'flex-start',
alignItems: 'stretch', // Cambiato in 'stretch' per occupare l'altezza alignItems: 'stretch', // Cambiato in 'stretch' per occupare l'altezza
@@ -113,6 +115,7 @@
: myproduct.productInfo.image_link : myproduct.productInfo.image_link
" "
:alt="myproduct.productInfo.name" :alt="myproduct.productInfo.name"
:fit="scheda.dimensioni?.immagine_prodotto?.size?.fit ?? 'cover'"
:class="{ :class="{
'book-image-fixed': complete, 'book-image-fixed': complete,
'cursor-pointer': !complete, 'cursor-pointer': !complete,
@@ -120,10 +123,11 @@
'image-wrapper': optcatalogo.pdf, 'image-wrapper': optcatalogo.pdf,
}" }"
:style="{ :style="{
zIndex: 9000, zIndex: 2,
width: width:
scheda.posiz_text === costanti.POSIZ_TESTO.IN_BASSO scheda.testo_right.font?.posiz_text ===
? '50%' costanti.POSIZ_TESTO.IN_BASSO
? scheda.testo_right.font?.perc_text ?? '50%'
: '45%', : '45%',
...(tools.adjustSize( ...(tools.adjustSize(
optcatalogo, optcatalogo,
@@ -135,6 +139,12 @@
scheda.dimensioni?.immagine_prodotto.size?.width scheda.dimensioni?.immagine_prodotto.size?.width
) + ' !important', ) + ' !important',
}), }),
height: scheda.dimensioni?.immagine_prodotto?.size?.height
? tools.adjustSize(
optcatalogo,
scheda.dimensioni?.immagine_prodotto?.size?.height
)
: undefined,
display: 'block', display: 'block',
}" }"
@click="click_opendetail()" @click="click_opendetail()"
@@ -143,12 +153,14 @@
<div <div
:style="{ :style="{
width: width:
scheda.posiz_text === costanti.POSIZ_TESTO.IN_BASSO scheda.testo_right.font?.posiz_text ===
costanti.POSIZ_TESTO.IN_BASSO
? '100%' ? '100%'
: '50%', : scheda.testo_right.font?.perc_text ?? '50%',
textAlign: 'center', textAlign: 'center',
marginTop: marginTop:
scheda.posiz_text === costanti.POSIZ_TESTO.IN_BASSO scheda.testo_right.font?.posiz_text ===
costanti.POSIZ_TESTO.IN_BASSO
? '0.5rem' ? '0.5rem'
: '0', : '0',
}" }"
@@ -157,7 +169,7 @@
v-if="scheda.testo_right && scheda.testo_right" v-if="scheda.testo_right && scheda.testo_right"
:style="{ :style="{
'--scalecatalog': optcatalogo.areadistampa.scale, '--scalecatalog': optcatalogo.areadistampa.scale,
'line-height': scheda.line_height, 'line-height': scheda.testo_right.font?.line_height,
height: '100%', height: '100%',
display: 'flex', display: 'flex',
flexDirection: 'column', flexDirection: 'column',
@@ -171,22 +183,50 @@
scheda.testo_right scheda.testo_right
) )
" "
style="display: flex; flex-direction: column; justify-content: space-between; height: 100%;" style="
display: flex;
flex-direction: column;
justify-content: space-between;
height: 100%;
"
></div> ></div>
<div v-if="scheda.barcode && scheda.barcode.show"> <div class="row justify-center">
<CBarCode <div v-if="scheda.barcode && scheda.barcode.show">
:value="myproduct.productInfo.code" <CBarCode
:format="scheda.barcode.format" :value="myproduct.productInfo.code"
:fontsize="scheda.barcode.font?.size" :format="scheda.barcode.format"
:width=" :fontsize="scheda.barcode.font?.size"
parseInt( :width="
tools.adjustSize(optcatalogo, scheda.barcode.size?.width) parseInt(
) tools.adjustSize(
" optcatalogo,
:widthlines="scheda.barcode.widthlines" scheda.barcode.size?.width
:height="scheda.barcode.size?.height" )
> )
</CBarCode> "
:widthlines="scheda.barcode.widthlines"
:height="scheda.barcode.size?.height"
>
</CBarCode>
</div>
<div v-if="scheda.etichette?.bestseller?.show && isProductBestseller()">
<q-img
src="images/bestseller.png"
alt="Bestseller"
width="40px"
height="40px"
fit="contain"
></q-img>
</div>
<div v-else-if="scheda.etichette?.novita?.show && isProductNovita()">
<q-img
src="images/novita.png"
alt="Novita"
width="40px"
height="40px"
fit="contain"
></q-img>
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -200,28 +240,7 @@
<div <div
:style="{ :style="{
'--scalecatalog': optcatalogo.areadistampa.scale, '--scalecatalog': optcatalogo.areadistampa.scale,
'line-height': scheda.line_height, 'line-height': scheda.testo_bottom.font?.line_height,
}"
v-html="
products.replaceKeyWordsByProduct(
optcatalogo,
myproduct,
scheda.testo_bottom
)
"
></div>
</div>
<div
v-if="scheda.testo_bottom && scheda.testo_bottom.contenuto"
:style="{
width: '100%',
textAlign: 'center',
}"
>
<div
:style="{
'--scalecatalog': optcatalogo.areadistampa.scale,
'line-height': scheda.line_height,
}" }"
v-html=" v-html="
products.replaceKeyWordsByProduct( products.replaceKeyWordsByProduct(

View File

@@ -15,7 +15,7 @@ import { shared_consts } from '@src/common/shared_vuejs'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { costanti } from '@costanti' import { costanti } from '@costanti'
import { ICatalogo, IMyScheda } from '@src/model' import { ICatalogo, IMyScheda, IProduct } from '@src/model'
export default defineComponent({ export default defineComponent({
@@ -27,6 +27,11 @@ export default defineComponent({
required: false, required: false,
default: '', default: '',
}, },
product: {
type: Object as PropType<IProduct | null>,
required: false,
default: null,
},
cosa: { cosa: {
type: Number, type: Number,
required: false, required: false,

View File

@@ -1,6 +1,7 @@
<template> <template>
<CCatalogoCard <CCatalogoCard
:id="id" :id="id"
:product="product"
:complete="complete" :complete="complete"
:cosa="cosa" :cosa="cosa"
:options="options" :options="options"
@@ -21,6 +22,7 @@
<div class="row justify-center"> <div class="row justify-center">
<CCatalogoCard <CCatalogoCard
:id="id" :id="id"
:product="product"
:complete="true" :complete="true"
:cosa="cosa" :cosa="cosa"
:options="{ :options="{

View File

@@ -16,7 +16,7 @@ import { shared_consts } from '@/common/shared_vuejs'
export default defineComponent({ export default defineComponent({
name: 'CMyDimensioni', name: 'CMyDimensioni',
emits: ['update:modelValue'], emits: ['update:modelValue', 'modifElem'],
components: { CMySize, CBorders, CMyFieldRec }, components: { CMySize, CBorders, CMyFieldRec },
props: { props: {
modelValue: { modelValue: {
@@ -59,6 +59,10 @@ export default defineComponent({
function modifSize(value: any) { function modifSize(value: any) {
emit('update:modelValue', { ...internalModel, size: value }); emit('update:modelValue', { ...internalModel, size: value });
} }
function modifElem() {
emit('update:modelValue', { ...internalModel });
emit('modifElem', null);
}
function modifMargini(value: any) { function modifMargini(value: any) {
emit('update:modelValue', { ...internalModel, margini: value }); emit('update:modelValue', { ...internalModel, margini: value });
} }
@@ -90,6 +94,7 @@ export default defineComponent({
modifMargini, modifMargini,
modifPadding, modifPadding,
saveFielDim, saveFielDim,
modifElem,
costanti, costanti,
} }
} }

View File

@@ -12,17 +12,17 @@
<div v-if="internalModel" class="sfondo_margine row"> <div v-if="internalModel" class="sfondo_margine row">
<CMySize <CMySize
label="Pagina:" label="Dinemsioni:"
v-model="internalModel.size" v-model="internalModel.size"
@update:model-value="modifSize" @update:model-value="modifSize"
></CMySize> ></CMySize>
<CBorders <CBorders
label="Margini Pagina:" label="Margini:"
v-model="internalModel.margini" v-model="internalModel.margini"
@update:model-value="modifMargini" @update:model-value="modifMargini"
></CBorders> ></CBorders>
<CBorders <CBorders
label="Padding Pagina:" label="Padding:"
v-model="internalModel.padding" v-model="internalModel.padding"
@update:model-value="modifPadding" @update:model-value="modifPadding"
></CBorders> ></CBorders>

View File

@@ -26,6 +26,7 @@ import { CSelectFontSize } from '@src/components/CSelectFontSize'
import { CMySize } from '@src/components/CMySize' import { CMySize } from '@src/components/CMySize'
import { CBorders } from '@src/components/CBorders' import { CBorders } from '@src/components/CBorders'
import { CMyDimensioni } from '@src/components/CMyDimensioni' import { CMyDimensioni } from '@src/components/CMyDimensioni'
import { CMyText } from '@src/components/CMyText'
import MixinMetaTags from '@/mixins/mixin-metatags' import MixinMetaTags from '@/mixins/mixin-metatags'
import MixinBase from '@/mixins/mixin-base' import MixinBase from '@/mixins/mixin-base'
@@ -42,7 +43,7 @@ export default defineComponent({
CImgTitle, CTitle, LandingFooter, CEventsCalendar, CImgTitle, CTitle, LandingFooter, CEventsCalendar,
CCardCarousel, COpenStreetMap, CMyPage, CMyPageIntro, CMyEditor, CMyFieldRec, CCardCarousel, COpenStreetMap, CMyPage, CMyPageIntro, CMyEditor, CMyFieldRec,
CSelectColor, CSelectFontSize, CSelectImage, CImgPoster, CSelectAnimation, CMySlider, CSelectColor, CSelectFontSize, CSelectImage, CImgPoster, CSelectAnimation, CMySlider,
CMySize, CBorders, CMyDimensioni, CMySize, CBorders, CMyDimensioni, CMyText,
}, },
emits: ['saveElem', 'selElemClick', 'toggleSize', 'deleteElem', 'dupPage'], emits: ['saveElem', 'selElemClick', 'toggleSize', 'deleteElem', 'dupPage'],
props: { props: {
@@ -81,28 +82,6 @@ export default defineComponent({
const $q = useQuasar() const $q = useQuasar()
const { t } = useI18n() const { t } = useI18n()
const posizTextOptions = ref([
{ label: 'In basso', value: costanti.POSIZ_TESTO.IN_BASSO },
{ label: 'A Destra', value: costanti.POSIZ_TESTO.A_DESTRA },
])
const formatOptions = ref([
{ label: 'auto', value: 'CODE128' },
{ label: 'EAN-13', value: 'EAN-13' },
{ label: 'UPC', value: 'upc' },
])
const fontSizeOptions = ref([
{ label: '9', value: '9' },
{ label: '10', value: '10' },
{ label: '11', value: '11' },
{ label: '12', value: '12' },
{ label: '13', value: '13' },
{ label: '14', value: '14' },
{ label: '15', value: '15' },
{ label: '16', value: '16' },
{ label: '18', value: '18' },
{ label: '20', value: '20' },
{ label: '22', value: '22' },
])
const animare = ref(0) const animare = ref(0)
const slide = ref(0) const slide = ref(0)
@@ -243,6 +222,7 @@ export default defineComponent({
function modifElem() { function modifElem() {
disableSave.value = false disableSave.value = false
elemChanged.value = true elemChanged.value = true
} }
function modifElemAndSchede() { function modifElemAndSchede() {
modifElem() modifElem()
@@ -276,33 +256,57 @@ export default defineComponent({
if (myel.value.catalogo && myel.value.catalogo?.arrSchede) { if (myel.value.catalogo && myel.value.catalogo?.arrSchede) {
for (const recscheda of myel.value.catalogo?.arrSchede) { for (const recscheda of myel.value.catalogo?.arrSchede) {
if (recscheda.scheda && (!recscheda.scheda?.testo_bottom)) { if (recscheda.scheda) {
recscheda.scheda.testo_bottom = { contenuto: '', maxlength: 100 } if ((!recscheda.scheda?.testo_bottom)) {
} recscheda.scheda.testo_bottom = { contenuto: '', maxlength: 100 }
if (recscheda.scheda && !recscheda.scheda.testo_bottom!.font) { }
recscheda.scheda.testo_bottom!.font = { name: '', size: ''} if (!recscheda.scheda.testo_bottom!.font) {
} recscheda.scheda.testo_bottom!.font = { name: '', size: '' }
if (recscheda.scheda && (!recscheda.scheda?.testo_right || !recscheda.scheda?.testo_right.font) ) { }
recscheda.scheda.testo_right = { contenuto: '', font: { name: '', size: ''} } if ((!recscheda.scheda?.testo_right || !recscheda.scheda?.testo_right.font)) {
} recscheda.scheda.testo_right = { contenuto: '', font: { name: '', size: '' } }
if (recscheda.scheda && (!recscheda.scheda?.dimensioni.pagina.imgsfondo)) { }
recscheda.scheda.dimensioni.pagina = tools.resetRecIDimensioni(recscheda.scheda?.dimensioni.pagina) if ((!recscheda.scheda?.dimensioni.pagina)) {
} recscheda.scheda.dimensioni.pagina = tools.resetRecIPagina(recscheda.scheda?.dimensioni.pagina)
if (recscheda.scheda && (!recscheda.scheda?.barcode || !recscheda.scheda?.barcode.font)) { }
recscheda.scheda.barcode = { if ((!recscheda.scheda?.dimensioni.pagina.dimensioni)) {
show: false, recscheda.scheda.dimensioni.pagina = tools.resetRecIPagina(recscheda.scheda?.dimensioni.pagina)
format: '', }
size: { if (!recscheda.scheda?.dimensioni?.pagina?.testo_up) {
width: '2', recscheda.scheda!.dimensioni.pagina.testo_up = tools.resetIText(null)
height: '33', }
}, if (!recscheda.scheda?.dimensioni?.pagina?.testo_down) {
font: { recscheda.scheda!.dimensioni.pagina.testo_down = tools.resetIText(null)
name: '', }
size: '11',
if (!recscheda.scheda?.etichette?.novita?.show) {
recscheda.scheda.etichette!.novita = {
show: false,
months: 6,
}
recscheda.scheda.etichette!.bestseller = {
show: false,
primiNInClassifica: 0,
} }
} }
}
if ((!recscheda.scheda?.barcode || !recscheda.scheda?.barcode.font)) {
recscheda.scheda.barcode = {
show: false,
format: '',
size: {
width: '2',
height: '33',
},
font: {
name: '',
size: '11',
}
}
}
}
} }
} }
@@ -322,7 +326,7 @@ export default defineComponent({
if (myel.value.catalogo) { if (myel.value.catalogo) {
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.areadistampa = tools.resetRecIAreaDiStampa(myel.value.catalogo.areadistampa) myel.value.catalogo.areadistampa = tools.resetRecIAreaDiStampa(myel.value.catalogo.areadistampa)
@@ -449,15 +453,19 @@ export default defineComponent({
show_separatore: true, show_separatore: true,
name: 'Scheda Nuova', name: 'Scheda Nuova',
dimensioni, dimensioni,
line_height: 100,
numschede_perRiga: 2, numschede_perRiga: 2,
numschede_perCol: 2, numschede_perCol: 2,
posiz_text: costanti.POSIZ_TESTO.A_DESTRA,
testo_right: { testo_right: {
contenuto: '', contenuto: '',
font: {
posiz_text: costanti.POSIZ_TESTO.A_DESTRA,
},
}, },
testo_bottom: { testo_bottom: {
contenuto: '', contenuto: '',
font: {
posiz_text: costanti.POSIZ_TESTO.IN_BASSO,
}
}, },
barcode: { barcode: {
show: false, show: false,
@@ -487,7 +495,7 @@ export default defineComponent({
_id: objectId(), _id: objectId(),
scheda: newscheda, scheda: newscheda,
order: maxorder + 10, order: maxorder + 10,
numSchede: 1, numPagineMax: 0,
} }
) )
// console.log('arrschede', myel.value.catalogo!.arrSchede) // console.log('arrschede', myel.value.catalogo!.arrSchede)
@@ -540,6 +548,7 @@ export default defineComponent({
} }
} }
function dupNewScheda(id: string) { function dupNewScheda(id: string) {
if (!myel.value.catalogo!.arrSchede) if (!myel.value.catalogo!.arrSchede)
return return
@@ -550,9 +559,9 @@ export default defineComponent({
let myscheda = tools.jsonCopy(myfindscheda) let myscheda = tools.jsonCopy(myfindscheda)
delete myscheda._id delete myscheda._id
delete myscheda.scheda!._id delete myscheda.scheda!._id
myscheda.numSchede = 1 myscheda.numPagineMax = 0
myscheda.order = myscheda.order + 10, myscheda.order = myscheda.order + 10,
myscheda._id = objectId() myscheda._id = objectId()
myscheda.scheda!._id = objectId() myscheda.scheda!._id = objectId()
myscheda.scheda!.name = myscheda.scheda!.name + '_copia' myscheda.scheda!.name = myscheda.scheda!.name + '_copia'
myscheda.scheda!.isTemplate = false myscheda.scheda!.isTemplate = false
@@ -759,6 +768,8 @@ export default defineComponent({
let arr: any = [] let arr: any = []
arr.push({ label: '[Nessuna]', value: '' })
if (arrschede) { if (arrschede) {
arrschede.forEach((recscheda: ISchedaSingola) => { arrschede.forEach((recscheda: ISchedaSingola) => {
arr.push({ label: recscheda.scheda!.name, value: recscheda.scheda!._id }) arr.push({ label: recscheda.scheda!.name, value: recscheda.scheda!._id })
@@ -933,15 +944,12 @@ export default defineComponent({
saveFieldElem, saveFieldElem,
updateCatalogoSizeWidth, updateCatalogoSizeWidth,
dupPage, dupPage,
posizTextOptions,
tabScheda, tabScheda,
addNewScheda, addNewScheda,
dupNewScheda, dupNewScheda,
delRecScheda, delRecScheda,
SchedeOpt, SchedeOpt,
addProdSpeciale, addProdSpeciale,
formatOptions,
fontSizeOptions,
idSchedaDaCopiare, idSchedaDaCopiare,
copyfromTemplate, copyfromTemplate,
modifElemAndSchede, modifElemAndSchede,

View File

@@ -1343,7 +1343,7 @@
label="Selezione Collane/Editori" label="Selezione Collane/Editori"
icon="fas fa-play-circle" icon="fas fa-play-circle"
> >
<div class="row"> <div class="column">
<q-toggle <q-toggle
v-model="myel.catalogo.pdf" v-model="myel.catalogo.pdf"
color="positive" color="positive"
@@ -1354,7 +1354,6 @@
</q-toggle> </q-toggle>
<q-input <q-input
dense
label="NomeFile PDF" label="NomeFile PDF"
@update:model-value="modifElem" @update:model-value="modifElem"
v-model="myel.catalogo.pdf_filename" v-model="myel.catalogo.pdf_filename"
@@ -1366,6 +1365,21 @@
<br /> <br />
<!--++AddCATALOGO_FIELDS--> <!--++AddCATALOGO_FIELDS-->
<q-select
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
v-if="enableEdit && myel.catalogo"
rounded
outlined
v-model="myel.catalogo.sort"
:options="shared_consts.ORDINAMENTO_CATALOGHI"
@update:model-value="modifElem"
label="Ordinamento"
style="width: 200px"
emit-value
map-options
>
</q-select>
<q-select <q-select
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'" :behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
v-if=" v-if="
@@ -1377,9 +1391,8 @@
:options="shared_consts.VERSIONI_PRODOTTO" :options="shared_consts.VERSIONI_PRODOTTO"
@update:model-value="modifElem" @update:model-value="modifElem"
multiple multiple
dense
label="Includi" label="Includi"
style="width: 150px" style="width: 300px"
emit-value emit-value
map-options map-options
> >
@@ -1398,9 +1411,8 @@
:options="shared_consts.VERSIONI_PRODOTTO" :options="shared_consts.VERSIONI_PRODOTTO"
@update:model-value="modifElem" @update:model-value="modifElem"
multiple multiple
dense
label="Escludi" label="Escludi"
style="width: 150px" style="width: 300px"
emit-value emit-value
map-options map-options
> >
@@ -1414,9 +1426,8 @@
:options="Products.publishers" :options="Products.publishers"
@update:model-value="modifElem" @update:model-value="modifElem"
multiple multiple
dense
label="Editori" label="Editori"
style="width: 150px" style="width: 300px"
emit-value emit-value
map-options map-options
option-value="_id" option-value="_id"
@@ -1439,6 +1450,7 @@
<CMyDimensioni <CMyDimensioni
v-model="myel.catalogo.dimensioni_def.pagina" v-model="myel.catalogo.dimensioni_def.pagina"
:path="costanti.DIR_CATALOGO" :path="costanti.DIR_CATALOGO"
@modifElem="modifElem"
:show_imgsfondo="true" :show_imgsfondo="true"
@update:model-value="modifElem" @update:model-value="modifElem"
></CMyDimensioni> ></CMyDimensioni>
@@ -1536,7 +1548,6 @@
> >
</q-toggle> </q-toggle>
<q-input <q-input
dense
label="Nome Template" label="Nome Template"
@update:model-value="modifElem" @update:model-value="modifElem"
v-model="recscheda.scheda.name" v-model="recscheda.scheda.name"
@@ -1553,30 +1564,47 @@
v-if="enableEdit" v-if="enableEdit"
rounded rounded
outlined outlined
v-model="idSchedaDaCopiare" v-model="recscheda.scheda.linkIdTemplate"
:options="SchedeOpt()" :options="SchedeOpt()"
@update:model-value="modifElem" @update:model-value="modifElem"
dense label="Scheda collegata:"
label="Scegli Scheda"
style="width: 150px" style="width: 150px"
emit-value emit-value
map-options map-options
> >
</q-select> </q-select>
<q-btn <br />
icon="far fa-copy" <div class="row">
label="Copia da Template" <q-select
dense :behavior="
:disable="!idSchedaDaCopiare" $q.platform.is.ios === true ? 'dialog' : 'menu'
color="primary" "
@click="copyfromTemplate(ind)" v-if="enableEdit"
> rounded
</q-btn> outlined
v-model="idSchedaDaCopiare"
:options="SchedeOpt()"
@update:model-value="modifElem"
label="Scegli Scheda"
style="width: 150px"
emit-value
map-options
>
</q-select>
<q-btn
icon="far fa-copy"
label="Copia da Template"
:disable="!idSchedaDaCopiare"
color="primary"
@click="copyfromTemplate(ind)"
>
</q-btn>
</div>
</div> </div>
<CMySlider <CMySlider
label="Schede da ripetere" label="Pagine max da visualizzare"
v-model="recscheda.numSchede" v-model="recscheda.numPagineMax"
:min="1" :min="1"
:max="100" :max="100"
color="green" color="green"
@@ -1588,9 +1616,26 @@
dense-toggle dense-toggle
expand-separator expand-separator
label="Filtri" label="Filtri"
:disabled="recscheda.scheda.linkIdTemplate"
icon="fas fa-play-circle" icon="fas fa-play-circle"
> >
<div class="row"> <div class="column">
<q-select
:behavior="
$q.platform.is.ios === true ? 'dialog' : 'menu'
"
v-if="enableEdit && myel.catalogo"
rounded
outlined
v-model="recscheda.scheda.sort"
:options="shared_consts.ORDINAMENTO_CATALOGHI"
@update:model-value="modifElem"
label="Ordinamento"
style="width: 300px"
emit-value
map-options
>
</q-select>
<q-select <q-select
:behavior=" :behavior="
$q.platform.is.ios === true ? 'dialog' : 'menu' $q.platform.is.ios === true ? 'dialog' : 'menu'
@@ -1606,9 +1651,8 @@
:options="shared_consts.VERSIONI_PRODOTTO" :options="shared_consts.VERSIONI_PRODOTTO"
@update:model-value="modifElem" @update:model-value="modifElem"
multiple multiple
dense
label="Includi" label="Includi"
style="width: 150px" style="width: 300px"
emit-value emit-value
map-options map-options
> >
@@ -1628,9 +1672,8 @@
:options="shared_consts.VERSIONI_PRODOTTO" :options="shared_consts.VERSIONI_PRODOTTO"
@update:model-value="modifElem" @update:model-value="modifElem"
multiple multiple
dense
label="Escludi" label="Escludi"
style="width: 150px" style="width: 300px"
emit-value emit-value
map-options map-options
> >
@@ -1646,9 +1689,8 @@
:options="Products.publishers" :options="Products.publishers"
@update:model-value="modifElem" @update:model-value="modifElem"
multiple multiple
dense
label="Editori" label="Editori"
style="width: 150px" style="width: 300px"
emit-value emit-value
map-options map-options
option-value="_id" option-value="_id"
@@ -1670,7 +1712,6 @@
filled filled
use-input use-input
new-value-mode="add-unique" new-value-mode="add-unique"
dense
style="width: 350px" style="width: 350px"
/> />
</div> </div>
@@ -1681,14 +1722,36 @@
dense-toggle dense-toggle
expand-separator expand-separator
label="Pagina" label="Pagina"
:disabled="recscheda.scheda.linkIdTemplate"
icon="fas fa-play-circle" icon="fas fa-play-circle"
> >
<CMyDimensioni <CMyDimensioni
v-model="recscheda.scheda.dimensioni.pagina" v-model="
recscheda.scheda.dimensioni.pagina.dimensioni
"
:path="costanti.DIR_SCHEDA" :path="costanti.DIR_SCHEDA"
@modifElem="modifElem"
:show_imgsfondo="true" :show_imgsfondo="true"
@update:model-value="modifElem" @update:model-value="modifElem"
></CMyDimensioni> ></CMyDimensioni>
<CMyText
v-model="recscheda.scheda.dimensioni.pagina.testo_up"
@modifElem="modifElem"
@saveFieldElem="saveFieldElem"
@update:model-value="modifElem"
label="Testo in Alto"
>
</CMyText>
<CMyText
v-model="
recscheda.scheda.dimensioni.pagina.testo_down
"
@modifElem="modifElem"
@saveFieldElem="saveFieldElem"
@update:model-value="modifElem"
label="Testo in Basso"
>
</CMyText>
</q-expansion-item> </q-expansion-item>
<q-expansion-item <q-expansion-item
@@ -1696,11 +1759,13 @@
dense-toggle dense-toggle
expand-separator expand-separator
label="Righe" label="Righe"
:disabled="recscheda.scheda.linkIdTemplate"
icon="fas fa-play-circle" icon="fas fa-play-circle"
> >
<CMyDimensioni <CMyDimensioni
v-model="recscheda.scheda.dimensioni.riga" v-model="recscheda.scheda.dimensioni.riga"
:path="costanti.DIR_SCHEDA" :path="costanti.DIR_SCHEDA"
@modifElem="modifElem"
:show_imgsfondo="false" :show_imgsfondo="false"
@update:model-value="modifElem" @update:model-value="modifElem"
></CMyDimensioni> ></CMyDimensioni>
@@ -1711,6 +1776,7 @@
dense-toggle dense-toggle
expand-separator expand-separator
label="Schede" label="Schede"
:disabled="recscheda.scheda.linkIdTemplate"
icon="fas fa-play-circle" icon="fas fa-play-circle"
> >
<q-toggle <q-toggle
@@ -1758,6 +1824,7 @@
<CMySize <CMySize
label="Immagini:" label="Immagini:"
:fit="true"
v-model=" v-model="
recscheda.scheda.dimensioni.immagine_prodotto.size recscheda.scheda.dimensioni.immagine_prodotto.size
" "
@@ -1771,93 +1838,26 @@
dense-toggle dense-toggle
expand-separator expand-separator
label="Testo" label="Testo"
:disabled="recscheda.scheda.linkIdTemplate"
icon="fas fa-play-circle" icon="fas fa-play-circle"
> >
<q-select <CMyText
v-model="recscheda.scheda.posiz_text" v-model="recscheda.scheda.testo_right"
:options="posizTextOptions" @modifElem="modifElem"
label="Posizione" @saveFieldElem="saveFieldElem"
options-dense
dense
emit-value
map-options
style="width: 100px"
@update:model-value="modifElem" @update:model-value="modifElem"
fill-input label="Testo a Destra"
text-color="white"
> >
</q-select> </CMyText>
<CMySlider
label="Line Height:"
v-model="recscheda.scheda.line_height"
:min="0.5"
:max="2"
color="blue"
@update:model-value="modifElem"
></CMySlider>
<div> <CMyText
Parole Chiave: {autore} {titolo} {descrizione} v-model="recscheda.scheda.testo_bottom"
{descrizione_estesa} {prezzo} @modifElem="modifElem"
</div> @saveFieldElem="saveFieldElem"
<q-select
v-model="recscheda.scheda.testo_right.font.size"
:options="fontSizeOptions"
label="Font Size Titolo"
options-dense
dense
emit-value
map-options
style="width: 100px"
@update:model-value="modifElem" @update:model-value="modifElem"
fill-input label="Testo in Basso"
text-color="white"
> >
</q-select> </CMyText>
<CMyFieldRec
title="Testo a Destra:"
table="text"
:rec="recscheda.scheda.testo_right"
field="contenuto"
@update:model-value="modifElem"
:canEdit="true"
:canModify="true"
:fieldtype="costanti.FieldType.html"
@save="saveFieldElem"
@update_col="update_col"
>
</CMyFieldRec>
<q-select
v-model="recscheda.scheda.testo_bottom.font.size"
:options="fontSizeOptions"
label="Dimensione Titolo"
options-dense
dense
emit-value
map-options
style="width: 150px"
@update:model-value="modifElem"
fill-input
text-color="white"
>
</q-select>
<CMyFieldRec
title="Testo in Basso :"
table="text"
:rec="recscheda.scheda.testo_bottom"
field="contenuto"
@update:model-value="modifElem"
:canEdit="true"
:canModify="true"
:fieldtype="costanti.FieldType.html"
@save="saveFieldElem"
@update_col="update_col"
>
</CMyFieldRec>
</q-expansion-item> </q-expansion-item>
<q-expansion-item <q-expansion-item
@@ -1865,6 +1865,7 @@
dense-toggle dense-toggle
expand-separator expand-separator
label="Codice a Barre" label="Codice a Barre"
:disabled="recscheda.scheda.linkIdTemplate"
icon="fas fa-play-circle" icon="fas fa-play-circle"
> >
<q-toggle <q-toggle
@@ -1877,7 +1878,7 @@
</q-toggle> </q-toggle>
<q-select <q-select
v-model="recscheda.scheda.barcode.format" v-model="recscheda.scheda.barcode.format"
:options="formatOptions" :options="tools.formatOptions"
label="Formato" label="Formato"
options-dense options-dense
dense dense
@@ -1914,6 +1915,49 @@
:addstr="false" :addstr="false"
></CMySize> ></CMySize>
</q-expansion-item> </q-expansion-item>
<q-expansion-item
dense
dense-toggle
expand-separator
label="Etichette Speciali"
:disabled="recscheda.scheda.linkIdTemplate"
icon="fas fa-play-circle"
>
<q-toggle
v-model="recscheda.scheda.etichette.novita.show"
color="positive"
label="Novità"
@update:model-value="modifElem"
>
</q-toggle>
<CMySlider
label="Pubblicato meno di X mesi fà"
v-model="recscheda.scheda.etichette.novita.months"
:min="1"
:max="24"
color="green"
@update:model-value="modifElem"
></CMySlider>
<q-toggle
v-model="recscheda.scheda.etichette.bestseller.show"
color="positive"
label="Bestseller"
@update:model-value="modifElem"
>
</q-toggle>
<CMySlider
label="Primi N in Classifica"
v-model="
recscheda.scheda.etichette.bestseller
.primiNInClassifica
"
:min="1"
:max="100"
color="green"
@update:model-value="modifElem"
></CMySlider>
</q-expansion-item>
</div> </div>
</q-tab-panel> </q-tab-panel>
</q-tab-panels> </q-tab-panels>
@@ -1928,14 +1972,22 @@
label="Prima Pagina" label="Prima Pagina"
icon="fas fa-play-circle" icon="fas fa-play-circle"
> >
Prima Pagina: <br />
<div class="row"> <div class="row">
<CMyDimensioni <CMyDimensioni
:path="costanti.DIR_CATALOGO" :path="costanti.DIR_CATALOGO"
v-model="myel.catalogo.first_page" v-model="myel.catalogo.first_page"
@modifElem="modifElem"
:show_imgsfondo="true" :show_imgsfondo="true"
@update:model-value="modifElem" @update:model-value="modifElem"
></CMyDimensioni> ></CMyDimensioni>
<CMyText
v-model="myel.catalogo.first_page.text_html"
@modifElem="modifElem"
@saveFieldElem="saveFieldElem"
@update:model-value="modifElem"
label="Testo"
>
</CMyText>
</div> </div>
<br /> <br />
@@ -1948,12 +2000,23 @@
label="Ultima Pagina" label="Ultima Pagina"
icon="fas fa-play-circle" icon="fas fa-play-circle"
> >
<CMyDimensioni <div class="row">
:path="costanti.DIR_CATALOGO" <CMyDimensioni
v-model="myel.catalogo.last_page" :path="costanti.DIR_CATALOGO"
:show_imgsfondo="true" v-model="myel.catalogo.last_page"
@update:model-value="modifElem" @modifElem="modifElem"
></CMyDimensioni> :show_imgsfondo="true"
@update:model-value="modifElem"
></CMyDimensioni>
<CMyText
v-model="myel.catalogo.last_page.text_html"
@modifElem="modifElem"
@saveFieldElem="saveFieldElem"
@update:model-value="modifElem"
label="Testo"
>
</CMyText>
</div>
</q-expansion-item> </q-expansion-item>
<div v-if="enableEdit"> <div v-if="enableEdit">
<q-expansion-item <q-expansion-item

View File

@@ -12,7 +12,7 @@ import MixinBase from '@/mixins/mixin-base'
export default defineComponent({ export default defineComponent({
name: 'CMyFieldRec', name: 'CMyFieldRec',
emits: ['save', 'update:rec'], emits: ['save', 'update:rec', 'update_col'],
props: { props: {
table: { table: {
type: String, type: String,
@@ -177,6 +177,7 @@ export default defineComponent({
} }
function showandsave(row: any, col: any, newval: any, valinitial: any) { function showandsave(row: any, col: any, newval: any, valinitial: any) {
console.log('showandsave CMyFieldDb', row, col, newval) console.log('showandsave CMyFieldDb', row, col, newval)
emit('save', props.rec, newval, col) emit('save', props.rec, newval, col)
@@ -238,6 +239,8 @@ export default defineComponent({
function update_col(name: string, val: any) { function update_col(name: string, val: any) {
// console.log('update_col', name, val) // console.log('update_col', name, val)
myrec.value[name] = val myrec.value[name] = val
emit('update_col', name, val)
} }
onMounted(mounted) onMounted(mounted)

View File

@@ -21,6 +21,8 @@ export default defineComponent({
default: () => ({ default: () => ({
width: '', width: '',
height: '', height: '',
gap: '',
fit: '',
}), }),
}, },
label: { label: {
@@ -37,6 +39,11 @@ export default defineComponent({
required: false, required: false,
default: false, default: false,
}, },
fit: {
type: Boolean,
required: false,
default: false,
},
addstr: { addstr: {
type: Boolean, type: Boolean,
required: false, required: false,
@@ -75,6 +82,9 @@ export default defineComponent({
function modifValueGap(value: any) { function modifValueGap(value: any) {
emit('update:modelValue', { ...internalModel, gap: value }); emit('update:modelValue', { ...internalModel, gap: value });
} }
function modifValueFit(value: any) {
emit('update:modelValue', { ...internalModel, fit: value });
}
function modifValueRatio(value: any) { function modifValueRatio(value: any) {
// modifValueWidth(0) // modifValueWidth(0)
@@ -104,8 +114,10 @@ export default defineComponent({
modifValueHeight, modifValueHeight,
modifValueRatio, modifValueRatio,
modifValueGap, modifValueGap,
modifValueFit,
internalModel, internalModel,
ratio, ratio,
tools,
keepRatio, keepRatio,
} }
} }

View File

@@ -57,6 +57,21 @@
addstr="px" addstr="px"
@update:model-value="modifValueGap" @update:model-value="modifValueGap"
></CMySlider> ></CMySlider>
<q-select
v-if="fit"
v-model="internalModel.fit"
:options="tools.SelectListFit"
label="Dimensione Img"
options-dense
dense
emit-value
map-options
style="width: 120px"
@update:model-value="modifValueFit"
fill-input
text-color="white"
>
</q-select>
</div> </div>
</div> </div>
</template> </template>

View File

View File

@@ -0,0 +1,79 @@
import { defineComponent, ref, computed, PropType, toRef, reactive, watch } from 'vue'
import { IOperators, ISize, IText } from 'model'
import { useI18n } from '@/boot/i18n'
import { useQuasar } from 'quasar'
import { tools } from '@store/Modules/tools'
import { costanti } from '@costanti'
import { CMySlider } from '@src/components/CMySlider'
import { CMyFieldRec } from '@src/components/CMyFieldRec'
import { shared_consts } from '@/common/shared_vuejs'
export default defineComponent({
name: 'CMyText',
emits: ['update:modelValue', 'modifElem', 'saveFieldElem',],
components: { CMySlider, CMyFieldRec },
props: {
modelValue: {
type: Object as PropType<IText>,
required: true,
},
label: {
type: String,
required: true,
},
disable: {
type: Boolean,
required: false,
default: false,
},
show_maxlength: {
type: Boolean,
required: false,
default: true,
},
},
setup(props, { emit }) {
const $q = useQuasar()
const { t } = useI18n()
const internalModel = reactive({ ...props.modelValue })
function modifElem() {
// console.log('modifElem')
emit('update:modelValue', { ...internalModel });
emit('modifElem', null);
}
function update_col() {
// console.log('update_col')
emit('update:modelValue', { ...internalModel });
emit('modifElem', null);
}
function saveFieldElem() {
emit('update:modelValue', { ...internalModel });
emit('saveFieldElem', null);
}
// Sincronizzare i cambiamenti esterni con internalModel quando props cambiano
watch(() => props.modelValue, (newModel: any) => {
Object.assign(internalModel, newModel);
}, { immediate: true });
return {
t,
shared_consts,
internalModel,
modifElem,
tools,
costanti,
saveFieldElem,
update_col,
}
}
})

View File

@@ -0,0 +1,83 @@
<template>
<CMyFieldRec
:title="label"
table="text"
:rec="internalModel"
field="contenuto"
@update:model-value="modifElem"
:canEdit="true"
:canModify="true"
:fieldtype="costanti.FieldType.html"
@save="saveFieldElem"
@update_col="update_col"
>
</CMyFieldRec>
<q-select
v-model="internalModel.font.posiz_text"
:options="tools.posizTextOptions"
label="Posizione"
options-dense
dense
emit-value
map-options
style="width: 100px"
@update:model-value="modifElem"
fill-input
text-color="white"
>
</q-select>
<CMySlider
label="Margine tra l'immagine"
v-model="internalModel.font.perc_text"
:min="0"
:max="100"
color="blue"
addstr="%"
@update:model-value="modifElem"
></CMySlider>
<CMySlider
label="Line Height:"
v-model="internalModel.font.line_height"
:min="0.5"
:max="2"
color="blue"
@update:model-value="modifElem"
></CMySlider>
<CMySlider
v-if="show_maxlength"
label="Lunghezza Massima:"
v-model="internalModel.maxlength"
:min="0"
:max="1000"
color="blue"
addstr=""
@update:model-value="modifElem"
></CMySlider>
<div>
Parole Chiave: {autore} {titolo} {descrizione} {date_pub} {ranking}
{descrizione_breve_macro} {descrizione_completa_macro} {sottotitolo} {prezzo}
</div>
<q-select
v-model="internalModel.font.size"
:options="tools.fontSizeOptions"
label="Size Titolo"
options-dense
dense
emit-value
map-options
style="width: 120px"
@update:model-value="modifElem"
fill-input
text-color="white"
>
</q-select>
</template>
<script lang="ts" src="./CMyText.ts">
</script>
<style lang="scss" scoped>
@import './CMyText.scss';
</style>

View File

@@ -0,0 +1 @@
export {default as CMyText} from './CMyText.vue'

View File

@@ -688,10 +688,14 @@ export interface ISize {
width?: string width?: string
height?: string height?: string
gap?: string gap?: string
fit?: string
} }
export interface IFont { export interface IFont {
name?: string name?: string
size?: string size?: string
line_height?: number
posiz_text?: number
perc_text?: string
} }
export interface IBorder { export interface IBorder {
@@ -706,6 +710,21 @@ export interface IImg {
fit?: string fit?: string
} }
export interface INovita {
show?: boolean
months?: number
}
export interface IBestseller {
show?: boolean
primiNInClassifica?: number
}
export interface IEtichette {
novita?: INovita
bestseller?: IBestseller
}
export interface IBarCode { export interface IBarCode {
show?: boolean show?: boolean
format?: string format?: string
@@ -714,6 +733,12 @@ export interface IBarCode {
widthlines?: number widthlines?: number
} }
export interface IPagina {
dimensioni?: IDimensioni
testo_up?: IText
testo_down?: IText
}
export interface IDimensioni { export interface IDimensioni {
size?: ISize size?: ISize
margini?: IBorder margini?: IBorder
@@ -743,7 +768,7 @@ export interface IText {
} }
export interface IElementiScheda { export interface IElementiScheda {
pagina: IDimensioni pagina: IPagina
riga: IDimensioni riga: IDimensioni
scheda_prodotto: IDimensioni scheda_prodotto: IDimensioni
immagine_prodotto: IDimensioni immagine_prodotto: IDimensioni
@@ -753,15 +778,15 @@ export interface IMyScheda {
_id?: string, _id?: string,
idapp?: string, idapp?: string,
isTemplate?: boolean, isTemplate?: boolean,
linkIdTemplate?: string,
name?: string, name?: string,
line_height?: number
numschede_perRiga?: number numschede_perRiga?: number
numschede_perCol?: number numschede_perCol?: number
show_separatore: boolean show_separatore: boolean
testo_right?: IText testo_right?: IText
testo_bottom?: IText testo_bottom?: IText
posiz_text?: number
barcode?: IBarCode, barcode?: IBarCode,
etichette?: IEtichette,
dimensioni: IElementiScheda dimensioni: IElementiScheda
productTypes?: number[] productTypes?: number[]
@@ -777,7 +802,7 @@ export interface ISchedaSingola {
_id?: string _id?: string
scheda?: IMyScheda, scheda?: IMyScheda,
order?: number, order?: number,
numSchede?: number, numPagineMax?: number,
// In Memoria // In Memoria
arrProdToShow?: IProduct[][][] arrProdToShow?: IProduct[][][]
@@ -785,12 +810,13 @@ export interface ISchedaSingola {
export interface ICatalogo { export interface ICatalogo {
//++AddCATALOGO_FIELDS //++AddCATALOGO_FIELDS
productTypes: number[] productTypes?: number[]
excludeproductTypes: number[] excludeproductTypes?: number[]
formato: string[] formato?: string[]
Categoria: string[] Categoria?: string[]
Editore: string[] Editore?: string[]
pdf: boolean sort?: number
pdf?: boolean
pdf_filename?: string pdf_filename?: string
printable?: boolean printable?: boolean

View File

@@ -42,6 +42,21 @@ export interface IProductInfo {
productTypes?: number[] productTypes?: number[]
versioneGM?: string versioneGM?: string
short_descr: string short_descr: string
totaleVenduti?: number,
venditeLastM?: number,
venditeLast6M?: number,
venditeLastY?: number,
venditeLast2Y?: number,
dataUltimoOrdine?: Date,
rank3M?: number,
rank6M?: number,
rank1Y?: number,
descrizione_breve_macro?: string,
descrizione_completa_macro?: string,
sottotitolo?: string,
link_macro?: string,
} }
export interface IVariazione { export interface IVariazione {
@@ -76,6 +91,7 @@ export interface IProdView {
export interface IProduct { export interface IProduct {
_id?: any _id?: any
indiceRanking?: number
active?: boolean active?: boolean
isbn?: string isbn?: string
idProductInfo?: string, idProductInfo?: string,

View File

@@ -79,9 +79,17 @@ export default defineComponent({
value: shared_consts.Cmd.CAT_NO_SPAZI value: shared_consts.Cmd.CAT_NO_SPAZI
}, },
{ {
label: 'Importa da JSON (ImportaMacro)', label: 'Importa Cataloghi da JSON (ImportaMacro)',
value: shared_consts.Cmd.MACRO_CATALOGO_JSON value: shared_consts.Cmd.MACRO_CATALOGO_JSON
}, },
{
label: 'Importa Ranking da JSON (ImportaMacro)',
value: shared_consts.Cmd.MACRO_RANKING
},
{
label: 'Importa Descrizioni e Link da Sito GruppoMacro (XML)',
value: shared_consts.Cmd.MACRO_DESCRELINKSITOWEB
},
] ]
) )
@@ -356,8 +364,17 @@ export default defineComponent({
return importCmdTxt(cmd, testo); return importCmdTxt(cmd, testo);
} else if (cmd === shared_consts.Cmd.CAT_NO_SPAZI) { } else if (cmd === shared_consts.Cmd.CAT_NO_SPAZI) {
return importNoSpazi(cmd, testo); return importNoSpazi(cmd, testo);
} else if (cmd === shared_consts.Cmd.MACRO_CATALOGO_JSON) { } else if ((cmd === shared_consts.Cmd.MACRO_CATALOGO_JSON || cmd === shared_consts.Cmd.MACRO_RANKING)) {
return importMacroCatalogoJson(cmd, testo); return importMacroCatalogoJson(cmd, testo);
} else if (cmd === shared_consts.Cmd.MACRO_DESCRELINKSITOWEB) {
console.log('TESTO PRIMA:', testo)
const testoJSON = tools.convertXMLStringToJSON(testo)
const testoJSONtoPrint = JSON.stringify(testoJSON, null, 2)
console.log(testoJSONtoPrint)
return importMacroCatalogoJson(cmd, testoJSONtoPrint)
} }
function addfield(col: number, field: string, rec: any, opt: any) { function addfield(col: number, field: string, rec: any, opt: any) {
@@ -401,7 +418,7 @@ export default defineComponent({
if (cmd === shared_consts.Cmd.PRODUCTS_V2) { if (cmd === shared_consts.Cmd.PRODUCTS_V2) {
skipfirstrow.value = false skipfirstrow.value = false
} else if (cmd === shared_consts.Cmd.MACRO_CATALOGO_JSON) { } else if ((cmd === shared_consts.Cmd.MACRO_CATALOGO_JSON) || (cmd === shared_consts.Cmd.MACRO_RANKING) || (cmd === shared_consts.Cmd.MACRO_DESCRELINKSITOWEB)) {
skipfirstrow.value = false skipfirstrow.value = false
} }
@@ -433,8 +450,6 @@ export default defineComponent({
strris += ' istat:\'' + tools.addslashes(rec[0]) + '\',' strris += ' istat:\'' + tools.addslashes(rec[0]) + '\','
strris += ' comune:\'' + tools.addslashes(rec[1]) + '\',' strris += ' comune:\'' + tools.addslashes(rec[1]) + '\','
strris += ' prov:\'' + tools.addslashes(rec[2]) + '\'' strris += ' prov:\'' + tools.addslashes(rec[2]) + '\''
} else if (cmd === shared_consts.Cmd.PRODUCTS) { } else if (cmd === shared_consts.Cmd.PRODUCTS) {
if (!primo) { if (!primo) {
strris += ', ' strris += ', '

View File

@@ -19,6 +19,8 @@
<q-btn v-else-if="cosafare === shared_consts.Cmd.PRODUCTS_V2" label="Importa Prodotti Versione 2" @click="eseguiCmdProduct"></q-btn> <q-btn v-else-if="cosafare === shared_consts.Cmd.PRODUCTS_V2" label="Importa Prodotti Versione 2" @click="eseguiCmdProduct"></q-btn>
<q-btn v-else-if="cosafare === shared_consts.Cmd.INVENTARIO" label="Importa Inventario" @click="eseguiCmdInventario"></q-btn> <q-btn v-else-if="cosafare === shared_consts.Cmd.INVENTARIO" label="Importa Inventario" @click="eseguiCmdInventario"></q-btn>
<q-btn v-else-if="cosafare === shared_consts.Cmd.MACRO_CATALOGO_JSON" label="Importa Catalogo JSON" @click="eseguiCmdCatalogoJson"></q-btn> <q-btn v-else-if="cosafare === shared_consts.Cmd.MACRO_CATALOGO_JSON" label="Importa Catalogo JSON" @click="eseguiCmdCatalogoJson"></q-btn>
<q-btn v-else-if="cosafare === shared_consts.Cmd.MACRO_RANKING" label="Importa Ranking JSON" @click="eseguiCmdCatalogoJson"></q-btn>
<q-btn v-else-if="cosafare === shared_consts.Cmd.MACRO_DESCRELINKSITOWEB" label="Importa Descrizione e Link (GruppoMacro)" @click="eseguiCmdCatalogoJson"></q-btn>
<q-btn v-else label="Esegui" @click="eseguiCmd"></q-btn> <q-btn v-else label="Esegui" @click="eseguiCmd"></q-btn>
<br> <br>
<q-btn label="Genera HTML Province Territoriali" @click="createProvLink"></q-btn> <q-btn label="Genera HTML Province Territoriali" @click="createProvLink"></q-btn>
@@ -28,7 +30,7 @@
<div>{{ risraw }}</div> <div>{{ risraw }}</div>
<div v-html="risultato.substring(0, 1000)"></div> <div v-if="risultato" v-html="risultato.substring(0, 1000)"></div>
<br> <br>
<br> <br>
</div> </div>

View File

@@ -500,19 +500,8 @@ export const costanti = {
TESTO_BORDATO: 5, TESTO_BORDATO: 5,
}, },
SORT_ALPHA: 0, SORT_DEFAULT: 0,
SORT_PUBDATE: 1, SORT_PUBDATE: 1,
SORT_BESTSELLER: 2,
ORDINAMENTO_CATALOGHI: [
{
label: 'Data di Uscita',
value: 1,
},
{
label: 'Alfabetico',
value: 0,
},
],
} }

View File

@@ -161,6 +161,9 @@ export const colISize = [
export const colIText = [ export const colIText = [
AddCol({ name: 'contenuto', label_trans: 'catalogo.contenuto', fieldtype: costanti.FieldType.html }), AddCol({ name: 'contenuto', label_trans: 'catalogo.contenuto', fieldtype: costanti.FieldType.html }),
AddCol({ name: 'maxlength', label_trans: 'catalogo.maxlength', fieldtype: costanti.FieldType.number }), AddCol({ name: 'maxlength', label_trans: 'catalogo.maxlength', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'posiz_text', label_trans: 'catalogo.posiz_text', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'perc_text', label_trans: 'catalogo.perc_text', fieldtype: costanti.FieldType.string }),
AddCol({ name: 'line_height', label_trans: 'catalogo.line_height', fieldtype: costanti.FieldType.number }),
] ]
export const colmyIImg = [ export const colmyIImg = [
AddCol({ name: 'imagefile', label_trans: 'iimg.imagefile', fieldtype: costanti.FieldType.image }), AddCol({ name: 'imagefile', label_trans: 'iimg.imagefile', fieldtype: costanti.FieldType.image }),
@@ -170,6 +173,7 @@ export const colmyIImg = [
export const colmyScheda = [ export const colmyScheda = [
AddCol({ name: 'name', label_trans: 'scheda.name', fieldtype: costanti.FieldType.string }), AddCol({ name: 'name', label_trans: 'scheda.name', fieldtype: costanti.FieldType.string }),
AddCol({ name: 'isTemplate', label_trans: 'scheda.isTemplate', fieldtype: costanti.FieldType.boolean }), AddCol({ name: 'isTemplate', label_trans: 'scheda.isTemplate', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'linkIdTemplate', label_trans: 'scheda.linkIdTemplate', fieldtype: costanti.FieldType.string }),
AddCol({ name: 'widthscheda', label_trans: 'scheda.widthscheda', fieldtype: costanti.FieldType.number }), AddCol({ name: 'widthscheda', label_trans: 'scheda.widthscheda', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'widthpag', label_trans: 'scheda.widthpag', fieldtype: costanti.FieldType.number }), AddCol({ name: 'widthpag', label_trans: 'scheda.widthpag', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'widthimg', label_trans: 'scheda.widthimg', fieldtype: costanti.FieldType.number }), AddCol({ name: 'widthimg', label_trans: 'scheda.widthimg', fieldtype: costanti.FieldType.number }),
@@ -180,8 +184,6 @@ export const colmyScheda = [
AddCol({ name: 'margine_top', label_trans: 'scheda.margine_top', fieldtype: costanti.FieldType.number }), AddCol({ name: 'margine_top', label_trans: 'scheda.margine_top', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'margine_pagina', label_trans: 'scheda.margine_pagina', fieldtype: costanti.FieldType.string }), AddCol({ name: 'margine_pagina', label_trans: 'scheda.margine_pagina', fieldtype: costanti.FieldType.string }),
AddCol({ name: 'margine_riga', label_trans: 'scheda.margine_riga', fieldtype: costanti.FieldType.string }), AddCol({ name: 'margine_riga', label_trans: 'scheda.margine_riga', fieldtype: costanti.FieldType.string }),
AddCol({ name: 'posiz_text', label_trans: 'catalogo.posiz_text', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'line_height', label_trans: 'catalogo.line_height', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'productTypes', label_trans: 'productTypes', fieldtype: costanti.FieldType.number }), AddCol({ name: 'productTypes', label_trans: 'productTypes', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'excludeproductTypes', label_trans: 'excludeproductTypes', fieldtype: costanti.FieldType.number }), AddCol({ name: 'excludeproductTypes', label_trans: 'excludeproductTypes', fieldtype: costanti.FieldType.number }),

View File

@@ -22,6 +22,7 @@ import {
IText, IText,
IAreaDiStampa, IAreaDiStampa,
ICatalogo, ICatalogo,
IPagina,
} from '@model' } from '@model'
import MixinBase from '@/mixins/mixin-base' import MixinBase from '@/mixins/mixin-base'
@@ -351,6 +352,31 @@ export const tools = {
}, },
], ],
posizTextOptions: [
{ label: 'In basso', value: costanti.POSIZ_TESTO.IN_BASSO },
{ label: 'A Destra', value: costanti.POSIZ_TESTO.A_DESTRA },
],
fontSizeOptions: [
{ label: '9', value: '9' },
{ label: '10', value: '10' },
{ label: '11', value: '11' },
{ label: '12', value: '12' },
{ label: '13', value: '13' },
{ label: '14', value: '14' },
{ label: '15', value: '15' },
{ label: '16', value: '16' },
{ label: '18', value: '18' },
{ label: '20', value: '20' },
{ label: '22', value: '22' },
],
formatOptions: [
{ label: 'auto', value: 'CODE128' },
{ label: 'EAN-13', value: 'EAN-13' },
{ label: 'UPC', value: 'upc' },
],
SelectListFormatPDF: [ SelectListFormatPDF: [
{ label: 'a4 (mm)', value: [210, 297] }, { label: 'a4 (mm)', value: [210, 297] },
{ label: '22,60 x 31,26 (in mm)', value: [226.0, 312.6] }, { label: '22,60 x 31,26 (in mm)', value: [226.0, 312.6] },
@@ -9223,6 +9249,23 @@ export const tools = {
rec.contenuto = '' rec.contenuto = ''
rec.maxlength = 0 rec.maxlength = 0
rec.font = {
line_height: 1,
posiz_text: 0,
perc_text: '50%',
name: '',
size: '14px',
}
}
if (!rec.font) {
rec.font = {
line_height: 1,
posiz_text: 0,
perc_text: '50%',
name: '',
size: '14px',
}
} }
return rec return rec
@@ -9253,6 +9296,35 @@ export const tools = {
return myrec return myrec
}, },
resetRecIPagina(rec: IPagina | null) {
let myrec: IPagina = {}
if (!rec) {
let dimensioni: IDimensioni = this.resetRecIDimensioni(null)
myrec = {
dimensioni,
testo_up: this.resetIText(null),
testo_down: this.resetIText(null),
}
}
if (!myrec.dimensioni) {
myrec.dimensioni = this.resetRecIDimensioni(null)
}
if (!myrec.testo_up) {
myrec.testo_up = this.resetIText(null)
}
if (!myrec.testo_down) {
myrec.testo_down = this.resetIText(null)
}
return myrec
},
resetRecIAreaDiStampa(rec: IAreaDiStampa | null) { resetRecIAreaDiStampa(rec: IAreaDiStampa | null) {
let myrec: IAreaDiStampa = {} let myrec: IAreaDiStampa = {}
@@ -9304,19 +9376,68 @@ export const tools = {
} }
}, },
getValueAndSuffix(myvalue: any): {value: number, suffix: string} { getValueAndSuffix(myvalue: any): { value: number, suffix: string } {
if (!myvalue) { if (!myvalue) {
return {value: 0, suffix: ''}; return { value: 0, suffix: '' };
} }
// Estrae l'unità di misura // Estrae l'unità di misura
const unit = myvalue.replace(/[\d.]/g, ''); // Ottiene il suffisso (es. 'px') const unit = myvalue.replace(/[\d.]/g, ''); // Ottiene il suffisso (es. 'px')
const numericalValue = parseFloat(myvalue) || 0; // Converti la parte numerica in float const numericalValue = parseFloat(myvalue) || 0; // Converti la parte numerica in float
return { value: numericalValue, suffix: unit}; // Restituisce il valore con il suffisso return { value: numericalValue, suffix: unit }; // Restituisce il valore con il suffisso
}, },
xmlToJson(xml: any) {
// Converte un XML in un oggetto JavaScript
var obj: any = {};
if (xml.nodeType === 1) { // Elemento
// Se ha attributi, aggiungili all'oggetto
if (xml.attributes.length > 0) {
obj["@attributes"] = {}
for (var j = 0; j < xml.attributes.length; j++) {
var attribute = xml.attributes.item(j);
obj["@attributes"][attribute.nodeName] = attribute.nodeValue;
}
}
} else if (xml.nodeType === 3) { // Testo
obj = xml.nodeValue;
}
// Se ha figli, applica la funzione ricorsivamente
if (xml.hasChildNodes()) {
for (var i = 0; i < xml.childNodes.length; i++) {
var item = xml.childNodes.item(i);
var nodeName = item.nodeName;
if (typeof (obj[nodeName]) === "undefined") {
obj[nodeName] = this.xmlToJson(item);
} else {
if (typeof (obj[nodeName]) === "object") {
// Se l'elemento esiste già, trasformalo in un array
if (typeof (obj[nodeName].push) === "undefined") {
var old = obj[nodeName];
obj[nodeName] = [];
obj[nodeName].push(old);
}
obj[nodeName].push(this.xmlToJson(item));
} else {
obj[nodeName] = [obj[nodeName]];
obj[nodeName].push(this.xmlToJson(item));
}
}
}
}
return obj
},
// Esempio di utilizzo
convertXMLStringToJSON(xmlString: string): any {
var parser = new DOMParser();
var xmlDoc = parser.parseFromString(xmlString, "application/xml");
var jsonResult = this.xmlToJson(xmlDoc);
return jsonResult;
},
// FINE ! // FINE !
// getLocale() { // getLocale() {

View File

@@ -1277,6 +1277,10 @@ export const useProducts = defineStore('Products', {
const maxDescriptionLength = testo.maxlength ?? 100; const maxDescriptionLength = testo.maxlength ?? 100;
const description = myproduct.productInfo.short_descr || ''; const description = myproduct.productInfo.short_descr || '';
const long_descr = myproduct.productInfo.description || ''; const long_descr = myproduct.productInfo.description || '';
const date_pub = tools.getstrDateShort(myproduct.productInfo.date_publishing) || '';
const ranking_globale = myproduct.productInfo.rank1Y || 0;
const ranking = myproduct.indiceRanking! || 0;
const venduti = myproduct.productInfo.totaleVenduti || 0;
const truncatedDescription = description.length > maxDescriptionLength const truncatedDescription = description.length > maxDescriptionLength
? description.substring(0, description.lastIndexOf(' ', maxDescriptionLength)) + '...' ? description.substring(0, description.lastIndexOf(' ', maxDescriptionLength)) + '...'
@@ -1286,6 +1290,20 @@ export const useProducts = defineStore('Products', {
? long_descr.substring(0, long_descr.lastIndexOf(' ', maxDescriptionLength)) + '...' ? long_descr.substring(0, long_descr.lastIndexOf(' ', maxDescriptionLength)) + '...'
: long_descr; : long_descr;
const long_descr_macro = myproduct.productInfo.descrizione_completa_macro || '';
const descrizione_completa_macro = long_descr_macro.length > maxDescriptionLength
? long_descr_macro.substring(0, long_descr_macro.lastIndexOf(' ', maxDescriptionLength)) + '...'
: long_descr_macro;
const short_descr = myproduct.productInfo.descrizione_breve_macro || '';
const descrizione_breve_macro = short_descr.length > maxDescriptionLength
? short_descr.substring(0, short_descr.lastIndexOf(' ', maxDescriptionLength)) + '...'
: short_descr;
const sottotitolo = myproduct.productInfo.sottotitolo || '';
const link_macro = myproduct.productInfo.link_macro || '';
const prezzo = myproduct.arrvariazioni ? myproduct.arrvariazioni[0].price?.toFixed(2) : '' const prezzo = myproduct.arrvariazioni ? myproduct.arrvariazioni[0].price?.toFixed(2) : ''
const prezzo_scontato = myproduct.arrvariazioni ? myproduct.arrvariazioni[0].sale_price?.toFixed(2) : '' const prezzo_scontato = myproduct.arrvariazioni ? myproduct.arrvariazioni[0].sale_price?.toFixed(2) : ''
const misure = myproduct.arrvariazioni ? myproduct.arrvariazioni[0].misure : '' const misure = myproduct.arrvariazioni ? myproduct.arrvariazioni[0].misure : ''
@@ -1301,10 +1319,18 @@ export const useProducts = defineStore('Products', {
'{descrizione_estesa}': truncatedlongDescription || '', '{descrizione_estesa}': truncatedlongDescription || '',
'{pagine}': pagine || '', '{pagine}': pagine || '',
'{misure}': misure || '', '{misure}': misure || '',
'{date_pub}': date_pub || '',
'{ranking_globale}': ranking_globale || '',
'{ranking}': ranking || '',
'{venduti}': venduti || '',
'{formato}': formato || '', '{formato}': formato || '',
'{prezzo}': prezzo || '', '{prezzo}': prezzo || '',
'{scale}': scale || '', '{scale}': scale || '',
'{prezzo_scontato}': prezzo_scontato || '', '{prezzo_scontato}': prezzo_scontato || '',
'{descrizione_completa_macro}': descrizione_completa_macro || '',
'{descrizione_breve_macro}': descrizione_breve_macro || '',
'{link_macro}': link_macro || '',
'{sottotitolo}': sottotitolo || '',
}; };
// Esegue le sostituzioni // Esegue le sostituzioni

View File

@@ -85,8 +85,28 @@ body {
font-family: 'DINPro-BoldItalic', sans-serif; font-family: 'DINPro-BoldItalic', sans-serif;
} }
.book-details { .book-details {
font-family: 'DINPro', sans-serif; font-family: 'DINPro', sans-serif;
margin-bottom: calc(5 * var(--scalecatalog) * 1px); margin-bottom: calc(5 * var(--scalecatalog) * 1px);
} }
.book-descr-estesa {
font-family: 'DINPro', sans-serif;
font-size: calc(14 * var(--scalecatalog) * 1px);
}
.book-novita {
font-size: calc(20 * var(--scalecatalog) * 1px);
}
.book-text-up {
font-family: 'DINPro', sans-serif;
margin-bottom: calc(5 * var(--scalecatalog) * 1px);
font-size: calc(20 * var(--scalecatalog) * 1px);
}
.book-text-down {
font-family: 'DINPro', sans-serif;
margin-bottom: calc(5 * var(--scalecatalog) * 1px);
}

View File

@@ -14,7 +14,7 @@ import { CProductCard } from '@src/components/CProductCard'
import { CMySelect } from '@src/components/CMySelect' import { CMySelect } from '@src/components/CMySelect'
import { CContainerCatalogoCard } from '@src/components/CContainerCatalogoCard' import { CContainerCatalogoCard } from '@src/components/CContainerCatalogoCard'
import { CSelectUserActive } from '@src/components/CSelectUserActive' import { CSelectUserActive } from '@src/components/CSelectUserActive'
import { ICatalogo, IFilterCatalogo, IMyScheda, IProdView, IProduct, ISchedaSingola, ISearchList } from 'model' import { ICatalogo, IDimensioni, IFilterCatalogo, IMyScheda, IProdView, IProduct, ISchedaSingola, ISearchList } from 'model'
// import { VueHtmlToPaper } from 'vue-html-to-paper' // import { VueHtmlToPaper } from 'vue-html-to-paper'
import html2pdf from 'html2pdf.js' import html2pdf from 'html2pdf.js'
@@ -192,7 +192,7 @@ export default defineComponent({
} }
function calcArrProducts() { function calcArrProducts() {
// console.log('calcArrProducts') console.log('calcArrProducts')
// eventuali titoli specifici estratti dall'array di Prodotti Selezionati // eventuali titoli specifici estratti dall'array di Prodotti Selezionati
//const searchtext = getSearchText() //const searchtext = getSearchText()
@@ -270,20 +270,12 @@ export default defineComponent({
}); });
} }
// console.log('filter.value.sort', filter.value.sort) arrprod = getProductsSorted(arrprod, filter.value.sort);
// sort using filter.value.sort :
if (filter.value.sort === costanti.SORT_PUBDATE) {
arrprod = arrprod.sort((a: IProduct, b: IProduct) => {
return b.productInfo.date_publishing_ts - a.productInfo.date_publishing_ts
})
} else if (filter.value.sort === costanti.SORT_ALPHA) {
}
arrProducts.value = arrprod arrProducts.value = arrprod
populateDataWithlinkIdTemplate()
generatearrProdToViewSorted() generatearrProdToViewSorted()
loaddata() loaddata()
@@ -291,7 +283,55 @@ export default defineComponent({
refreshpage.value = false refreshpage.value = false
} }
function getProductsFilteredByScheda(scheda: IMyScheda) {
function sovrascriviSchedaFromTemplate(idTemplate: string, origScheda: ISchedaSingola) {
if (!props.optcatalogo)
return
const arrschede: ISchedaSingola[] = globalStore.getMySchede()
const myfindscheda = arrschede.find((recscheda: ISchedaSingola) => recscheda.scheda?._id === idTemplate)
let mynewscheda = tools.jsonCopy(origScheda)
const linkIdTemplate = origScheda.scheda?.linkIdTemplate
const precname = origScheda.scheda?.name
if (myfindscheda) {
let myschedatocopy = tools.jsonCopy(myfindscheda)
if (myschedatocopy) {
myschedatocopy.scheda._id = origScheda.scheda?._id
myschedatocopy.scheda.isTemplate = false
myschedatocopy.scheda.name = precname
myschedatocopy.scheda.linkIdTemplate = linkIdTemplate
return myschedatocopy.scheda
}
}
return null
}
function populateDataWithlinkIdTemplate() {
if (props.optcatalogo) {
for (const recscheda of props.optcatalogo.arrSchede!) {
if (recscheda.scheda?.linkIdTemplate) {
// ricopia da Template:
const myscheda = sovrascriviSchedaFromTemplate(recscheda.scheda?.linkIdTemplate, recscheda)
if (myscheda) {
recscheda.scheda = myscheda
}
}
}
}
}
function getProductsFilteredByScheda(scheda: IMyScheda): IProduct[] {
const searchtext = scheda.arrProdottiSpeciali const searchtext = scheda.arrProdottiSpeciali
@@ -346,7 +386,7 @@ export default defineComponent({
if (!boolfiltroVuotoProductTypes) { if (!boolfiltroVuotoProductTypes) {
// check if productInfo.productTypes array includes some item in scheda.ProductTypes array // check if productInfo.productTypes array includes some item in scheda.ProductTypes array
hasProductTypes = !scheda.productTypes || (scheda.productTypes && (product.productInfo.productTypes || []).some((item: any) => scheda.productTypes.includes(item))) hasProductTypes = !scheda.productTypes || (scheda.productTypes && (product.productInfo.productTypes || []).some((item: any) => scheda.productTypes!.includes(item)))
} }
if (!boolfiltroVuotoEditore) { if (!boolfiltroVuotoEditore) {
hasPublished = !scheda.editore || (scheda.editore && scheda.editore.includes(product.productInfo.idPublisher!)) hasPublished = !scheda.editore || (scheda.editore && scheda.editore.includes(product.productInfo.idPublisher!))
@@ -354,7 +394,7 @@ export default defineComponent({
if (!boolfiltroVuotoExcludeProductTypes) { if (!boolfiltroVuotoExcludeProductTypes) {
// check if productInfo.productTypes array exclude some item in scheda.ProductTypes array // check if productInfo.productTypes array exclude some item in scheda.ProductTypes array
hasExcludeProductTypes = !scheda.excludeproductTypes || (scheda.excludeproductTypes && (product.productInfo.productTypes || []).every((item: any) => scheda.excludeproductTypes.includes(item))) hasExcludeProductTypes = !scheda.excludeproductTypes || (scheda.excludeproductTypes && (product.productInfo.productTypes || []).every((item: any) => scheda.excludeproductTypes!.includes(item)))
} }
return searchMatch && hasCategoria && hasAuthor && hasProductTypes && hasPublished && !hasExcludeProductTypes; return searchMatch && hasCategoria && hasAuthor && hasProductTypes && hasPublished && !hasExcludeProductTypes;
@@ -364,15 +404,35 @@ export default defineComponent({
} }
}) })
// console.log('filter.value.sort', filter.value.sort) arrprod = getProductsSorted(arrprod, scheda?.sort!);
// sort using filter.value.sort :
if (scheda.sort === costanti.SORT_PUBDATE) { return arrprod
}
function getProductsSorted(arrprod: IProduct[], sort: number) {
console.log('getProductsSorted', sort)
if (sort === costanti.SORT_PUBDATE) {
arrprod = arrprod.sort((a: IProduct, b: IProduct) => { arrprod = arrprod.sort((a: IProduct, b: IProduct) => {
return b.productInfo.date_publishing_ts - a.productInfo.date_publishing_ts return b.productInfo.date_publishing_ts - a.productInfo.date_publishing_ts
}) })
} else if (sort === costanti.SORT_BESTSELLER) {
} else if (scheda.sort === costanti.SORT_ALPHA) { arrprod = arrprod.sort((a: IProduct, b: IProduct) => {
return b.productInfo.rank1Y! - a.productInfo.rank1Y!
})
arrprod = arrprod.map((product, index) => {
return {
...product,
indiceRanking: index + 1
};
})
console.log('arr', arrprod)
} else if (sort === costanti.SORT_DEFAULT) {
} }
@@ -423,20 +483,43 @@ export default defineComponent({
} }
function generatearrProdToViewSorted() { function generatearrProdToViewSorted() {
// console.log('generatearrProdToViewSorted') console.log('generatearrProdToViewSorted', arrProducts.value)
// Svuota // Svuota
arrProdToView.value = [] arrProdToView.value = []
// gia filtrati
const arrGeneraleProdotti = arrProducts.value;
let indprod = 0
let indprodGenerale = 0
for (const recscheda of props.optcatalogo.arrSchede!) { for (const recscheda of props.optcatalogo.arrSchede!) {
if (recscheda && recscheda.scheda) { if (recscheda && recscheda.scheda) {
let schedePerRiga = recscheda.scheda.numschede_perRiga || 1 let schedePerRiga = recscheda.scheda.numschede_perRiga || 1
let schedePerCol = recscheda.scheda.numschede_perCol || 1 let schedePerCol = recscheda.scheda.numschede_perCol || 1
let schedePerPagina = schedePerRiga * schedePerCol let schedePerPagina = schedePerRiga * schedePerCol
// Filtra i prodotti in base ai filtri impostati ! let arrProdFiltrati: IProduct[] = []
const arrProdFiltrati = getProductsFilteredByScheda(recscheda.scheda)
let indprod = 0 if (recscheda.scheda.productTypes!.length > 0) {
// Filtra i prodotti in base ai filtri impostati !
arrProdFiltrati = getProductsFilteredByScheda(recscheda.scheda)
indprod = 0
} else {
if (recscheda.scheda?.sort! > 0) {
arrProdFiltrati = getProductsSorted(arrGeneraleProdotti, recscheda.scheda.sort!);
indprod = 0
} else {
indprod = indprodGenerale
arrProdFiltrati = arrGeneraleProdotti
}
}
// console.log('arrProdFiltrati indiceRanking = ', arrProdFiltrati[0].indiceRanking)
let indadded = 0 let indadded = 0
recscheda.arrProdToShow = [] recscheda.arrProdToShow = []
@@ -463,17 +546,27 @@ export default defineComponent({
recscheda.arrProdToShow[pagina][riga] = []; recscheda.arrProdToShow[pagina][riga] = [];
} }
console.log('RANKING: ', result.myrec.indiceRanking!)
recscheda.arrProdToShow[pagina][riga][col] = result.myrec recscheda.arrProdToShow[pagina][riga][col] = result.myrec
indadded++ indadded++
} }
} }
} }
if (recscheda.numPagineMax! > 0) {
if (pagina + 1 >= recscheda.numPagineMax!)
break; // fine pagine
}
} }
// console.log('*** arrProdToShow', recscheda.arrProdToShow) // console.log('*** arrProdToShow', recscheda.arrProdToShow)
} }
} }
console.log('Fine...')
} }
function getNextProd() { function getNextProd() {
@@ -720,51 +813,8 @@ export default defineComponent({
} }
function groupedPages(recscheda: ISchedaSingola) { function groupedPages(recscheda: ISchedaSingola) {
return recscheda.arrProdToShow
let numschedeattuali = 0
if (recscheda.scheda) {
const schedePerRiga = recscheda.scheda.numschede_perRiga || 1
const schedePerCol = recscheda.scheda.numschede_perCol || 1
const schedePerPagina = schedePerRiga * schedePerCol
let indiceprodotto = 0
const pages = []
// Iterate attraverso l'array prodotti con step = schedePerPagina
for (let pageStart = 0; pageStart < arrProducts.value.length; pageStart += schedePerPagina) {
const page = []
// Crea le righe per questa pagina
for (let rowStart = 0; rowStart < schedePerRiga; rowStart++) {
const row = []
// Riempi ogni riga con il numero corretto di prodotti
for (let col = 0; col < schedePerCol; col++) {
const productIndex = pageStart + (rowStart * schedePerRiga) + col
row.push(indiceprodotto)
indiceprodotto++
}
page.push(row)
}
numschedeattuali++
pages.push(page)
if (recscheda.numSchede! > 0) {
if (numschedeattuali >= recscheda.numSchede!)
return pages
}
}
return pages
}
return null
} }
function generateStyleCatalogo(optcatalogo: ICatalogo) { function generateStyleCatalogo(optcatalogo: ICatalogo) {
return { return {
@@ -773,19 +823,19 @@ export default defineComponent({
} }
function generateStylePageScheda(optcatalogo: ICatalogo, scheda: IMyScheda) { function generateStylePageScheda(optcatalogo: ICatalogo, scheda: IMyScheda) {
const marginTop = scheda.dimensioni?.pagina?.margini?.top ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.margini?.top) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.top) ?? '') const marginTop = scheda.dimensioni?.pagina?.dimensioni?.margini?.top ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.margini?.top) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.top) ?? '')
const marginBottom = scheda.dimensioni?.pagina?.margini?.bottom ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.margini?.bottom) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.bottom) ?? '') const marginBottom = scheda.dimensioni?.pagina?.dimensioni?.margini?.bottom ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.margini?.bottom) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.bottom) ?? '')
const marginLeft = scheda.dimensioni?.pagina?.margini?.left ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.margini?.left) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.left) ?? '') const marginLeft = scheda.dimensioni?.pagina?.dimensioni?.margini?.left ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.margini?.left) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.left) ?? '')
const marginRight = scheda.dimensioni?.pagina?.margini?.right ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.margini?.right): (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.right) ?? '') const marginRight = scheda.dimensioni?.pagina?.dimensioni?.margini?.right ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.margini?.right) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.right) ?? '')
const paddingTop = scheda.dimensioni?.pagina?.padding?.top ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.padding?.top) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.top) ?? '') const paddingTop = scheda.dimensioni?.pagina?.dimensioni?.padding?.top ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.padding?.top) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.top) ?? '')
const paddingBottom = scheda.dimensioni?.pagina?.padding?.bottom ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.padding?.bottom) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.bottom) ?? '') const paddingBottom = scheda.dimensioni?.pagina?.dimensioni?.padding?.bottom ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.padding?.bottom) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.bottom) ?? '')
const paddingLeft = scheda.dimensioni?.pagina?.padding?.left ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.padding?.left) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.left) ?? '') const paddingLeft = scheda.dimensioni?.pagina?.dimensioni?.padding?.left ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.padding?.left) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.left) ?? '')
const paddingRight = scheda.dimensioni?.pagina?.padding?.right ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.padding?.right) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.right) ?? '') const paddingRight = scheda.dimensioni?.pagina?.dimensioni?.padding?.right ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.padding?.right) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.right) ?? '')
// Esiste un immagine di sfondo specifica della singola pagina ? // Esiste un immagine di sfondo specifica della singola pagina ?
let fileimg = scheda.dimensioni?.pagina?.imgsfondo?.imagefile let fileimg = scheda.dimensioni?.pagina?.dimensioni?.imgsfondo?.imagefile
let backgroundSize = scheda.dimensioni?.pagina?.imgsfondo?.fit let backgroundSize = scheda.dimensioni?.pagina?.dimensioni?.imgsfondo?.fit
if (fileimg) { if (fileimg) {
fileimg = fileimg ? `url(${costanti.DIR_UPLOAD + costanti.DIR_SCHEDA + fileimg})` : '' fileimg = fileimg ? `url(${costanti.DIR_UPLOAD + costanti.DIR_SCHEDA + fileimg})` : ''
} }
@@ -799,8 +849,56 @@ export default defineComponent({
let backgroundImage = fileimg ?? '' let backgroundImage = fileimg ?? ''
let width = scheda.dimensioni?.pagina?.size?.width ? tools.adjustSize(optcatalogo, scheda.dimensioni?.pagina?.size?.width) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.size?.width) ?? '') let width = scheda.dimensioni?.pagina?.dimensioni?.size?.width ? tools.adjustSize(optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.size?.width) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.size?.width) ?? '')
let height = scheda.dimensioni?.pagina?.size?.height ? tools.adjustSize(optcatalogo, scheda.dimensioni?.pagina?.size?.height) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.size?.height) ?? '') let height = scheda.dimensioni?.pagina?.dimensioni?.size?.height ? tools.adjustSize(optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.size?.height) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.size?.height) ?? '')
return {
marginBottom,
marginTop,
marginLeft,
marginRight,
paddingBottom,
paddingTop,
paddingLeft,
paddingRight,
backgroundImage,
backgroundSize,
'--width': width,
'--height': height,
...(width ? { width: `${width} !important;` } : {}),
...(height ? { height: `${height} !important;` } : {}) // Aggiungi l'altezza solo se è valorizzata
};
}
function generateStyleByPageDim(optcatalogo: ICatalogo, mypage: IDimensioni) {
const marginTop = mypage!.margini?.top ? tools.adjustSize(props.optcatalogo, mypage!.margini?.top) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.top) ?? '')
const marginBottom = mypage!.margini?.bottom ? tools.adjustSize(props.optcatalogo, mypage!.margini?.bottom) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.bottom) ?? '')
const marginLeft = mypage!.margini?.left ? tools.adjustSize(props.optcatalogo, mypage!.margini?.left) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.left) ?? '')
const marginRight = mypage!.margini?.right ? tools.adjustSize(props.optcatalogo, mypage!.margini?.right) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.right) ?? '')
const paddingTop = mypage!.padding?.top ? tools.adjustSize(props.optcatalogo, mypage!.padding?.top) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.top) ?? '')
const paddingBottom = mypage!.padding?.bottom ? tools.adjustSize(props.optcatalogo, mypage!.padding?.bottom) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.bottom) ?? '')
const paddingLeft = mypage!.padding?.left ? tools.adjustSize(props.optcatalogo, mypage!.padding?.left) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.left) ?? '')
const paddingRight = mypage!.padding?.right ? tools.adjustSize(props.optcatalogo, mypage!.padding?.right) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.right) ?? '')
// Esiste un immagine di sfondo specifica della singola pagina ?
let fileimg = mypage!.imgsfondo?.imagefile
let backgroundSize = mypage!.imgsfondo?.fit
if (fileimg) {
fileimg = fileimg ? `url(${costanti.DIR_UPLOAD + costanti.DIR_CATALOGO + fileimg})` : ''
}
if (!fileimg) {
// Esiste un immagine di sfondo uguali per tutte le pagine ?
fileimg = optcatalogo.dimensioni_def?.pagina.imgsfondo?.imagefile
backgroundSize = optcatalogo.dimensioni_def?.pagina.imgsfondo?.fit
fileimg = fileimg ? `url(${costanti.DIR_UPLOAD + costanti.DIR_CATALOGO + fileimg})` : ''
}
let backgroundImage = fileimg ?? ''
let width = mypage!.size?.width ? tools.adjustSize(optcatalogo, mypage!.size?.width) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.size?.width) ?? '')
let height = mypage!.size?.height ? tools.adjustSize(optcatalogo, mypage!.size?.height) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.size?.height) ?? '')
return { return {
marginBottom, marginBottom,
@@ -821,10 +919,10 @@ export default defineComponent({
} }
function getWidthPagina(optcatalogo: ICatalogo, scheda: IMyScheda) { function getWidthPagina(optcatalogo: ICatalogo, scheda: IMyScheda) {
return scheda.dimensioni?.pagina?.size?.width ? tools.adjustSize(optcatalogo, scheda.dimensioni?.pagina?.size?.width) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.size?.width) ?? '') return scheda.dimensioni?.pagina?.dimensioni?.size?.width ? tools.adjustSize(optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.size?.width) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.size?.width) ?? '')
} }
function getHeightPagina(optcatalogo: ICatalogo, scheda: IMyScheda) { function getHeightPagina(optcatalogo: ICatalogo, scheda: IMyScheda) {
return scheda.dimensioni?.pagina?.size?.height ? tools.adjustSize(optcatalogo, scheda.dimensioni?.pagina?.size?.height) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.size?.height) ?? '') return scheda.dimensioni?.pagina?.dimensioni?.size?.height ? tools.adjustSize(optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.size?.height) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.size?.height) ?? '')
} }
function getStyleRowSeparator(recscheda: ISchedaSingola) { function getStyleRowSeparator(recscheda: ISchedaSingola) {
@@ -938,6 +1036,7 @@ export default defineComponent({
getWidthPagina, getWidthPagina,
getHeightPagina, getHeightPagina,
getStyleRowSeparator, getStyleRowSeparator,
generateStyleByPageDim,
} }
} }
}) })

View File

@@ -48,9 +48,7 @@
</q-tabs> </q-tabs>
<q-tab-panels v-model="tabvisu" animated class=""> <q-tab-panels v-model="tabvisu" animated class="">
<q-tab-panel name="categorie"> <q-tab-panel name="categorie">
<div <div class="row 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"> <div v-for="(reccat, index) in getCatProds()" :key="index">
<span <span
:class="{ :class="{
@@ -168,7 +166,7 @@
<q-select <q-select
v-model="filter.sort" v-model="filter.sort"
dense dense
:options="costanti.ORDINAMENTO_CATALOGHI" :options="shared_consts.ORDINAMENTO_CATALOGHI"
label="Ordinamento" label="Ordinamento"
placeholder="" placeholder=""
emit-value emit-value
@@ -209,32 +207,16 @@
<div <div
v-if=" v-if="
optcatalogo.first_page && optcatalogo.first_page &&
optcatalogo.first_page.text_html &&
optcatalogo.first_page.text_html.contenuto optcatalogo.first_page.text_html.contenuto
" "
:style="{ :style="
backgroundImage: `url(${ generateStyleByPageDim(optcatalogo, optcatalogo.first_page)
costanti.DIR_UPLOAD + "
costanti.DIR_CATALOGO +
optcatalogo.first_page.imgsfondo.imagefile
})`,
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 <div
v-html="optcatalogo.first_page.text_html.contenuto" v-html="optcatalogo.first_page.text_html.contenuto"
></div> ></div>
\
</div> </div>
<div :style="generateStyleCatalogo(optcatalogo)"> <div :style="generateStyleCatalogo(optcatalogo)">
<div class="flex-container-book"> <div class="flex-container-book">
@@ -250,10 +232,7 @@
class="row items-start" class="row items-start"
style="place-content: center" style="place-content: center"
> >
<div <div v-for="(product, index) in arrLoaded" :key="index">
v-for="(product, index) in arrLoaded"
:key="index"
>
<CContainerCatalogoCard <CContainerCatalogoCard
v-if=" v-if="
product.active || product.active ||
@@ -263,6 +242,7 @@
)) ))
" "
:id="product._id" :id="product._id"
:product="product"
:complete="false" :complete="false"
:cosa="cosa" :cosa="cosa"
:optcatalogo="optcatalogo" :optcatalogo="optcatalogo"
@@ -278,6 +258,7 @@
<CProductCard <CProductCard
v-else-if="product.active || show_hide" v-else-if="product.active || show_hide"
:id="product._id" :id="product._id"
:product="product"
:complete="false" :complete="false"
:cosa="cosa" :cosa="cosa"
/> />
@@ -319,6 +300,30 @@
) )
" "
> >
<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',
}"
>
<div
v-html="
recscheda.scheda.dimensioni.pagina?.testo_up
?.contenuto
"
style="display: flex; flex-direction: row"
></div>
</div>
<!-- Itera sulle righe di ogni pagina --> <!-- Itera sulle righe di ogni pagina -->
<div <div
v-for="(row, rowIndex) in page" v-for="(row, rowIndex) in page"
@@ -333,34 +338,15 @@
<div class="row justify-center"> <div class="row justify-center">
<div <div
v-for="(indprod, colIndex) in row" v-for="(prod, colIndex) in row"
:key="`${pageIndex}-${rowIndex}-${colIndex}`" :key="`${pageIndex}-${rowIndex}-${colIndex}`"
class="flex-item-book" class="flex-item-book"
:style="getStyleSchedaProdotto(recscheda)" :style="getStyleSchedaProdotto(recscheda)"
> >
<CContainerCatalogoCard <CContainerCatalogoCard
v-if=" v-if="prod && prod.active"
getProdBySchedaRigaCol( :id="prod._id"
recscheda, :product="prod"
pageIndex,
rowIndex,
colIndex
) &&
getProdBySchedaRigaCol(
recscheda,
pageIndex,
rowIndex,
colIndex
).active
"
:id="
getProdBySchedaRigaCol(
recscheda,
pageIndex,
rowIndex,
colIndex
)._id
"
:complete="false" :complete="false"
:cosa="cosa" :cosa="cosa"
:optcatalogo="optcatalogo" :optcatalogo="optcatalogo"
@@ -376,28 +362,9 @@
/> />
<CProductCard <CProductCard
v-else-if=" v-else-if="
getProdBySchedaRigaCol( prod && (prod.active || show_hide)
recscheda,
pageIndex,
rowIndex,
colIndex
) &&
(getProdBySchedaRigaCol(
recscheda,
pageIndex,
rowIndex,
colIndex
).active ||
show_hide)
"
:id="
getProdBySchedaRigaCol(
recscheda,
pageIndex,
rowIndex,
colIndex
)._id
" "
:id="prod._id"
:complete="false" :complete="false"
:cosa="cosa" :cosa="cosa"
/> />
@@ -407,12 +374,17 @@
<!-- Separatore --> <!-- Separatore -->
<div <div
v-if="recscheda.scheda?.show_separatore && rowIndex !== page.length - 1" v-if="
recscheda.scheda?.show_separatore &&
rowIndex !== page.length - 1
"
class="text-center" class="text-center"
:style="getStyleRow(recscheda)" :style="getStyleRow(recscheda)"
> >
<q-separator
<q-separator inset :size="tools.adjustSize(optcatalogo, '1px')"></q-separator> inset
:size="tools.adjustSize(optcatalogo, '1px')"
></q-separator>
</div> </div>
</div> </div>
<!-- Card Row --> <!-- Card Row -->
@@ -428,27 +400,12 @@
<div <div
v-if=" v-if="
optcatalogo.last_page && optcatalogo.last_page &&
optcatalogo.last_page.text_html &&
optcatalogo.last_page.text_html.contenuto optcatalogo.last_page.text_html.contenuto
" "
:style="{ :style="
backgroundImage: `url(${ generateStyleByPageDim(optcatalogo, optcatalogo.last_page)
costanti.DIR_UPLOAD + "
costanti.DIR_CATALOGO +
optcatalogo.last_page.imgsfondo.imagefile
})`,
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 v-html="optcatalogo.last_page.text_html.contenuto"></div> <div v-html="optcatalogo.last_page.text_html.contenuto"></div>
</div> </div>