PASSAGGIO A VITE !

AGG. 1.1.23
This commit is contained in:
Surya Paolo
2025-03-01 14:14:43 +01:00
parent f0098e57b2
commit bc960d38a1
1044 changed files with 5323 additions and 10823777 deletions

View File

@@ -1,17 +1,19 @@
import type { PropType } from 'vue';
import {
defineComponent, onMounted, PropType, computed, ref, toRef, watch,
defineComponent, onMounted, computed, ref, toRef, watch,
nextTick,
} from 'vue'
import { IOptCatalogo, IColGridTable, IElemText, IElementiScheda, IImgGallery, ILabelValue, IMyCard, IMyElem, IMyPage, IMyScheda, IOperators, ISchedaSingola } from '@src/model'
import type { IOptCatalogo, IColGridTable, IElemText, IElementiScheda, IMyCard, IMyElem, IMyScheda, ISchedaSingola, IText } from '@src/model';
import { IImgGallery, ILabelValue, IMyPage, IOperators } from '@src/model'
import { useGlobalStore } from '@store/globalStore'
import { CImgTitle } from '@/components/CImgTitle'
import { CImgPoster } from '@/components/CImgPoster'
import { CTitle } from '@/components/CTitle/index'
import { tools } from '@store/Modules/tools'
import { shared_consts } from '@/common/shared_vuejs'
import { LandingFooter } from '@/components/LandingFooter'
import { CImgTitle } from '@src/components/CImgTitle'
import { CImgPoster } from '@src/components/CImgPoster'
import { CTitle } from '@src/components/CTitle/index'
import { tools } from '@tools'
import { shared_consts } from '@src/common/shared_vuejs'
import { LandingFooter } from '@src/components/LandingFooter'
import { COpenStreetMap } from '@src/components/COpenStreetMap'
import { CCardCarousel } from '@src/components/CCardCarousel'
import { CMyPage } from '@src/components/CMyPage'
@@ -29,10 +31,10 @@ 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'
import MixinMetaTags from '@src/mixins/mixin-metatags'
import MixinBase from '@src/mixins/mixin-base'
import { useQuasar } from 'quasar'
import { useI18n } from '@/boot/i18n'
import { useI18n } from 'vue-i18n'
import { emitKeypressEvents } from 'readline'
import { costanti } from '@costanti'
import objectId from '@src/js/objectId'
@@ -138,11 +140,11 @@ export default defineComponent({
}
function getNewOrderByThisElem() {
let myelem = props.myelem
const myelem = props.myelem
let neword = 0
if (myelem) {
neword = myelem.order!
const recfound = globalStore.getMyElemNextThisElemId(props.idPage, myelem._id!)
const recfound = globalStore.getMyElemNextThisElemId(props.idPage, myelem._id)
if (recfound) {
neword = Math.round((recfound.order! + myelem.order!) / 2)
@@ -172,7 +174,7 @@ export default defineComponent({
neword = Math.round((recfound.order + elemsel.order) / 2)
}
let newrec = await globalStore.prepareAddNewElem(neword, $q, t, props.myelem, newtype.value)
const newrec = await globalStore.prepareAddNewElem(neword, $q, t, props.myelem, newtype.value)
emit('selElemClick', newrec)
@@ -265,11 +267,11 @@ export default defineComponent({
}
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_right_attaccato = tools.resetIText(recscheda.scheda?.testo_right_attaccato!)
recscheda.scheda.testo_right = tools.resetIText(recscheda.scheda?.testo_right!)
recscheda.scheda.testo_bottom = tools.resetIText(recscheda.scheda?.testo_bottom!)
recscheda.scheda.testo_right_attaccato = tools.resetIText(recscheda.scheda?.testo_right_attaccato)
recscheda.scheda.testo_right = tools.resetIText(recscheda.scheda?.testo_right)
recscheda.scheda.testo_bottom = tools.resetIText(recscheda.scheda?.testo_bottom)
if ((!recscheda.scheda?.dimensioni.pagina)) {
recscheda.scheda.dimensioni.pagina = tools.resetRecIPagina(recscheda.scheda?.dimensioni.pagina)
@@ -364,12 +366,16 @@ export default defineComponent({
let maxorder = 0
myel.value.catalogo!.arrSchede?.forEach(scheda => {
if (scheda?.order! > maxorder) {
if (scheda?.order > maxorder) {
maxorder = scheda.order
}
})
let defaultDimensioniPag = tools.resetRecIDimensioni(null)
let testodef: IText = {}
testodef = tools.resetIText(testodef)
const defaultDimensioniPag = tools.resetRecIDimensioni(null)
defaultDimensioniPag.size = {
width: '800px',
height: '600px',
@@ -387,7 +393,7 @@ export default defineComponent({
right: '0px',
}
let defaultDimensioniRiga = tools.resetRecIDimensioni(null)
const defaultDimensioniRiga = tools.resetRecIDimensioni(null)
defaultDimensioniRiga.size = {
width: '800px',
@@ -406,7 +412,7 @@ export default defineComponent({
right: '0px',
}
let defaultSchedaProdotto = tools.resetRecIDimensioni(null)
const defaultSchedaProdotto = tools.resetRecIDimensioni(null)
defaultSchedaProdotto.size = {
width: '360px',
@@ -427,8 +433,8 @@ export default defineComponent({
right: '0px',
}
let dimensioni: IElementiScheda = {
pagina: defaultDimensioniPag,
const dimensioni: IElementiScheda = {
pagina: { dimensioni: defaultDimensioniPag, testo_down: testodef, testo_up: testodef },
riga: defaultDimensioniRiga,
scheda_prodotto: defaultSchedaProdotto,
immagine_prodotto: {
@@ -451,7 +457,7 @@ export default defineComponent({
},
}
let newscheda: IMyScheda = {
const newscheda: IMyScheda = {
_id: objectId(),
idapp: tools.appid()!,
isTemplate: false,
@@ -536,7 +542,7 @@ export default defineComponent({
if (myschedatocopy) {
let newscheda = myschedatocopy.scheda!.name
const newscheda = myschedatocopy.scheda!.name
const msg = 'Sostituisci questa scheda (' + schedadest.scheda?.name + ') con "' + newscheda + '" ?'
@@ -552,7 +558,7 @@ export default defineComponent({
persistent: false,
}).onOk(async () => {
const myschedadest: ISchedaSingola = myel.value.catalogo!.arrSchede![indscheda]
myschedadest.scheda = tools.jsonCopy(myschedatocopy.scheda!)
myschedadest.scheda = tools.jsonCopy(myschedatocopy.scheda)
myschedadest.scheda!._id = objectId()
myschedadest.order = 20
@@ -570,12 +576,12 @@ export default defineComponent({
const myfindscheda = myel.value.catalogo!.arrSchede.find((scheda: ISchedaSingola) => scheda._id === id)
if (myfindscheda) {
let myscheda = tools.jsonCopy(myfindscheda)
const myscheda = tools.jsonCopy(myfindscheda)
delete myscheda._id
delete myscheda.scheda!._id
myscheda.numPagineMax = 0
myscheda.order = myscheda.order + 10,
myscheda._id = objectId()
myscheda.order = myscheda.order + 10
myscheda._id = objectId()
myscheda.scheda!._id = objectId()
myscheda.scheda!.name = myscheda.scheda!.name + '_copia'
myscheda.scheda!.isTemplate = false
@@ -596,7 +602,7 @@ export default defineComponent({
const myfindcard = myel.value.listcards[tabCard.value]
if (myfindcard) {
let mycard = tools.jsonCopy(myfindcard)
const mycard = tools.jsonCopy(myfindcard)
delete mycard._id
mycard._id = objectId()
@@ -678,9 +684,9 @@ export default defineComponent({
function saveFieldElem(rec: any, newval: any, col: IColGridTable) {
//console.log('saveFieldElem', rec, 'newval', newval, 'col', col)
let iscatalogo = costanti.CATALOGO_FIELDS.includes(col.name)
let isscheda = costanti.SCHEDA_FIELDS.includes(col.name)
let isIImg = costanti.IMG_FIELDS.includes(col.name) && (col.fieldtype === costanti.FieldType.image)
const iscatalogo = costanti.CATALOGO_FIELDS.includes(col.name)
const isscheda = costanti.SCHEDA_FIELDS.includes(col.name)
const isIImg = costanti.IMG_FIELDS.includes(col.name) && (col.fieldtype === costanti.FieldType.image)
if (col.fieldtype === costanti.FieldType.image) {
if (iscatalogo) {
@@ -739,9 +745,6 @@ export default defineComponent({
myel.value.image = myval
myel.value.vers_img = tools.getGenerateVersionImage()
} else if (props.myelem.type === shared_consts.ELEMTYPE.IMAGE) {
myel.value.image = myval
}
modifElem()
@@ -782,15 +785,10 @@ export default defineComponent({
myel.value.widthimg = value; // Aggiorna widthimg con il nuovo valore
modifElem()
}
function updateCatalogoSizeWidth(value: any) {
// Gestisce l'input dell'utente per un nuovo valore
myel.value.catalogo!.width = value // Aggiorna widthimg con il nuovo valore
modifElem()
}
function updateSizeHeight(value: any) {
if (value)
myel.value.heightimg = value; // Aggiorna widthimg con il nuovo valore
else
else
myel.value.heightimg = ''
modifElem()
}
@@ -822,16 +820,16 @@ export default defineComponent({
}
async function moveElem(direz: any) {
let myelem = props.myelem
const myelem = props.myelem
const elemprec = globalStore.getMyElemPrecThisElemId(props.idPage, myelem._id!)
const elemnext = globalStore.getMyElemNextThisElemId(props.idPage, myelem._id!)
const elemprec = globalStore.getMyElemPrecThisElemId(props.idPage, myelem._id)
const elemnext = globalStore.getMyElemNextThisElemId(props.idPage, myelem._id)
if (!elemprec || !elemnext)
return false
let neworder = 0
let oldorder = myelem.order!
const oldorder = myelem.order!
if (direz === -1) {
// UP
@@ -839,7 +837,7 @@ export default defineComponent({
elemprec.order = oldorder
if (oldorder === elemprec.order!) {
const elemprec2 = globalStore.getMyElemPrecThisElemId(props.idPage, elemprec._id!)
const elemprec2 = globalStore.getMyElemPrecThisElemId(props.idPage, elemprec._id)
neworder = (elemprec2.order! + elemprec.order) / 2
elemprec.order = Math.round((oldorder + neworder) / 2)
@@ -853,7 +851,7 @@ export default defineComponent({
elemnext.order = oldorder
if (oldorder === elemnext.order!) {
const elemnext2 = globalStore.getMyElemNextThisElemId(props.idPage, elemnext._id!)
const elemnext2 = globalStore.getMyElemNextThisElemId(props.idPage, elemnext._id)
neworder = (elemnext2.order! + elemnext.order) / 2
elemnext.order = Math.round((oldorder + neworder) / 2)
@@ -941,9 +939,9 @@ export default defineComponent({
let myformat = { ...optcatalogo.areadistampa!.format }
let scale = tools.getScale(optcatalogo)
const scale = tools.getScale(optcatalogo)
let scalecanvas = optcatalogo.areadistampa!.scalecanvas
const scalecanvas = optcatalogo.areadistampa!.scalecanvas
if (tools.isObject(myformat) && scale > 0) {
} else {
@@ -1071,7 +1069,6 @@ export default defineComponent({
selectedClasses,
classiImmagineOptions,
saveFieldElem,
updateCatalogoSizeWidth,
dupPage,
tabScheda,
addNewScheda,