- Continuazione del Catalogo
This commit is contained in:
@@ -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,
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -189,7 +189,10 @@
|
||||
/>
|
||||
<q-select
|
||||
label="Altezza Carosello:"
|
||||
v-if="(myel.type === shared_consts.ELEMTYPE.CARD) || (myel.type === shared_consts.ELEMTYPE.GRID_ORIZ)"
|
||||
v-if="
|
||||
myel.type === shared_consts.ELEMTYPE.CARD ||
|
||||
myel.type === shared_consts.ELEMTYPE.GRID_ORIZ
|
||||
"
|
||||
v-model="myel.heightcarousel"
|
||||
emit-value
|
||||
map-options
|
||||
@@ -226,6 +229,7 @@
|
||||
style="width: 100px"
|
||||
emit-value
|
||||
map-options
|
||||
@save="saveCard"
|
||||
>
|
||||
</q-select>
|
||||
<q-select
|
||||
@@ -464,12 +468,12 @@
|
||||
:rec="rec"
|
||||
field="imagefile"
|
||||
@update:model-value="modifElem"
|
||||
@save="saveCard"
|
||||
:canEdit="true"
|
||||
:canModify="true"
|
||||
:nosaveToDb="true"
|
||||
:path="myel.path"
|
||||
:fieldtype="costanti.FieldType.imgcard"
|
||||
@save="saveCard"
|
||||
>
|
||||
</CMyFieldRec>
|
||||
|
||||
@@ -861,6 +865,56 @@
|
||||
</CMyFieldRec>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="myel.type === shared_consts.ELEMTYPE.QRCODE">
|
||||
<div v-if="enableEdit">
|
||||
<q-input
|
||||
dense
|
||||
label="Link:"
|
||||
@update:model-value="modifElem"
|
||||
v-model="myel.container"
|
||||
filled
|
||||
v-on:keyup.enter="saveElem"
|
||||
>
|
||||
</q-input>
|
||||
<q-input
|
||||
dense
|
||||
label="Testo Link:"
|
||||
@update:model-value="modifElem"
|
||||
v-model="myel.container2"
|
||||
filled
|
||||
v-on:keyup.enter="saveElem"
|
||||
>
|
||||
</q-input>
|
||||
<q-toggle
|
||||
v-model="myel.parambool"
|
||||
color="positive"
|
||||
label="Leggi"
|
||||
@update:model-value="modifElem"
|
||||
></q-toggle>
|
||||
<q-input
|
||||
label="NomeFile Img:"
|
||||
@update:model-value="modifElem"
|
||||
v-model="myel.image"
|
||||
filled
|
||||
dense
|
||||
v-on:keyup.enter="saveElem"
|
||||
>
|
||||
</q-input>
|
||||
<CMyFieldRec
|
||||
title="NomeFile Img:"
|
||||
table="myelems"
|
||||
:id="myel._id"
|
||||
:rec="myel"
|
||||
field="image"
|
||||
@update:model-value="modifElem"
|
||||
:canEdit="true"
|
||||
:canModify="true"
|
||||
:path="myel.path"
|
||||
:fieldtype="costanti.FieldType.image"
|
||||
>
|
||||
</CMyFieldRec>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-else-if="myel.type === shared_consts.ELEMTYPE.IMAGEUPLOAD">
|
||||
<div v-if="enableEdit">
|
||||
@@ -1271,6 +1325,15 @@
|
||||
<div v-if="enableEdit" class="row">
|
||||
<div>Cataloghi:</div>
|
||||
<br />
|
||||
<q-toggle
|
||||
v-model="myel.catalogo.pdf"
|
||||
color="positive"
|
||||
icon="fas fa-file-pdf"
|
||||
label="Versione PDF"
|
||||
@update:model-value="modifElem"
|
||||
>
|
||||
</q-toggle>
|
||||
<br>
|
||||
|
||||
<!--++AddCATALOGO_FIELDS-->
|
||||
<q-select
|
||||
@@ -1326,14 +1389,191 @@
|
||||
option-label="name"
|
||||
>
|
||||
</q-select>
|
||||
Versione PDF:
|
||||
<q-toggle
|
||||
v-model="myel.catalogo.pdf"
|
||||
color="positive"
|
||||
icon="fas fa-file-pdf"
|
||||
|
||||
<q-select
|
||||
label="Largh. Schede:"
|
||||
v-model="myel.catalogo.widthscheda"
|
||||
emit-value
|
||||
map-options
|
||||
:options="generateSizeOptions()"
|
||||
use-input
|
||||
use-chips
|
||||
@input="modifElem"
|
||||
@new-value="updateCatalogoSizeWidthScheda"
|
||||
filled
|
||||
dense
|
||||
style="width: 150px"
|
||||
/>
|
||||
<q-select
|
||||
label="Largh. Pagina:"
|
||||
v-model="myel.catalogo.widthpag"
|
||||
emit-value
|
||||
map-options
|
||||
:options="generateSizeOptions(false)"
|
||||
use-input
|
||||
use-chips
|
||||
@input="modifElem"
|
||||
@new-value="updateCatalogoSizeWidthPag"
|
||||
filled
|
||||
dense
|
||||
style="width: 180px"
|
||||
/>
|
||||
<q-select
|
||||
label="Largh. Immagini:"
|
||||
v-model="myel.catalogo.width"
|
||||
emit-value
|
||||
map-options
|
||||
:options="generateSizeOptions()"
|
||||
use-input
|
||||
use-chips
|
||||
@input="modifElem"
|
||||
@new-value="updateCatalogoSizeWidth"
|
||||
filled
|
||||
dense
|
||||
style="width: 180px"
|
||||
/>
|
||||
<q-select
|
||||
label="Altezza Schede:"
|
||||
v-model="myel.catalogo.height"
|
||||
emit-value
|
||||
map-options
|
||||
:options="generateSizeOptions()"
|
||||
use-input
|
||||
use-chips
|
||||
@input="modifElem"
|
||||
@new-value="updateCatalogoSizeHeight"
|
||||
filled
|
||||
dense
|
||||
style="width: 180px"
|
||||
/>
|
||||
</div>
|
||||
<div class="sfondo_margine">
|
||||
Margini:<br />
|
||||
<q-select
|
||||
label="Schede per Riga"
|
||||
v-model="myel.catalogo.numschede_perRiga"
|
||||
emit-value
|
||||
map-options
|
||||
:options="[
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
|
||||
]"
|
||||
use-input
|
||||
use-chips
|
||||
@input="modifElem"
|
||||
@new-value="updateCatalogoNumSchedePerRiga"
|
||||
filled
|
||||
dense
|
||||
style="width: 180px"
|
||||
/>
|
||||
<q-select
|
||||
label="Schede per Colonna"
|
||||
v-model="myel.catalogo.numschede_perCol"
|
||||
emit-value
|
||||
map-options
|
||||
:options="[
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
|
||||
]"
|
||||
use-input
|
||||
use-chips
|
||||
@input="modifElem"
|
||||
@new-value="updateCatalogoNumSchedePerCol"
|
||||
filled
|
||||
dense
|
||||
style="width: 180px"
|
||||
/>
|
||||
<q-input
|
||||
dense
|
||||
label="Margine per Pagina:"
|
||||
@update:model-value="modifElem"
|
||||
v-model="myel.catalogo.margine_pagina"
|
||||
filled
|
||||
v-on:keyup.enter="saveFieldElem"
|
||||
>
|
||||
</q-toggle>
|
||||
</q-input>
|
||||
<q-input
|
||||
dense
|
||||
label="Margine per Riga:"
|
||||
@update:model-value="modifElem"
|
||||
v-model="myel.catalogo.margine_riga"
|
||||
filled
|
||||
v-on:keyup.enter="saveFieldElem"
|
||||
>
|
||||
</q-input>
|
||||
</div>
|
||||
<div>Sfondo:</div>
|
||||
<div v-if="enableEdit">
|
||||
Nome File Web: {{ myel.catalogo.backgroundimage }}<br />
|
||||
<CMyFieldRec
|
||||
title="Per Web:"
|
||||
table="catalogo"
|
||||
:rec="myel.catalogo"
|
||||
field="backgroundimage"
|
||||
@update:model-value="modifElem"
|
||||
:canEdit="true"
|
||||
:canModify="true"
|
||||
:fieldtype="costanti.FieldType.image"
|
||||
@save="saveFieldElem"
|
||||
>
|
||||
</CMyFieldRec>
|
||||
<br />
|
||||
<div class="sfondo_print">
|
||||
Per Stampa:
|
||||
<q-toggle
|
||||
v-model="myel.catalogo.printable"
|
||||
color="positive"
|
||||
icon="fas fa-file-pdf"
|
||||
label="Versione Stampabile"
|
||||
@update:model-value="modifElem"
|
||||
>
|
||||
</q-toggle>
|
||||
|
||||
<q-input
|
||||
dense
|
||||
label="Margine per Pagina:"
|
||||
@update:model-value="modifElem"
|
||||
v-model="myel.catalogo.margine_paginaPrintable"
|
||||
filled
|
||||
v-on:keyup.enter="saveFieldElem"
|
||||
>
|
||||
</q-input>
|
||||
<q-input
|
||||
dense
|
||||
label="Margine per Riga:"
|
||||
@update:model-value="modifElem"
|
||||
v-model="myel.catalogo.margine_rigaPrintable"
|
||||
filled
|
||||
v-on:keyup.enter="saveFieldElem"
|
||||
>
|
||||
</q-input>
|
||||
|
||||
Nome File Printable: {{ myel.catalogo.backgroundimage_printable }}
|
||||
<CMyFieldRec
|
||||
title="Sfondo:"
|
||||
table="catalogo"
|
||||
:rec="myel.catalogo"
|
||||
field="backgroundimage_printable"
|
||||
@update:model-value="modifElem"
|
||||
:canEdit="true"
|
||||
:canModify="true"
|
||||
:fieldtype="costanti.FieldType.image"
|
||||
@save="saveFieldElem"
|
||||
>
|
||||
</CMyFieldRec>
|
||||
<q-select
|
||||
label="Largh. Pag. Stampa:"
|
||||
v-model="myel.catalogo.widthpagPrintable"
|
||||
emit-value
|
||||
map-options
|
||||
:options="generateSizeOptions(false)"
|
||||
use-input
|
||||
use-chips
|
||||
@input="modifElem"
|
||||
@new-value="updateCatalogoSizeWidthPagPrintable"
|
||||
filled
|
||||
dense
|
||||
style="width: 180px"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-list>
|
||||
|
||||
Reference in New Issue
Block a user