- generato lista libri, con possibilità di cambiare l'ordinamento dei libri o di cancellare libri.
This commit is contained in:
@@ -368,174 +368,7 @@ export default defineComponent({
|
||||
}
|
||||
function addNewScheda() {
|
||||
|
||||
let maxorder = 0
|
||||
myel.value.catalogo!.arrSchede?.forEach(scheda => {
|
||||
if (scheda?.order > maxorder) {
|
||||
maxorder = scheda.order
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
let testodef: IText = {}
|
||||
testodef = tools.resetIText(testodef)
|
||||
|
||||
const defaultDimensioniPag = tools.resetRecIDimensioni(null)
|
||||
defaultDimensioniPag.size = {
|
||||
width: '800px',
|
||||
height: '600px',
|
||||
}
|
||||
defaultDimensioniPag.margini = {
|
||||
top: '12px',
|
||||
bottom: '0px',
|
||||
left: '0px',
|
||||
right: '0px',
|
||||
}
|
||||
defaultDimensioniPag.padding = {
|
||||
top: '0px',
|
||||
bottom: '0px',
|
||||
left: '0px',
|
||||
right: '0px',
|
||||
}
|
||||
|
||||
const defaultDimensioniRiga = tools.resetRecIDimensioni(null)
|
||||
|
||||
defaultDimensioniRiga.size = {
|
||||
width: '800px',
|
||||
height: '300px',
|
||||
}
|
||||
defaultDimensioniRiga.margini = {
|
||||
top: '40px',
|
||||
bottom: '0px',
|
||||
left: '0px',
|
||||
right: '0px',
|
||||
}
|
||||
defaultDimensioniRiga.padding = {
|
||||
top: '0px',
|
||||
bottom: '0px',
|
||||
left: '0px',
|
||||
right: '0px',
|
||||
}
|
||||
|
||||
const defaultSchedaProdotto = tools.resetRecIDimensioni(null)
|
||||
|
||||
defaultSchedaProdotto.size = {
|
||||
width: '360px',
|
||||
height: '230px',
|
||||
}
|
||||
|
||||
defaultSchedaProdotto.margini = {
|
||||
top: '0px',
|
||||
bottom: '0px',
|
||||
left: '0px',
|
||||
right: '0px',
|
||||
}
|
||||
|
||||
defaultSchedaProdotto.padding = {
|
||||
top: '0px',
|
||||
bottom: '0px',
|
||||
left: '0px',
|
||||
right: '0px',
|
||||
}
|
||||
|
||||
const dimensioni: IElementiScheda = {
|
||||
pagina: { dimensioni: defaultDimensioniPag, testo_down: testodef, testo_up: testodef, testo_title: testodef },
|
||||
riga: defaultDimensioniRiga,
|
||||
scheda_prodotto: defaultSchedaProdotto,
|
||||
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',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
const newscheda: IMyScheda = {
|
||||
_id: objectId(),
|
||||
idapp: tools.appid()!,
|
||||
isTemplate: false,
|
||||
isPagIntro: false,
|
||||
show_separatore: true,
|
||||
name: 'Scheda Nuova',
|
||||
dimensioni,
|
||||
numschede_perRiga: 2,
|
||||
numschede_perCol: 2,
|
||||
testo_right_attaccato: {
|
||||
contenuto: '',
|
||||
maxlength: 0,
|
||||
font: {
|
||||
posiz_text: costanti.POSIZ_TESTO.A_DESTRA,
|
||||
},
|
||||
},
|
||||
testo_right: {
|
||||
contenuto: '',
|
||||
maxlength: 0,
|
||||
font: {
|
||||
posiz_text: costanti.POSIZ_TESTO.A_DESTRA,
|
||||
},
|
||||
},
|
||||
testo_bottom: {
|
||||
contenuto: '',
|
||||
maxlength: 0,
|
||||
font: {
|
||||
posiz_text: costanti.POSIZ_TESTO.IN_BASSO,
|
||||
}
|
||||
},
|
||||
barcode: {
|
||||
show: false,
|
||||
format: '',
|
||||
size: {
|
||||
width: '2',
|
||||
height: '100',
|
||||
},
|
||||
font: {
|
||||
name: 'monospace',
|
||||
size: '16px',
|
||||
}
|
||||
},
|
||||
productTypes: [],
|
||||
excludeproductTypes: [],
|
||||
editore: [],
|
||||
argomenti: [],
|
||||
author: '',
|
||||
sort_field: '',
|
||||
sort_dir: 0,
|
||||
arrProdottiSpeciali: [],
|
||||
etichette: {
|
||||
novita: {
|
||||
show: false,
|
||||
months: 6,
|
||||
},
|
||||
bestseller: {
|
||||
show: false,
|
||||
primiNInClassifica: 20
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!myel.value.catalogo!.arrSchede)
|
||||
myel.value.catalogo!.arrSchede = []
|
||||
|
||||
myel.value.catalogo!.arrSchede.push(
|
||||
{
|
||||
_id: objectId(),
|
||||
scheda: newscheda,
|
||||
order: maxorder + 10,
|
||||
numPagineMax: 0,
|
||||
}
|
||||
)
|
||||
// console.log('arrschede', myel.value.catalogo!.arrSchede)
|
||||
Products.addNewScheda(myel.value.catalogo)
|
||||
|
||||
modifElem()
|
||||
|
||||
|
||||
@@ -1463,6 +1463,7 @@
|
||||
@click="addNewScheda"
|
||||
>
|
||||
</q-btn>
|
||||
|
||||
<div
|
||||
v-for="(recscheda, ind) in myel.catalogo.arrSchede"
|
||||
:key="recscheda._id"
|
||||
@@ -1470,6 +1471,41 @@
|
||||
dense
|
||||
:label="`${ind}. ` + recscheda.scheda.name ? recscheda.scheda.name : `Scheda ` + (ind + 1)"
|
||||
>
|
||||
<div class="row">
|
||||
<q-select
|
||||
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
|
||||
v-if="enableEdit"
|
||||
rounded
|
||||
outlined
|
||||
v-model="recscheda.scheda.linkIdTemplate"
|
||||
:options="globalStore.getSchedeOpt('SEARCH_')"
|
||||
@update:model-value="modifElem"
|
||||
label="Scheda collegata:"
|
||||
style="width: 250px"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
</q-select>
|
||||
|
||||
<q-toggle
|
||||
v-model="recscheda.scheda.isTemplate"
|
||||
color="positive"
|
||||
icon="fas fa-file-pdf"
|
||||
label="E' un template"
|
||||
@update:model-value="modifElem"
|
||||
>
|
||||
</q-toggle>
|
||||
<q-input
|
||||
label="Nome Template"
|
||||
@update:model-value="modifElem"
|
||||
v-model="recscheda.scheda.name"
|
||||
filled
|
||||
debounce="1000"
|
||||
v-on:keyup.enter="saveElem"
|
||||
>
|
||||
</q-input>
|
||||
</div>
|
||||
|
||||
<q-expansion-item
|
||||
dense
|
||||
dense-toggle
|
||||
|
||||
Reference in New Issue
Block a user