- Cataloghi: BestSeller, Novità
This commit is contained in:
@@ -33,9 +33,11 @@ else
|
||||
rm -R ./public/upload/products/*
|
||||
rm -R ./public/upload/pages/*
|
||||
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/pages/* ./public/upload/pages/
|
||||
cp -R _ALL_SITES/$site/upload/catalogo/* ./public/upload/catalogo/
|
||||
cp -R _ALL_SITES/$site/upload/scheda/* ./public/upload/scheda/
|
||||
rm -R ./public/images/*
|
||||
cp -R _ALL_SITES/$site/images/* ./public/images/
|
||||
|
||||
|
||||
BIN
public/images/bestseller.png
Normal file
BIN
public/images/bestseller.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
BIN
public/images/novita.png
Normal file
BIN
public/images/novita.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
@@ -379,6 +379,8 @@ export const shared_consts = {
|
||||
PRODUCTS_V2: 22,
|
||||
INVENTARIO: 30,
|
||||
MACRO_CATALOGO_JSON: 40,
|
||||
MACRO_RANKING: 50,
|
||||
MACRO_DESCRELINKSITOWEB: 60,
|
||||
},
|
||||
|
||||
BotType: [
|
||||
@@ -2229,6 +2231,25 @@ export const shared_consts = {
|
||||
PRODUCT: 1000,
|
||||
},
|
||||
|
||||
ORDINAMENTO_CATALOGHI: [
|
||||
{
|
||||
label: '[Default]',
|
||||
value: 0,
|
||||
},
|
||||
{
|
||||
label: 'Data di Uscita',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: 'Bestseller',
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
label: 'Alfabetico',
|
||||
value: 0,
|
||||
},
|
||||
],
|
||||
|
||||
VERSIONI_PRODOTTO: [
|
||||
{
|
||||
label: '[Nessuno]',
|
||||
|
||||
@@ -160,7 +160,7 @@ export default defineComponent({
|
||||
|
||||
if (myproduct.value) {
|
||||
const ris = await products.addtoCartBase({ $q, t, id: myproduct.value._id, order: myorder, addqty: add })
|
||||
updateproduct()
|
||||
updateproduct(false)
|
||||
if (ris && ris.myord) {
|
||||
|
||||
}
|
||||
@@ -217,10 +217,22 @@ export default defineComponent({
|
||||
|
||||
}
|
||||
|
||||
async function updateproduct() {
|
||||
async function updateproduct(atload: boolean) {
|
||||
|
||||
let carica = true
|
||||
|
||||
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)
|
||||
}
|
||||
@@ -360,7 +372,7 @@ export default defineComponent({
|
||||
async function load() {
|
||||
indvariazSel.value = -1
|
||||
initproduct()
|
||||
await updateproduct()
|
||||
await updateproduct(true)
|
||||
labelDataArrivoMerce.value = ''
|
||||
labelDataRitiro.value = ''
|
||||
|
||||
@@ -512,6 +524,31 @@ export default defineComponent({
|
||||
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)
|
||||
onBeforeUnmount(beforeDestroy)
|
||||
|
||||
@@ -568,6 +605,8 @@ export default defineComponent({
|
||||
click_author,
|
||||
click_opendetail,
|
||||
checkIfVariazioneDaVisu,
|
||||
isProductNovita,
|
||||
isProductBestseller,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -76,13 +76,15 @@
|
||||
'flex', // Classi comuni
|
||||
'image-container',
|
||||
{ '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-row', // Layout flessibile
|
||||
]"
|
||||
:style="{
|
||||
justifyContent:
|
||||
scheda.posiz_text === costanti.POSIZ_TESTO.IN_BASSO
|
||||
scheda.testo_right.font?.posiz_text ===
|
||||
costanti.POSIZ_TESTO.IN_BASSO
|
||||
? 'center'
|
||||
: 'flex-start',
|
||||
alignItems: 'stretch', // Cambiato in 'stretch' per occupare l'altezza
|
||||
@@ -113,6 +115,7 @@
|
||||
: myproduct.productInfo.image_link
|
||||
"
|
||||
:alt="myproduct.productInfo.name"
|
||||
:fit="scheda.dimensioni?.immagine_prodotto?.size?.fit ?? 'cover'"
|
||||
:class="{
|
||||
'book-image-fixed': complete,
|
||||
'cursor-pointer': !complete,
|
||||
@@ -120,10 +123,11 @@
|
||||
'image-wrapper': optcatalogo.pdf,
|
||||
}"
|
||||
:style="{
|
||||
zIndex: 9000,
|
||||
zIndex: 2,
|
||||
width:
|
||||
scheda.posiz_text === costanti.POSIZ_TESTO.IN_BASSO
|
||||
? '50%'
|
||||
scheda.testo_right.font?.posiz_text ===
|
||||
costanti.POSIZ_TESTO.IN_BASSO
|
||||
? scheda.testo_right.font?.perc_text ?? '50%'
|
||||
: '45%',
|
||||
...(tools.adjustSize(
|
||||
optcatalogo,
|
||||
@@ -135,6 +139,12 @@
|
||||
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()"
|
||||
@@ -143,12 +153,14 @@
|
||||
<div
|
||||
:style="{
|
||||
width:
|
||||
scheda.posiz_text === costanti.POSIZ_TESTO.IN_BASSO
|
||||
scheda.testo_right.font?.posiz_text ===
|
||||
costanti.POSIZ_TESTO.IN_BASSO
|
||||
? '100%'
|
||||
: '50%',
|
||||
: scheda.testo_right.font?.perc_text ?? '50%',
|
||||
textAlign: 'center',
|
||||
marginTop:
|
||||
scheda.posiz_text === costanti.POSIZ_TESTO.IN_BASSO
|
||||
scheda.testo_right.font?.posiz_text ===
|
||||
costanti.POSIZ_TESTO.IN_BASSO
|
||||
? '0.5rem'
|
||||
: '0',
|
||||
}"
|
||||
@@ -157,7 +169,7 @@
|
||||
v-if="scheda.testo_right && scheda.testo_right"
|
||||
:style="{
|
||||
'--scalecatalog': optcatalogo.areadistampa.scale,
|
||||
'line-height': scheda.line_height,
|
||||
'line-height': scheda.testo_right.font?.line_height,
|
||||
height: '100%',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
@@ -171,8 +183,14 @@
|
||||
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 class="row justify-center">
|
||||
<div v-if="scheda.barcode && scheda.barcode.show">
|
||||
<CBarCode
|
||||
:value="myproduct.productInfo.code"
|
||||
@@ -180,7 +198,10 @@
|
||||
:fontsize="scheda.barcode.font?.size"
|
||||
:width="
|
||||
parseInt(
|
||||
tools.adjustSize(optcatalogo, scheda.barcode.size?.width)
|
||||
tools.adjustSize(
|
||||
optcatalogo,
|
||||
scheda.barcode.size?.width
|
||||
)
|
||||
)
|
||||
"
|
||||
:widthlines="scheda.barcode.widthlines"
|
||||
@@ -188,6 +209,25 @@
|
||||
>
|
||||
</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
|
||||
@@ -200,28 +240,7 @@
|
||||
<div
|
||||
:style="{
|
||||
'--scalecatalog': optcatalogo.areadistampa.scale,
|
||||
'line-height': scheda.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,
|
||||
'line-height': scheda.testo_bottom.font?.line_height,
|
||||
}"
|
||||
v-html="
|
||||
products.replaceKeyWordsByProduct(
|
||||
|
||||
@@ -15,7 +15,7 @@ import { shared_consts } from '@src/common/shared_vuejs'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
import { costanti } from '@costanti'
|
||||
import { ICatalogo, IMyScheda } from '@src/model'
|
||||
import { ICatalogo, IMyScheda, IProduct } from '@src/model'
|
||||
|
||||
|
||||
export default defineComponent({
|
||||
@@ -27,6 +27,11 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
product: {
|
||||
type: Object as PropType<IProduct | null>,
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
cosa: {
|
||||
type: Number,
|
||||
required: false,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<CCatalogoCard
|
||||
:id="id"
|
||||
:product="product"
|
||||
:complete="complete"
|
||||
:cosa="cosa"
|
||||
:options="options"
|
||||
@@ -21,6 +22,7 @@
|
||||
<div class="row justify-center">
|
||||
<CCatalogoCard
|
||||
:id="id"
|
||||
:product="product"
|
||||
:complete="true"
|
||||
:cosa="cosa"
|
||||
:options="{
|
||||
|
||||
@@ -16,7 +16,7 @@ import { shared_consts } from '@/common/shared_vuejs'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CMyDimensioni',
|
||||
emits: ['update:modelValue'],
|
||||
emits: ['update:modelValue', 'modifElem'],
|
||||
components: { CMySize, CBorders, CMyFieldRec },
|
||||
props: {
|
||||
modelValue: {
|
||||
@@ -59,6 +59,10 @@ export default defineComponent({
|
||||
function modifSize(value: any) {
|
||||
emit('update:modelValue', { ...internalModel, size: value });
|
||||
}
|
||||
function modifElem() {
|
||||
emit('update:modelValue', { ...internalModel });
|
||||
emit('modifElem', null);
|
||||
}
|
||||
function modifMargini(value: any) {
|
||||
emit('update:modelValue', { ...internalModel, margini: value });
|
||||
}
|
||||
@@ -90,6 +94,7 @@ export default defineComponent({
|
||||
modifMargini,
|
||||
modifPadding,
|
||||
saveFielDim,
|
||||
modifElem,
|
||||
costanti,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,17 +12,17 @@
|
||||
|
||||
<div v-if="internalModel" class="sfondo_margine row">
|
||||
<CMySize
|
||||
label="Pagina:"
|
||||
label="Dinemsioni:"
|
||||
v-model="internalModel.size"
|
||||
@update:model-value="modifSize"
|
||||
></CMySize>
|
||||
<CBorders
|
||||
label="Margini Pagina:"
|
||||
label="Margini:"
|
||||
v-model="internalModel.margini"
|
||||
@update:model-value="modifMargini"
|
||||
></CBorders>
|
||||
<CBorders
|
||||
label="Padding Pagina:"
|
||||
label="Padding:"
|
||||
v-model="internalModel.padding"
|
||||
@update:model-value="modifPadding"
|
||||
></CBorders>
|
||||
|
||||
@@ -26,6 +26,7 @@ import { CSelectFontSize } from '@src/components/CSelectFontSize'
|
||||
import { CMySize } from '@src/components/CMySize'
|
||||
import { CBorders } from '@src/components/CBorders'
|
||||
import { CMyDimensioni } from '@src/components/CMyDimensioni'
|
||||
import { CMyText } from '@src/components/CMyText'
|
||||
|
||||
import MixinMetaTags from '@/mixins/mixin-metatags'
|
||||
import MixinBase from '@/mixins/mixin-base'
|
||||
@@ -42,7 +43,7 @@ export default defineComponent({
|
||||
CImgTitle, CTitle, LandingFooter, CEventsCalendar,
|
||||
CCardCarousel, COpenStreetMap, CMyPage, CMyPageIntro, CMyEditor, CMyFieldRec,
|
||||
CSelectColor, CSelectFontSize, CSelectImage, CImgPoster, CSelectAnimation, CMySlider,
|
||||
CMySize, CBorders, CMyDimensioni,
|
||||
CMySize, CBorders, CMyDimensioni, CMyText,
|
||||
},
|
||||
emits: ['saveElem', 'selElemClick', 'toggleSize', 'deleteElem', 'dupPage'],
|
||||
props: {
|
||||
@@ -81,28 +82,6 @@ export default defineComponent({
|
||||
const $q = useQuasar()
|
||||
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 slide = ref(0)
|
||||
@@ -243,6 +222,7 @@ export default defineComponent({
|
||||
function modifElem() {
|
||||
disableSave.value = false
|
||||
elemChanged.value = true
|
||||
|
||||
}
|
||||
function modifElemAndSchede() {
|
||||
modifElem()
|
||||
@@ -276,19 +256,42 @@ export default defineComponent({
|
||||
|
||||
if (myel.value.catalogo && myel.value.catalogo?.arrSchede) {
|
||||
for (const recscheda of myel.value.catalogo?.arrSchede) {
|
||||
if (recscheda.scheda && (!recscheda.scheda?.testo_bottom)) {
|
||||
if (recscheda.scheda) {
|
||||
if ((!recscheda.scheda?.testo_bottom)) {
|
||||
recscheda.scheda.testo_bottom = { contenuto: '', maxlength: 100 }
|
||||
}
|
||||
if (recscheda.scheda && !recscheda.scheda.testo_bottom!.font) {
|
||||
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) ) {
|
||||
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)) {
|
||||
if ((!recscheda.scheda?.dimensioni.pagina.dimensioni)) {
|
||||
recscheda.scheda.dimensioni.pagina = tools.resetRecIPagina(recscheda.scheda?.dimensioni.pagina)
|
||||
}
|
||||
if (!recscheda.scheda?.dimensioni?.pagina?.testo_up) {
|
||||
recscheda.scheda!.dimensioni.pagina.testo_up = tools.resetIText(null)
|
||||
}
|
||||
if (!recscheda.scheda?.dimensioni?.pagina?.testo_down) {
|
||||
recscheda.scheda!.dimensioni.pagina.testo_down = tools.resetIText(null)
|
||||
}
|
||||
|
||||
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: '',
|
||||
@@ -305,6 +308,7 @@ export default defineComponent({
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (myel.value.catalogo) {
|
||||
if (!myel.value.catalogo.first_page) {
|
||||
@@ -449,15 +453,19 @@ export default defineComponent({
|
||||
show_separatore: true,
|
||||
name: 'Scheda Nuova',
|
||||
dimensioni,
|
||||
line_height: 100,
|
||||
numschede_perRiga: 2,
|
||||
numschede_perCol: 2,
|
||||
posiz_text: costanti.POSIZ_TESTO.A_DESTRA,
|
||||
testo_right: {
|
||||
contenuto: '',
|
||||
font: {
|
||||
posiz_text: costanti.POSIZ_TESTO.A_DESTRA,
|
||||
},
|
||||
},
|
||||
testo_bottom: {
|
||||
contenuto: '',
|
||||
font: {
|
||||
posiz_text: costanti.POSIZ_TESTO.IN_BASSO,
|
||||
}
|
||||
},
|
||||
barcode: {
|
||||
show: false,
|
||||
@@ -487,7 +495,7 @@ export default defineComponent({
|
||||
_id: objectId(),
|
||||
scheda: newscheda,
|
||||
order: maxorder + 10,
|
||||
numSchede: 1,
|
||||
numPagineMax: 0,
|
||||
}
|
||||
)
|
||||
// console.log('arrschede', myel.value.catalogo!.arrSchede)
|
||||
@@ -540,6 +548,7 @@ export default defineComponent({
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function dupNewScheda(id: string) {
|
||||
if (!myel.value.catalogo!.arrSchede)
|
||||
return
|
||||
@@ -550,7 +559,7 @@ export default defineComponent({
|
||||
let myscheda = tools.jsonCopy(myfindscheda)
|
||||
delete myscheda._id
|
||||
delete myscheda.scheda!._id
|
||||
myscheda.numSchede = 1
|
||||
myscheda.numPagineMax = 0
|
||||
myscheda.order = myscheda.order + 10,
|
||||
myscheda._id = objectId()
|
||||
myscheda.scheda!._id = objectId()
|
||||
@@ -759,6 +768,8 @@ export default defineComponent({
|
||||
|
||||
let arr: any = []
|
||||
|
||||
arr.push({ label: '[Nessuna]', value: '' })
|
||||
|
||||
if (arrschede) {
|
||||
arrschede.forEach((recscheda: ISchedaSingola) => {
|
||||
arr.push({ label: recscheda.scheda!.name, value: recscheda.scheda!._id })
|
||||
@@ -933,15 +944,12 @@ export default defineComponent({
|
||||
saveFieldElem,
|
||||
updateCatalogoSizeWidth,
|
||||
dupPage,
|
||||
posizTextOptions,
|
||||
tabScheda,
|
||||
addNewScheda,
|
||||
dupNewScheda,
|
||||
delRecScheda,
|
||||
SchedeOpt,
|
||||
addProdSpeciale,
|
||||
formatOptions,
|
||||
fontSizeOptions,
|
||||
idSchedaDaCopiare,
|
||||
copyfromTemplate,
|
||||
modifElemAndSchede,
|
||||
|
||||
@@ -1343,7 +1343,7 @@
|
||||
label="Selezione Collane/Editori"
|
||||
icon="fas fa-play-circle"
|
||||
>
|
||||
<div class="row">
|
||||
<div class="column">
|
||||
<q-toggle
|
||||
v-model="myel.catalogo.pdf"
|
||||
color="positive"
|
||||
@@ -1354,7 +1354,6 @@
|
||||
</q-toggle>
|
||||
|
||||
<q-input
|
||||
dense
|
||||
label="NomeFile PDF"
|
||||
@update:model-value="modifElem"
|
||||
v-model="myel.catalogo.pdf_filename"
|
||||
@@ -1366,6 +1365,21 @@
|
||||
<br />
|
||||
|
||||
<!--++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
|
||||
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
|
||||
v-if="
|
||||
@@ -1377,9 +1391,8 @@
|
||||
:options="shared_consts.VERSIONI_PRODOTTO"
|
||||
@update:model-value="modifElem"
|
||||
multiple
|
||||
dense
|
||||
label="Includi"
|
||||
style="width: 150px"
|
||||
style="width: 300px"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
@@ -1398,9 +1411,8 @@
|
||||
:options="shared_consts.VERSIONI_PRODOTTO"
|
||||
@update:model-value="modifElem"
|
||||
multiple
|
||||
dense
|
||||
label="Escludi"
|
||||
style="width: 150px"
|
||||
style="width: 300px"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
@@ -1414,9 +1426,8 @@
|
||||
:options="Products.publishers"
|
||||
@update:model-value="modifElem"
|
||||
multiple
|
||||
dense
|
||||
label="Editori"
|
||||
style="width: 150px"
|
||||
style="width: 300px"
|
||||
emit-value
|
||||
map-options
|
||||
option-value="_id"
|
||||
@@ -1439,6 +1450,7 @@
|
||||
<CMyDimensioni
|
||||
v-model="myel.catalogo.dimensioni_def.pagina"
|
||||
:path="costanti.DIR_CATALOGO"
|
||||
@modifElem="modifElem"
|
||||
:show_imgsfondo="true"
|
||||
@update:model-value="modifElem"
|
||||
></CMyDimensioni>
|
||||
@@ -1536,7 +1548,6 @@
|
||||
>
|
||||
</q-toggle>
|
||||
<q-input
|
||||
dense
|
||||
label="Nome Template"
|
||||
@update:model-value="modifElem"
|
||||
v-model="recscheda.scheda.name"
|
||||
@@ -1545,6 +1556,24 @@
|
||||
>
|
||||
</q-input>
|
||||
|
||||
<div class="row">
|
||||
<q-select
|
||||
:behavior="
|
||||
$q.platform.is.ios === true ? 'dialog' : 'menu'
|
||||
"
|
||||
v-if="enableEdit"
|
||||
rounded
|
||||
outlined
|
||||
v-model="recscheda.scheda.linkIdTemplate"
|
||||
:options="SchedeOpt()"
|
||||
@update:model-value="modifElem"
|
||||
label="Scheda collegata:"
|
||||
style="width: 150px"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
</q-select>
|
||||
<br />
|
||||
<div class="row">
|
||||
<q-select
|
||||
:behavior="
|
||||
@@ -1556,7 +1585,6 @@
|
||||
v-model="idSchedaDaCopiare"
|
||||
:options="SchedeOpt()"
|
||||
@update:model-value="modifElem"
|
||||
dense
|
||||
label="Scegli Scheda"
|
||||
style="width: 150px"
|
||||
emit-value
|
||||
@@ -1566,17 +1594,17 @@
|
||||
<q-btn
|
||||
icon="far fa-copy"
|
||||
label="Copia da Template"
|
||||
dense
|
||||
:disable="!idSchedaDaCopiare"
|
||||
color="primary"
|
||||
@click="copyfromTemplate(ind)"
|
||||
>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<CMySlider
|
||||
label="Schede da ripetere"
|
||||
v-model="recscheda.numSchede"
|
||||
label="Pagine max da visualizzare"
|
||||
v-model="recscheda.numPagineMax"
|
||||
:min="1"
|
||||
:max="100"
|
||||
color="green"
|
||||
@@ -1588,9 +1616,26 @@
|
||||
dense-toggle
|
||||
expand-separator
|
||||
label="Filtri"
|
||||
:disabled="recscheda.scheda.linkIdTemplate"
|
||||
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
|
||||
:behavior="
|
||||
$q.platform.is.ios === true ? 'dialog' : 'menu'
|
||||
@@ -1606,9 +1651,8 @@
|
||||
:options="shared_consts.VERSIONI_PRODOTTO"
|
||||
@update:model-value="modifElem"
|
||||
multiple
|
||||
dense
|
||||
label="Includi"
|
||||
style="width: 150px"
|
||||
style="width: 300px"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
@@ -1628,9 +1672,8 @@
|
||||
:options="shared_consts.VERSIONI_PRODOTTO"
|
||||
@update:model-value="modifElem"
|
||||
multiple
|
||||
dense
|
||||
label="Escludi"
|
||||
style="width: 150px"
|
||||
style="width: 300px"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
@@ -1646,9 +1689,8 @@
|
||||
:options="Products.publishers"
|
||||
@update:model-value="modifElem"
|
||||
multiple
|
||||
dense
|
||||
label="Editori"
|
||||
style="width: 150px"
|
||||
style="width: 300px"
|
||||
emit-value
|
||||
map-options
|
||||
option-value="_id"
|
||||
@@ -1670,7 +1712,6 @@
|
||||
filled
|
||||
use-input
|
||||
new-value-mode="add-unique"
|
||||
dense
|
||||
style="width: 350px"
|
||||
/>
|
||||
</div>
|
||||
@@ -1681,14 +1722,36 @@
|
||||
dense-toggle
|
||||
expand-separator
|
||||
label="Pagina"
|
||||
:disabled="recscheda.scheda.linkIdTemplate"
|
||||
icon="fas fa-play-circle"
|
||||
>
|
||||
<CMyDimensioni
|
||||
v-model="recscheda.scheda.dimensioni.pagina"
|
||||
v-model="
|
||||
recscheda.scheda.dimensioni.pagina.dimensioni
|
||||
"
|
||||
:path="costanti.DIR_SCHEDA"
|
||||
@modifElem="modifElem"
|
||||
:show_imgsfondo="true"
|
||||
@update:model-value="modifElem"
|
||||
></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
|
||||
@@ -1696,11 +1759,13 @@
|
||||
dense-toggle
|
||||
expand-separator
|
||||
label="Righe"
|
||||
:disabled="recscheda.scheda.linkIdTemplate"
|
||||
icon="fas fa-play-circle"
|
||||
>
|
||||
<CMyDimensioni
|
||||
v-model="recscheda.scheda.dimensioni.riga"
|
||||
:path="costanti.DIR_SCHEDA"
|
||||
@modifElem="modifElem"
|
||||
:show_imgsfondo="false"
|
||||
@update:model-value="modifElem"
|
||||
></CMyDimensioni>
|
||||
@@ -1711,6 +1776,7 @@
|
||||
dense-toggle
|
||||
expand-separator
|
||||
label="Schede"
|
||||
:disabled="recscheda.scheda.linkIdTemplate"
|
||||
icon="fas fa-play-circle"
|
||||
>
|
||||
<q-toggle
|
||||
@@ -1758,6 +1824,7 @@
|
||||
|
||||
<CMySize
|
||||
label="Immagini:"
|
||||
:fit="true"
|
||||
v-model="
|
||||
recscheda.scheda.dimensioni.immagine_prodotto.size
|
||||
"
|
||||
@@ -1771,93 +1838,26 @@
|
||||
dense-toggle
|
||||
expand-separator
|
||||
label="Testo"
|
||||
:disabled="recscheda.scheda.linkIdTemplate"
|
||||
icon="fas fa-play-circle"
|
||||
>
|
||||
<q-select
|
||||
v-model="recscheda.scheda.posiz_text"
|
||||
:options="posizTextOptions"
|
||||
label="Posizione"
|
||||
options-dense
|
||||
dense
|
||||
emit-value
|
||||
map-options
|
||||
style="width: 100px"
|
||||
<CMyText
|
||||
v-model="recscheda.scheda.testo_right"
|
||||
@modifElem="modifElem"
|
||||
@saveFieldElem="saveFieldElem"
|
||||
@update:model-value="modifElem"
|
||||
fill-input
|
||||
text-color="white"
|
||||
label="Testo a Destra"
|
||||
>
|
||||
</q-select>
|
||||
<CMySlider
|
||||
label="Line Height:"
|
||||
v-model="recscheda.scheda.line_height"
|
||||
:min="0.5"
|
||||
:max="2"
|
||||
color="blue"
|
||||
@update:model-value="modifElem"
|
||||
></CMySlider>
|
||||
</CMyText>
|
||||
|
||||
<div>
|
||||
Parole Chiave: {autore} {titolo} {descrizione}
|
||||
{descrizione_estesa} {prezzo}
|
||||
</div>
|
||||
|
||||
<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"
|
||||
<CMyText
|
||||
v-model="recscheda.scheda.testo_bottom"
|
||||
@modifElem="modifElem"
|
||||
@saveFieldElem="saveFieldElem"
|
||||
@update:model-value="modifElem"
|
||||
fill-input
|
||||
text-color="white"
|
||||
label="Testo in Basso"
|
||||
>
|
||||
</q-select>
|
||||
|
||||
<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>
|
||||
</CMyText>
|
||||
</q-expansion-item>
|
||||
|
||||
<q-expansion-item
|
||||
@@ -1865,6 +1865,7 @@
|
||||
dense-toggle
|
||||
expand-separator
|
||||
label="Codice a Barre"
|
||||
:disabled="recscheda.scheda.linkIdTemplate"
|
||||
icon="fas fa-play-circle"
|
||||
>
|
||||
<q-toggle
|
||||
@@ -1877,7 +1878,7 @@
|
||||
</q-toggle>
|
||||
<q-select
|
||||
v-model="recscheda.scheda.barcode.format"
|
||||
:options="formatOptions"
|
||||
:options="tools.formatOptions"
|
||||
label="Formato"
|
||||
options-dense
|
||||
dense
|
||||
@@ -1914,6 +1915,49 @@
|
||||
:addstr="false"
|
||||
></CMySize>
|
||||
</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>
|
||||
</q-tab-panel>
|
||||
</q-tab-panels>
|
||||
@@ -1928,14 +1972,22 @@
|
||||
label="Prima Pagina"
|
||||
icon="fas fa-play-circle"
|
||||
>
|
||||
Prima Pagina: <br />
|
||||
<div class="row">
|
||||
<CMyDimensioni
|
||||
:path="costanti.DIR_CATALOGO"
|
||||
v-model="myel.catalogo.first_page"
|
||||
@modifElem="modifElem"
|
||||
:show_imgsfondo="true"
|
||||
@update:model-value="modifElem"
|
||||
></CMyDimensioni>
|
||||
<CMyText
|
||||
v-model="myel.catalogo.first_page.text_html"
|
||||
@modifElem="modifElem"
|
||||
@saveFieldElem="saveFieldElem"
|
||||
@update:model-value="modifElem"
|
||||
label="Testo"
|
||||
>
|
||||
</CMyText>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
@@ -1948,12 +2000,23 @@
|
||||
label="Ultima Pagina"
|
||||
icon="fas fa-play-circle"
|
||||
>
|
||||
<div class="row">
|
||||
<CMyDimensioni
|
||||
:path="costanti.DIR_CATALOGO"
|
||||
v-model="myel.catalogo.last_page"
|
||||
@modifElem="modifElem"
|
||||
: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>
|
||||
<div v-if="enableEdit">
|
||||
<q-expansion-item
|
||||
|
||||
@@ -12,7 +12,7 @@ import MixinBase from '@/mixins/mixin-base'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CMyFieldRec',
|
||||
emits: ['save', 'update:rec'],
|
||||
emits: ['save', 'update:rec', 'update_col'],
|
||||
props: {
|
||||
table: {
|
||||
type: String,
|
||||
@@ -177,6 +177,7 @@ export default defineComponent({
|
||||
|
||||
}
|
||||
|
||||
|
||||
function showandsave(row: any, col: any, newval: any, valinitial: any) {
|
||||
console.log('showandsave CMyFieldDb', row, col, newval)
|
||||
emit('save', props.rec, newval, col)
|
||||
@@ -238,6 +239,8 @@ export default defineComponent({
|
||||
function update_col(name: string, val: any) {
|
||||
// console.log('update_col', name, val)
|
||||
myrec.value[name] = val
|
||||
|
||||
emit('update_col', name, val)
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
@@ -21,6 +21,8 @@ export default defineComponent({
|
||||
default: () => ({
|
||||
width: '',
|
||||
height: '',
|
||||
gap: '',
|
||||
fit: '',
|
||||
}),
|
||||
},
|
||||
label: {
|
||||
@@ -37,6 +39,11 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
fit: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
addstr: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
@@ -75,6 +82,9 @@ export default defineComponent({
|
||||
function modifValueGap(value: any) {
|
||||
emit('update:modelValue', { ...internalModel, gap: value });
|
||||
}
|
||||
function modifValueFit(value: any) {
|
||||
emit('update:modelValue', { ...internalModel, fit: value });
|
||||
}
|
||||
|
||||
function modifValueRatio(value: any) {
|
||||
// modifValueWidth(0)
|
||||
@@ -104,8 +114,10 @@ export default defineComponent({
|
||||
modifValueHeight,
|
||||
modifValueRatio,
|
||||
modifValueGap,
|
||||
modifValueFit,
|
||||
internalModel,
|
||||
ratio,
|
||||
tools,
|
||||
keepRatio,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +57,21 @@
|
||||
addstr="px"
|
||||
@update:model-value="modifValueGap"
|
||||
></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>
|
||||
</template>
|
||||
|
||||
0
src/components/CMyText/CMyText.scss
Executable file
0
src/components/CMyText/CMyText.scss
Executable file
79
src/components/CMyText/CMyText.ts
Executable file
79
src/components/CMyText/CMyText.ts
Executable 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,
|
||||
}
|
||||
}
|
||||
})
|
||||
83
src/components/CMyText/CMyText.vue
Executable file
83
src/components/CMyText/CMyText.vue
Executable 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>
|
||||
1
src/components/CMyText/index.ts
Executable file
1
src/components/CMyText/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export {default as CMyText} from './CMyText.vue'
|
||||
@@ -688,10 +688,14 @@ export interface ISize {
|
||||
width?: string
|
||||
height?: string
|
||||
gap?: string
|
||||
fit?: string
|
||||
}
|
||||
export interface IFont {
|
||||
name?: string
|
||||
size?: string
|
||||
line_height?: number
|
||||
posiz_text?: number
|
||||
perc_text?: string
|
||||
}
|
||||
|
||||
export interface IBorder {
|
||||
@@ -706,6 +710,21 @@ export interface IImg {
|
||||
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 {
|
||||
show?: boolean
|
||||
format?: string
|
||||
@@ -714,6 +733,12 @@ export interface IBarCode {
|
||||
widthlines?: number
|
||||
}
|
||||
|
||||
export interface IPagina {
|
||||
dimensioni?: IDimensioni
|
||||
testo_up?: IText
|
||||
testo_down?: IText
|
||||
}
|
||||
|
||||
export interface IDimensioni {
|
||||
size?: ISize
|
||||
margini?: IBorder
|
||||
@@ -743,7 +768,7 @@ export interface IText {
|
||||
}
|
||||
|
||||
export interface IElementiScheda {
|
||||
pagina: IDimensioni
|
||||
pagina: IPagina
|
||||
riga: IDimensioni
|
||||
scheda_prodotto: IDimensioni
|
||||
immagine_prodotto: IDimensioni
|
||||
@@ -753,15 +778,15 @@ export interface IMyScheda {
|
||||
_id?: string,
|
||||
idapp?: string,
|
||||
isTemplate?: boolean,
|
||||
linkIdTemplate?: string,
|
||||
name?: string,
|
||||
line_height?: number
|
||||
numschede_perRiga?: number
|
||||
numschede_perCol?: number
|
||||
show_separatore: boolean
|
||||
testo_right?: IText
|
||||
testo_bottom?: IText
|
||||
posiz_text?: number
|
||||
barcode?: IBarCode,
|
||||
etichette?: IEtichette,
|
||||
dimensioni: IElementiScheda
|
||||
|
||||
productTypes?: number[]
|
||||
@@ -777,7 +802,7 @@ export interface ISchedaSingola {
|
||||
_id?: string
|
||||
scheda?: IMyScheda,
|
||||
order?: number,
|
||||
numSchede?: number,
|
||||
numPagineMax?: number,
|
||||
|
||||
// In Memoria
|
||||
arrProdToShow?: IProduct[][][]
|
||||
@@ -785,12 +810,13 @@ export interface ISchedaSingola {
|
||||
|
||||
export interface ICatalogo {
|
||||
//++AddCATALOGO_FIELDS
|
||||
productTypes: number[]
|
||||
excludeproductTypes: number[]
|
||||
formato: string[]
|
||||
Categoria: string[]
|
||||
Editore: string[]
|
||||
pdf: boolean
|
||||
productTypes?: number[]
|
||||
excludeproductTypes?: number[]
|
||||
formato?: string[]
|
||||
Categoria?: string[]
|
||||
Editore?: string[]
|
||||
sort?: number
|
||||
pdf?: boolean
|
||||
pdf_filename?: string
|
||||
printable?: boolean
|
||||
|
||||
|
||||
@@ -42,6 +42,21 @@ export interface IProductInfo {
|
||||
productTypes?: number[]
|
||||
versioneGM?: 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 {
|
||||
@@ -76,6 +91,7 @@ export interface IProdView {
|
||||
|
||||
export interface IProduct {
|
||||
_id?: any
|
||||
indiceRanking?: number
|
||||
active?: boolean
|
||||
isbn?: string
|
||||
idProductInfo?: string,
|
||||
|
||||
@@ -79,9 +79,17 @@ export default defineComponent({
|
||||
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
|
||||
},
|
||||
{
|
||||
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);
|
||||
} else if (cmd === shared_consts.Cmd.CAT_NO_SPAZI) {
|
||||
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);
|
||||
} 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) {
|
||||
@@ -401,7 +418,7 @@ export default defineComponent({
|
||||
|
||||
if (cmd === shared_consts.Cmd.PRODUCTS_V2) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -433,8 +450,6 @@ export default defineComponent({
|
||||
strris += ' istat:\'' + tools.addslashes(rec[0]) + '\','
|
||||
strris += ' comune:\'' + tools.addslashes(rec[1]) + '\','
|
||||
strris += ' prov:\'' + tools.addslashes(rec[2]) + '\''
|
||||
|
||||
|
||||
} else if (cmd === shared_consts.Cmd.PRODUCTS) {
|
||||
if (!primo) {
|
||||
strris += ', '
|
||||
|
||||
@@ -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.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_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>
|
||||
<br>
|
||||
<q-btn label="Genera HTML Province Territoriali" @click="createProvLink"></q-btn>
|
||||
@@ -28,7 +30,7 @@
|
||||
|
||||
<div>{{ risraw }}</div>
|
||||
|
||||
<div v-html="risultato.substring(0, 1000)"></div>
|
||||
<div v-if="risultato" v-html="risultato.substring(0, 1000)"></div>
|
||||
<br>
|
||||
<br>
|
||||
</div>
|
||||
|
||||
@@ -500,19 +500,8 @@ export const costanti = {
|
||||
TESTO_BORDATO: 5,
|
||||
},
|
||||
|
||||
SORT_ALPHA: 0,
|
||||
SORT_DEFAULT: 0,
|
||||
SORT_PUBDATE: 1,
|
||||
|
||||
|
||||
ORDINAMENTO_CATALOGHI: [
|
||||
{
|
||||
label: 'Data di Uscita',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: 'Alfabetico',
|
||||
value: 0,
|
||||
},
|
||||
],
|
||||
SORT_BESTSELLER: 2,
|
||||
|
||||
}
|
||||
|
||||
@@ -161,6 +161,9 @@ export const colISize = [
|
||||
export const colIText = [
|
||||
AddCol({ name: 'contenuto', label_trans: 'catalogo.contenuto', fieldtype: costanti.FieldType.html }),
|
||||
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 = [
|
||||
AddCol({ name: 'imagefile', label_trans: 'iimg.imagefile', fieldtype: costanti.FieldType.image }),
|
||||
@@ -170,6 +173,7 @@ export const colmyIImg = [
|
||||
export const colmyScheda = [
|
||||
AddCol({ name: 'name', label_trans: 'scheda.name', fieldtype: costanti.FieldType.string }),
|
||||
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: 'widthpag', label_trans: 'scheda.widthpag', 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_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: '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: 'excludeproductTypes', label_trans: 'excludeproductTypes', fieldtype: costanti.FieldType.number }),
|
||||
|
||||
@@ -22,6 +22,7 @@ import {
|
||||
IText,
|
||||
IAreaDiStampa,
|
||||
ICatalogo,
|
||||
IPagina,
|
||||
} from '@model'
|
||||
|
||||
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: [
|
||||
{ label: 'a4 (mm)', value: [210, 297] },
|
||||
{ label: '22,60 x 31,26 (in mm)', value: [226.0, 312.6] },
|
||||
@@ -9223,6 +9249,23 @@ export const tools = {
|
||||
|
||||
rec.contenuto = ''
|
||||
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
|
||||
@@ -9253,6 +9296,35 @@ export const tools = {
|
||||
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) {
|
||||
|
||||
let myrec: IAreaDiStampa = {}
|
||||
@@ -9316,7 +9388,56 @@ export const tools = {
|
||||
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 !
|
||||
|
||||
// getLocale() {
|
||||
|
||||
@@ -1277,6 +1277,10 @@ export const useProducts = defineStore('Products', {
|
||||
const maxDescriptionLength = testo.maxlength ?? 100;
|
||||
const description = myproduct.productInfo.short_descr || '';
|
||||
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
|
||||
? 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;
|
||||
|
||||
|
||||
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_scontato = myproduct.arrvariazioni ? myproduct.arrvariazioni[0].sale_price?.toFixed(2) : ''
|
||||
const misure = myproduct.arrvariazioni ? myproduct.arrvariazioni[0].misure : ''
|
||||
@@ -1301,10 +1319,18 @@ export const useProducts = defineStore('Products', {
|
||||
'{descrizione_estesa}': truncatedlongDescription || '',
|
||||
'{pagine}': pagine || '',
|
||||
'{misure}': misure || '',
|
||||
'{date_pub}': date_pub || '',
|
||||
'{ranking_globale}': ranking_globale || '',
|
||||
'{ranking}': ranking || '',
|
||||
'{venduti}': venduti || '',
|
||||
'{formato}': formato || '',
|
||||
'{prezzo}': prezzo || '',
|
||||
'{scale}': scale || '',
|
||||
'{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
|
||||
|
||||
@@ -85,8 +85,28 @@ body {
|
||||
font-family: 'DINPro-BoldItalic', sans-serif;
|
||||
}
|
||||
|
||||
|
||||
.book-details {
|
||||
font-family: 'DINPro', sans-serif;
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import { CProductCard } from '@src/components/CProductCard'
|
||||
import { CMySelect } from '@src/components/CMySelect'
|
||||
import { CContainerCatalogoCard } from '@src/components/CContainerCatalogoCard'
|
||||
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 html2pdf from 'html2pdf.js'
|
||||
@@ -192,7 +192,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function calcArrProducts() {
|
||||
// console.log('calcArrProducts')
|
||||
console.log('calcArrProducts')
|
||||
|
||||
// eventuali titoli specifici estratti dall'array di Prodotti Selezionati
|
||||
//const searchtext = getSearchText()
|
||||
@@ -270,20 +270,12 @@ export default defineComponent({
|
||||
});
|
||||
}
|
||||
|
||||
// console.log('filter.value.sort', 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) {
|
||||
|
||||
}
|
||||
arrprod = getProductsSorted(arrprod, filter.value.sort);
|
||||
|
||||
arrProducts.value = arrprod
|
||||
|
||||
populateDataWithlinkIdTemplate()
|
||||
|
||||
generatearrProdToViewSorted()
|
||||
|
||||
loaddata()
|
||||
@@ -291,7 +283,55 @@ export default defineComponent({
|
||||
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
|
||||
|
||||
@@ -346,7 +386,7 @@ export default defineComponent({
|
||||
|
||||
if (!boolfiltroVuotoProductTypes) {
|
||||
// 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) {
|
||||
hasPublished = !scheda.editore || (scheda.editore && scheda.editore.includes(product.productInfo.idPublisher!))
|
||||
@@ -354,7 +394,7 @@ export default defineComponent({
|
||||
|
||||
if (!boolfiltroVuotoExcludeProductTypes) {
|
||||
// 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;
|
||||
@@ -364,15 +404,35 @@ export default defineComponent({
|
||||
}
|
||||
})
|
||||
|
||||
// console.log('filter.value.sort', filter.value.sort)
|
||||
// sort using filter.value.sort :
|
||||
if (scheda.sort === costanti.SORT_PUBDATE) {
|
||||
arrprod = getProductsSorted(arrprod, scheda?.sort!);
|
||||
|
||||
return arrprod
|
||||
|
||||
}
|
||||
|
||||
function getProductsSorted(arrprod: IProduct[], sort: number) {
|
||||
console.log('getProductsSorted', sort)
|
||||
if (sort === costanti.SORT_PUBDATE) {
|
||||
|
||||
arrprod = arrprod.sort((a: IProduct, b: IProduct) => {
|
||||
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() {
|
||||
// console.log('generatearrProdToViewSorted')
|
||||
console.log('generatearrProdToViewSorted', arrProducts.value)
|
||||
|
||||
// Svuota
|
||||
arrProdToView.value = []
|
||||
|
||||
// gia filtrati
|
||||
const arrGeneraleProdotti = arrProducts.value;
|
||||
|
||||
let indprod = 0
|
||||
let indprodGenerale = 0
|
||||
|
||||
for (const recscheda of props.optcatalogo.arrSchede!) {
|
||||
if (recscheda && recscheda.scheda) {
|
||||
let schedePerRiga = recscheda.scheda.numschede_perRiga || 1
|
||||
let schedePerCol = recscheda.scheda.numschede_perCol || 1
|
||||
let schedePerPagina = schedePerRiga * schedePerCol
|
||||
|
||||
let arrProdFiltrati: IProduct[] = []
|
||||
|
||||
if (recscheda.scheda.productTypes!.length > 0) {
|
||||
// Filtra i prodotti in base ai filtri impostati !
|
||||
const arrProdFiltrati = getProductsFilteredByScheda(recscheda.scheda)
|
||||
let indprod = 0
|
||||
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
|
||||
recscheda.arrProdToShow = []
|
||||
|
||||
@@ -463,17 +546,27 @@ export default defineComponent({
|
||||
recscheda.arrProdToShow[pagina][riga] = [];
|
||||
}
|
||||
|
||||
console.log('RANKING: ', result.myrec.indiceRanking!)
|
||||
|
||||
recscheda.arrProdToShow[pagina][riga][col] = result.myrec
|
||||
|
||||
indadded++
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (recscheda.numPagineMax! > 0) {
|
||||
if (pagina + 1 >= recscheda.numPagineMax!)
|
||||
break; // fine pagine
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// console.log('*** arrProdToShow', recscheda.arrProdToShow)
|
||||
}
|
||||
}
|
||||
|
||||
console.log('Fine...')
|
||||
}
|
||||
|
||||
function getNextProd() {
|
||||
@@ -720,51 +813,8 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function groupedPages(recscheda: ISchedaSingola) {
|
||||
|
||||
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++
|
||||
return recscheda.arrProdToShow
|
||||
}
|
||||
|
||||
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) {
|
||||
|
||||
return {
|
||||
@@ -773,19 +823,19 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
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 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 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 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 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?.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?.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?.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 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 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 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 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?.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?.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?.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 ?
|
||||
let fileimg = scheda.dimensioni?.pagina?.imgsfondo?.imagefile
|
||||
let backgroundSize = scheda.dimensioni?.pagina?.imgsfondo?.fit
|
||||
let fileimg = scheda.dimensioni?.pagina?.dimensioni?.imgsfondo?.imagefile
|
||||
let backgroundSize = scheda.dimensioni?.pagina?.dimensioni?.imgsfondo?.fit
|
||||
if (fileimg) {
|
||||
fileimg = fileimg ? `url(${costanti.DIR_UPLOAD + costanti.DIR_SCHEDA + fileimg})` : ''
|
||||
}
|
||||
@@ -799,8 +849,56 @@ export default defineComponent({
|
||||
|
||||
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 height = scheda.dimensioni?.pagina?.size?.height ? tools.adjustSize(optcatalogo, scheda.dimensioni?.pagina?.size?.height) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.size?.height) ?? '')
|
||||
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?.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 {
|
||||
marginBottom,
|
||||
@@ -821,10 +919,10 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
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) {
|
||||
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) {
|
||||
@@ -938,6 +1036,7 @@ export default defineComponent({
|
||||
getWidthPagina,
|
||||
getHeightPagina,
|
||||
getStyleRowSeparator,
|
||||
generateStyleByPageDim,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -48,9 +48,7 @@
|
||||
</q-tabs>
|
||||
<q-tab-panels v-model="tabvisu" animated class="">
|
||||
<q-tab-panel name="categorie">
|
||||
<div
|
||||
class="row justify-center q-mx-auto bg-blue-1"
|
||||
>
|
||||
<div class="row justify-center q-mx-auto bg-blue-1">
|
||||
<div v-for="(reccat, index) in getCatProds()" :key="index">
|
||||
<span
|
||||
:class="{
|
||||
@@ -168,7 +166,7 @@
|
||||
<q-select
|
||||
v-model="filter.sort"
|
||||
dense
|
||||
:options="costanti.ORDINAMENTO_CATALOGHI"
|
||||
:options="shared_consts.ORDINAMENTO_CATALOGHI"
|
||||
label="Ordinamento"
|
||||
placeholder=""
|
||||
emit-value
|
||||
@@ -209,32 +207,16 @@
|
||||
<div
|
||||
v-if="
|
||||
optcatalogo.first_page &&
|
||||
optcatalogo.first_page.text_html &&
|
||||
optcatalogo.first_page.text_html.contenuto
|
||||
"
|
||||
:style="{
|
||||
backgroundImage: `url(${
|
||||
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',
|
||||
}"
|
||||
:style="
|
||||
generateStyleByPageDim(optcatalogo, optcatalogo.first_page)
|
||||
"
|
||||
>
|
||||
<div
|
||||
v-html="optcatalogo.first_page.text_html.contenuto"
|
||||
></div>
|
||||
\
|
||||
</div>
|
||||
<div :style="generateStyleCatalogo(optcatalogo)">
|
||||
<div class="flex-container-book">
|
||||
@@ -250,10 +232,7 @@
|
||||
class="row items-start"
|
||||
style="place-content: center"
|
||||
>
|
||||
<div
|
||||
v-for="(product, index) in arrLoaded"
|
||||
:key="index"
|
||||
>
|
||||
<div v-for="(product, index) in arrLoaded" :key="index">
|
||||
<CContainerCatalogoCard
|
||||
v-if="
|
||||
product.active ||
|
||||
@@ -263,6 +242,7 @@
|
||||
))
|
||||
"
|
||||
:id="product._id"
|
||||
:product="product"
|
||||
:complete="false"
|
||||
:cosa="cosa"
|
||||
:optcatalogo="optcatalogo"
|
||||
@@ -278,6 +258,7 @@
|
||||
<CProductCard
|
||||
v-else-if="product.active || show_hide"
|
||||
:id="product._id"
|
||||
:product="product"
|
||||
:complete="false"
|
||||
: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 -->
|
||||
<div
|
||||
v-for="(row, rowIndex) in page"
|
||||
@@ -333,34 +338,15 @@
|
||||
|
||||
<div class="row justify-center">
|
||||
<div
|
||||
v-for="(indprod, colIndex) in row"
|
||||
v-for="(prod, colIndex) in row"
|
||||
:key="`${pageIndex}-${rowIndex}-${colIndex}`"
|
||||
class="flex-item-book"
|
||||
:style="getStyleSchedaProdotto(recscheda)"
|
||||
>
|
||||
<CContainerCatalogoCard
|
||||
v-if="
|
||||
getProdBySchedaRigaCol(
|
||||
recscheda,
|
||||
pageIndex,
|
||||
rowIndex,
|
||||
colIndex
|
||||
) &&
|
||||
getProdBySchedaRigaCol(
|
||||
recscheda,
|
||||
pageIndex,
|
||||
rowIndex,
|
||||
colIndex
|
||||
).active
|
||||
"
|
||||
:id="
|
||||
getProdBySchedaRigaCol(
|
||||
recscheda,
|
||||
pageIndex,
|
||||
rowIndex,
|
||||
colIndex
|
||||
)._id
|
||||
"
|
||||
v-if="prod && prod.active"
|
||||
:id="prod._id"
|
||||
:product="prod"
|
||||
:complete="false"
|
||||
:cosa="cosa"
|
||||
:optcatalogo="optcatalogo"
|
||||
@@ -376,28 +362,9 @@
|
||||
/>
|
||||
<CProductCard
|
||||
v-else-if="
|
||||
getProdBySchedaRigaCol(
|
||||
recscheda,
|
||||
pageIndex,
|
||||
rowIndex,
|
||||
colIndex
|
||||
) &&
|
||||
(getProdBySchedaRigaCol(
|
||||
recscheda,
|
||||
pageIndex,
|
||||
rowIndex,
|
||||
colIndex
|
||||
).active ||
|
||||
show_hide)
|
||||
"
|
||||
:id="
|
||||
getProdBySchedaRigaCol(
|
||||
recscheda,
|
||||
pageIndex,
|
||||
rowIndex,
|
||||
colIndex
|
||||
)._id
|
||||
prod && (prod.active || show_hide)
|
||||
"
|
||||
:id="prod._id"
|
||||
:complete="false"
|
||||
:cosa="cosa"
|
||||
/>
|
||||
@@ -407,12 +374,17 @@
|
||||
|
||||
<!-- Separatore -->
|
||||
<div
|
||||
v-if="recscheda.scheda?.show_separatore && rowIndex !== page.length - 1"
|
||||
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>
|
||||
<q-separator
|
||||
inset
|
||||
:size="tools.adjustSize(optcatalogo, '1px')"
|
||||
></q-separator>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Card Row -->
|
||||
@@ -428,27 +400,12 @@
|
||||
<div
|
||||
v-if="
|
||||
optcatalogo.last_page &&
|
||||
optcatalogo.last_page.text_html &&
|
||||
optcatalogo.last_page.text_html.contenuto
|
||||
"
|
||||
:style="{
|
||||
backgroundImage: `url(${
|
||||
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',
|
||||
}"
|
||||
:style="
|
||||
generateStyleByPageDim(optcatalogo, optcatalogo.last_page)
|
||||
"
|
||||
>
|
||||
<div v-html="optcatalogo.last_page.text_html.contenuto"></div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user