- cataloghi...

- fix: condividi su Telegram non funzionava errore sull'immagine
This commit is contained in:
Surya Paolo
2024-11-02 18:06:27 +01:00
parent 2ea6468100
commit 1c63b5346b
91 changed files with 2105 additions and 306 deletions

View File

@@ -2,7 +2,7 @@ import {
defineComponent, onMounted, PropType, computed, ref, toRef, watch,
} from 'vue'
import { IColGridTable, IElemText, IImgGallery, ILabelValue, IMyCard, IMyElem, IMyPage, IMyScheda, IOperators, ISchedaSingola } from '@src/model'
import { IColGridTable, IElemText, IElementiScheda, IImgGallery, ILabelValue, IMyCard, IMyElem, IMyPage, IMyScheda, IOperators, ISchedaSingola } from '@src/model'
import { useGlobalStore } from '@store/globalStore'
import { CImgTitle } from '@/components/CImgTitle'
@@ -23,6 +23,8 @@ import { CSelectImage } from '@src/components/CSelectImage'
import { CSelectAnimation } from '@src/components/CSelectAnimation'
import { CSelectColor } from '@src/components/CSelectColor'
import { CSelectFontSize } from '@src/components/CSelectFontSize'
import { CMySize } from '@src/components/CMySize'
import { CBorders } from '@src/components/CBorders'
import MixinMetaTags from '@/mixins/mixin-metatags'
import MixinBase from '@/mixins/mixin-base'
@@ -38,7 +40,8 @@ export default defineComponent({
components: {
CImgTitle, CTitle, LandingFooter, CEventsCalendar,
CCardCarousel, COpenStreetMap, CMyPage, CMyPageIntro, CMyEditor, CMyFieldRec,
CSelectColor, CSelectFontSize, CSelectImage, CImgPoster, CSelectAnimation, CMySlider
CSelectColor, CSelectFontSize, CSelectImage, CImgPoster, CSelectAnimation, CMySlider,
CMySize, CBorders,
},
emits: ['saveElem', 'selElemClick', 'toggleSize', 'deleteElem', 'dupPage'],
props: {
@@ -269,21 +272,93 @@ export default defineComponent({
}
})
let defaultDimensioniPag = {
size: {
width: '800px',
height: '600px',
},
margini: {
top: '12px',
bottom: '0px',
left: '0px',
right: '0px',
},
padding: {
top: '0px',
bottom: '0px',
left: '0px',
right: '0px',
},
}
let defaultDimensioniRiga = {
size: {
width: '800px',
height: '300px',
},
margini: {
top: '40px',
bottom: '0px',
left: '0px',
right: '0px',
},
padding: {
top: '0px',
bottom: '0px',
left: '0px',
right: '0px',
},
}
let dimensioni: IElementiScheda = {
pagina: defaultDimensioniPag,
riga: defaultDimensioniRiga,
scheda_prodotto: {
size: {
width: '360px',
height: '230px',
},
margini: {
top: '0px',
bottom: '0px',
left: '0px',
right: '0px',
},
padding: {
top: '0px',
bottom: '0px',
left: '0px',
right: '0px',
},
},
immagine_prodotto: {size: {
width: '150px',
height: '235px',
},
margini: {
top: '0px',
bottom: '0px',
left: '0px',
right: '0px',
},
padding: {
top: '0px',
bottom: '0px',
left: '0px',
right: '0px',
},},
}
let newscheda: IMyScheda = {
_id: objectId(),
idapp: tools.appid()!,
isTemplate: false,
name: 'Scheda Nuova',
widthscheda: '360px',
dimensioni,
line_height: 100,
widthpag: 800,
width: 150,
height: 234,
numschede_perRiga: 2,
numschede_perCol: 2,
margine_top: 12,
margine_pagina: '92px',
margine_riga: '41px',
text: '',
posiz_text: costanti.POSIZ_TESTO.A_DESTRA,
@@ -301,13 +376,13 @@ export default defineComponent({
myel.value.catalogo!.arrSchede.push(
{
_id: objectId(),
scheda: { ...newscheda },
scheda: newscheda,
order: maxorder + 10,
numSchede: 1,
}
)
// console.log('arrschede', myel.value.catalogo!.arrSchede)
modifElem()
}
@@ -404,11 +479,14 @@ export default defineComponent({
//console.log('saveFieldElem', rec, 'newval', newval, 'col', col)
let iscatalogo = costanti.CATALOGO_FIELDS.includes(col.name)
let isscheda = costanti.SCHEDA_FIELDS.includes(col.name)
if (col.fieldtype === costanti.FieldType.image) {
if (iscatalogo) {
myel.value.catalogo[col.name] = newval.imagefile
//console.log('SALVATO IN', col.name, newval.imagefile, 'RIS', myel.value.catalogo[col.name])
} else if (isscheda) {
rec[col.name] = newval.imagefile
} else {
myel.value[col.name] = newval.imagefile
}
@@ -416,6 +494,8 @@ export default defineComponent({
if (iscatalogo) {
myel.value.catalogo[col.name] = newval
console.log('SALVATO IN', col.name, newval, 'RIS', myel.value.catalogo[col.name])
} else if (isscheda) {
rec[col.name] = newval
} else {
myel.value[col.name] = newval
}