- Continuazione del Catalogo

This commit is contained in:
Surya Paolo
2024-10-26 17:12:05 +02:00
parent 76b51f5b91
commit baa4188746
62 changed files with 1112 additions and 1697 deletions

View File

@@ -2,7 +2,7 @@ import {
defineComponent, onMounted, PropType, computed, ref, toRef, watch,
} from 'vue'
import { IElemText, IImgGallery, ILabelValue, IMyCard, IMyElem, IMyPage, IOperators } from '@src/model'
import { IColGridTable, IElemText, IImgGallery, ILabelValue, IMyCard, IMyElem, IMyPage, IOperators } from '@src/model'
import { useGlobalStore } from '@store/globalStore'
import { CImgTitle } from '@/components/CImgTitle'
@@ -307,6 +307,28 @@ 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)
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 {
myel.value[col.name] = newval.imagefile
}
} else {
if (iscatalogo) {
myel.value.catalogo[col.name] = newval
console.log('SALVATO IN', col.name, newval, 'RIS', myel.value.catalogo[col.name])
} else {
myel.value[col.name] = newval
}
}
}
function saveCard(recpass: IMyCard, myval: any) {
if (props.myelem.type === shared_consts.ELEMTYPE.CARD) {
if (props.myelem.listcards) {
@@ -337,8 +359,13 @@ export default defineComponent({
(props.myelem.type === shared_consts.ELEMTYPE.IMAGE)) {
myel.value.image = myval
myel.value.vers_img = tools.getGenerateVersionImage()
} else if (props.myelem.type === shared_consts.ELEMTYPE.IMAGE) {
myel.value.image = myval
}
modifElem()
}
function showAnimation() {
@@ -358,10 +385,15 @@ export default defineComponent({
modifElem()
}*/
function generateSizeOptions() {
function generateSizeOptions(widthpx: boolean = true) {
const options = [];
let add = '';
if (widthpx)
add = 'px'
for (let i = 0; i <= 700; i += 50) {
options.push({ label: `${i}px`, value: `${i}px` });
options.push({ label: `${i}${add}`, value: `${i}${add}` });
}
return options;
}
@@ -371,6 +403,40 @@ 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 updateCatalogoNumSchedePerCol(value: any) {
// Gestisce l'input dell'utente per un nuovo valore
myel.value.catalogo!.numschede_perCol = value // Aggiorna widthimg con il nuovo valore
modifElem()
}
function updateCatalogoNumSchedePerRiga(value: any) {
// Gestisce l'input dell'utente per un nuovo valore
myel.value.catalogo!.numschede_perRiga = value // Aggiorna widthimg con il nuovo valore
modifElem()
}
function updateCatalogoSizeWidthScheda(value: any) {
// Gestisce l'input dell'utente per un nuovo valore
myel.value.catalogo!.widthscheda = value // Aggiorna widthimg con il nuovo valore
modifElem()
}
function updateCatalogoSizeWidthPag(value: any) {
// Gestisce l'input dell'utente per un nuovo valore
myel.value.catalogo!.widthpag = value // Aggiorna widthimg con il nuovo valore
modifElem()
}
function updateCatalogoSizeWidthPagPrintable(value: any) {
// Gestisce l'input dell'utente per un nuovo valore
myel.value.catalogo!.widthpagPrintable = value // Aggiorna widthimg con il nuovo valore
modifElem()
}
function updateCatalogoSizeHeight(value: any) {
myel.value.catalogo!.height = value
modifElem()
}
function updateSizeHeight(value: any) {
myel.value.heightimg = value; // Aggiorna widthimg con il nuovo valore
@@ -520,6 +586,14 @@ export default defineComponent({
updateClass4,
selectedClasses,
classiImmagineOptions,
saveFieldElem,
updateCatalogoSizeWidth,
updateCatalogoSizeHeight,
updateCatalogoSizeWidthScheda,
updateCatalogoSizeWidthPag,
updateCatalogoSizeWidthPagPrintable,
updateCatalogoNumSchedePerCol,
updateCatalogoNumSchedePerRiga,
}
},