- Aggiungere un campo "Vagliato dall'Editore" e aggiungere anche il campo "chi" e delle Note
This commit is contained in:
@@ -134,7 +134,7 @@
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>Scheda Libro</q-item-label>
|
||||
<q-item-label>Scheda</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
@@ -194,7 +194,7 @@
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>Carica dati del Libro (da GM)</q-item-label>
|
||||
<q-item-label>Carica dati (da GM)</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
@@ -213,7 +213,7 @@
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>Carica dati del Libro (dal DB Locale)</q-item-label>
|
||||
<q-item-label>Carica dati (dal DB Locale)</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<!--<q-item
|
||||
@@ -675,7 +675,6 @@
|
||||
>
|
||||
</CSchedaProdotto>
|
||||
|
||||
updateFieldToGM
|
||||
</q-dialog>
|
||||
<q-dialog
|
||||
v-if="myproduct && modifTrafiletto"
|
||||
@@ -695,7 +694,6 @@
|
||||
>
|
||||
</CModifTrafiletto>
|
||||
|
||||
updateFieldToGM
|
||||
</q-dialog>
|
||||
<q-dialog
|
||||
v-if="visufromgm && myproduct"
|
||||
|
||||
@@ -40,9 +40,6 @@ import { costanti } from '@costanti'
|
||||
import objectId from '@src/js/objectId'
|
||||
import { useProducts } from '@src/store/Products'
|
||||
|
||||
import html2pdf from 'html2pdf.js'
|
||||
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CMyEditElem',
|
||||
components: {
|
||||
@@ -740,135 +737,11 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
function toggleDebug() {
|
||||
myel.value.catalogo!.indebug = !myel.value.catalogo!.indebug
|
||||
}
|
||||
|
||||
const preparePDF = async () => {
|
||||
myel.value.catalogo!.generazionePDFInCorso = true
|
||||
myel.value.catalogo!.areadistampa!.scale = myel.value.catalogo!.areadistampa!.scale_printable
|
||||
}
|
||||
|
||||
const terminaPDF = async () => {
|
||||
myel.value.catalogo!.generazionePDFInCorso = false
|
||||
myel.value.catalogo!.areadistampa!.scale = 1
|
||||
}
|
||||
|
||||
|
||||
const generatePDF = async (optcatalogo: IOptCatalogo) => {
|
||||
|
||||
await nextTick()
|
||||
|
||||
$q.dialog({
|
||||
message: 'Generare il PDF ?',
|
||||
ok: {
|
||||
label: t('dialog.yes'),
|
||||
push: true
|
||||
},
|
||||
cancel: {
|
||||
label: t('dialog.cancel')
|
||||
},
|
||||
title: 'Generazione PDF'
|
||||
}).onOk(async () => {
|
||||
|
||||
|
||||
$q.loading.show({
|
||||
message: 'Caricamento immagini e generazione PDF in corso...'
|
||||
})
|
||||
|
||||
|
||||
try {
|
||||
|
||||
let defaultMargin = 0.1
|
||||
if (optcatalogo.printable) {
|
||||
defaultMargin = 0
|
||||
} else {
|
||||
defaultMargin = 0
|
||||
}
|
||||
const unit = optcatalogo.areadistampa!.unit
|
||||
|
||||
let myformat = { ...optcatalogo.areadistampa!.format }
|
||||
|
||||
const scale = tools.getScale(optcatalogo)
|
||||
|
||||
const scalecanvas = optcatalogo.areadistampa!.scalecanvas
|
||||
|
||||
if (tools.isObject(myformat) && scale > 0) {
|
||||
} else {
|
||||
myformat = [210, 297]
|
||||
}
|
||||
|
||||
|
||||
const formatwidth = (myformat[0] * scale)
|
||||
const formatheight = (myformat[1] * scale)
|
||||
|
||||
let myfile = (optcatalogo.pdf_filename ?? 'catalogo_completo')
|
||||
|
||||
myfile += '_' + formatwidth + '_' + formatheight + '_' + unit + '_scale_' + scale
|
||||
|
||||
myfile += '.pdf'
|
||||
|
||||
|
||||
const element = document.getElementById('pdf-content')
|
||||
const opt = {
|
||||
margin: [
|
||||
optcatalogo.printable ? (parseFloat(optcatalogo.areadistampa!.margini?.top) || defaultMargin) : defaultMargin,
|
||||
optcatalogo.printable ? (parseFloat(optcatalogo.areadistampa!.margini?.left) || defaultMargin) : defaultMargin,
|
||||
optcatalogo.printable ? (parseFloat(optcatalogo.areadistampa!.margini?.bottom) || defaultMargin) : defaultMargin,
|
||||
optcatalogo.printable ? (parseFloat(optcatalogo.areadistampa!.margini?.right) || defaultMargin) : defaultMargin
|
||||
],
|
||||
filename: myfile,
|
||||
image: {
|
||||
type: 'jpeg',
|
||||
quality: 0.98
|
||||
},
|
||||
html2canvas: {
|
||||
scale: scalecanvas,
|
||||
useCORS: true,
|
||||
letterRendering: true,
|
||||
},
|
||||
jsPDF: {
|
||||
unit: unit,
|
||||
format: [formatwidth, formatheight],
|
||||
orientation: optcatalogo.areadistampa!.orientation,
|
||||
compress: optcatalogo.areadistampa!.compress,
|
||||
},
|
||||
enableLinks: true,
|
||||
pagebreak: { mode: 'avoid-all', before: '.card-page' }
|
||||
}
|
||||
|
||||
console.log('opt di stampa', opt)
|
||||
// a4: [595.28, 841.89]
|
||||
|
||||
await html2pdf().set(opt).from(element).save()
|
||||
|
||||
optcatalogo.generazionePDFInCorso = false
|
||||
optcatalogo.areadistampa!.scale = 1
|
||||
|
||||
$q.loading.hide()
|
||||
$q.notify({
|
||||
color: 'positive',
|
||||
message: 'PDF generato con successo!',
|
||||
icon: 'check'
|
||||
})
|
||||
} catch (error) {
|
||||
$q.loading.hide()
|
||||
$q.notify({
|
||||
color: 'negative',
|
||||
message: 'Errore nella generazione del PDF',
|
||||
icon: 'error'
|
||||
})
|
||||
console.error('Errore nella generazione del PDF:', error)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
preparePDF, terminaPDF, generatePDF,
|
||||
toggleDebug,
|
||||
tools,
|
||||
shared_consts,
|
||||
getArrDisciplines,
|
||||
|
||||
@@ -2480,28 +2480,6 @@
|
||||
</div>
|
||||
</q-expansion-item>
|
||||
<div></div>
|
||||
<q-btn
|
||||
v-if="myel.catalogo.pdf && !myel.catalogo.generazionePDFInCorso"
|
||||
:label="`Prepara PDF`"
|
||||
@click="preparePDF"
|
||||
></q-btn>
|
||||
<q-btn
|
||||
v-if="myel.catalogo.generazionePDFInCorso"
|
||||
:label="`Termina Generazione`"
|
||||
@click="terminaPDF"
|
||||
></q-btn>
|
||||
<q-btn
|
||||
v-if="myel.catalogo.pdf && myel.catalogo.generazionePDFInCorso"
|
||||
:label="`Genera PDF ${myel.catalogo.pdf_filename}`"
|
||||
@click="generatePDF(myel.catalogo)"
|
||||
color="positive"
|
||||
></q-btn>
|
||||
<q-btn
|
||||
label="Debug"
|
||||
@click="toggleDebug()"
|
||||
:push="myel.catalogo.indebug"
|
||||
:color="myel.catalogo.indebug ? `positive` : 'primary'"
|
||||
></q-btn>
|
||||
</div>
|
||||
</div>
|
||||
</q-list>
|
||||
|
||||
@@ -537,6 +537,14 @@ export default defineComponent({
|
||||
}
|
||||
// console.log('props.field', props.field, 'props.subfield', props.subfield, 'myvalue: ', myvalue)
|
||||
}
|
||||
|
||||
if (props.type === costanti.FieldType.verifica && !myvalue.value) {
|
||||
myvalue.value = {
|
||||
esito: costanti.VALIDATO.NO,
|
||||
username: '',
|
||||
note: '',
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
@@ -631,6 +639,11 @@ export default defineComponent({
|
||||
|
||||
console.log('SaveValueInt', newVal, valinitial)
|
||||
|
||||
if (col.value.fieldtype === costanti.FieldType.verifica) {
|
||||
newVal.username = userStore.my.username
|
||||
newVal.data = tools.getDateNow()
|
||||
}
|
||||
|
||||
if (props.tablesel) {
|
||||
if (true) {
|
||||
|
||||
@@ -949,6 +962,14 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
function updateValidazione(esito: any) {
|
||||
myvalue.value.esito = esito
|
||||
myvalue.value.data = tools.getDateNow()
|
||||
myvalue.value.username = userStore.my.username
|
||||
changevalRec(myvalue.value)
|
||||
Savedb(myvalue.value, '')
|
||||
}
|
||||
|
||||
|
||||
onBeforeMount(mounted)
|
||||
|
||||
@@ -998,6 +1019,7 @@ export default defineComponent({
|
||||
handleCancel,
|
||||
popupEditRef,
|
||||
copyToClipboard,
|
||||
updateValidazione,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -213,6 +213,46 @@
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.verifica">
|
||||
<div>
|
||||
<div>
|
||||
<q-chip
|
||||
dense
|
||||
class="q-ma-xs q-pa-xs"
|
||||
:color="
|
||||
myvalue.esito === costanti.VALIDATO.SI
|
||||
? 'green'
|
||||
: myvalue.esito === costanti.VALIDATO.TO_RESOLV
|
||||
? 'red'
|
||||
: 'grey-7'
|
||||
"
|
||||
text-color="white"
|
||||
:icon="
|
||||
myvalue.esito === costanti.VALIDATO.NO
|
||||
? 'fas fa-question-circle'
|
||||
: myvalue.esito === costanti.VALIDATO.SI
|
||||
? 'fas fa-check-circle'
|
||||
: 'fas fa-exclamation-circle'
|
||||
"
|
||||
:label="
|
||||
myvalue.esito === costanti.VALIDATO.NO
|
||||
? $t('validazione.NO')
|
||||
: myvalue.esito === costanti.VALIDATO.SI
|
||||
? $t('validazione.SI')
|
||||
: $t('validazione.TO_RESOLV')
|
||||
"
|
||||
></q-chip>
|
||||
</div>
|
||||
<div v-if="myvalue.username">
|
||||
<span>(Utente: {{ myvalue.username }} - in Data: {{ tools.getstrDateTime(myvalue.data) }})</span>
|
||||
</div>
|
||||
|
||||
<div v-if="myvalue.note">
|
||||
<span>Note: {{ myvalue.note }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.string || col.fieldtype === costanti.FieldType.crypted">
|
||||
<div
|
||||
v-if="isInModif"
|
||||
@@ -1118,6 +1158,41 @@
|
||||
>
|
||||
</q-select>
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.verifica">
|
||||
<div>
|
||||
<q-option-group
|
||||
v-model="scope.value.esito"
|
||||
type="radio"
|
||||
:icon="
|
||||
[costanti.VALIDATO.NO, costanti.VALIDATO.TO_RESOLV].includes(myvalue.esito)
|
||||
? 'fas fa-question-circle'
|
||||
: 'fas fa-check-circle'
|
||||
"
|
||||
:color="
|
||||
myvalue.esito === costanti.VALIDATO.SI
|
||||
? 'green'
|
||||
: myvalue.esito === costanti.VALIDATO.TO_RESOLV
|
||||
? 'red'
|
||||
: 'grey-7'
|
||||
"
|
||||
inline
|
||||
:options="[
|
||||
{ label: '[Non verificato]', value: costanti.VALIDATO.NO },
|
||||
{ label: 'Validato', value: costanti.VALIDATO.SI },
|
||||
{ label: 'Da Risolvere', value: costanti.VALIDATO.TO_RESOLV },
|
||||
]"
|
||||
></q-option-group>
|
||||
Username: {{ scope.value.username }}
|
||||
<q-input
|
||||
v-model="scope.value.note"
|
||||
type="text"
|
||||
icon="fas fa-sticky-note"
|
||||
label="Nota"
|
||||
:autogrow="true"
|
||||
>
|
||||
</q-input>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="col.fieldtype === costanti.FieldType.string || col.fieldtype === costanti.FieldType.crypted"
|
||||
>
|
||||
@@ -1146,9 +1221,9 @@
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.editor_nohtml">
|
||||
<div
|
||||
class="q-pa-md"
|
||||
style="min-width: 600px;"
|
||||
style="min-width: 600px"
|
||||
>
|
||||
<CMyEditorAI
|
||||
<CMyEditorAI
|
||||
v-model:value="scope.value"
|
||||
:title="col.visulabel ? t(col.label_trans) : visulabel ? addstrrequired + col.label : undefined"
|
||||
@keyup.enter.stop
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
:height="opt.heightimg"
|
||||
class="clickable-image"
|
||||
fit="cover"
|
||||
:src="tools.getFullFileName([myrec.foto_collana], table, myrec.username, myrec._id)"
|
||||
:src="tools.getFullFileName([myrec.foto_collana], table, '', myrec._id)"
|
||||
>
|
||||
<template v-slot:error>
|
||||
<div class="absolute-full flex flex-center text-white">immagine non impostata</div>
|
||||
@@ -35,14 +35,11 @@
|
||||
{{ myrec.title }}
|
||||
</div>
|
||||
<div class="">
|
||||
<div
|
||||
v-if="numprodottistr"
|
||||
class="text-caption text-h7 text-grey q-pb-xs"
|
||||
>
|
||||
<div class="text-caption text-h7 text-grey q-pb-xs">
|
||||
<q-icon name="fas fa-list-ol" /> {{ $t('cataloglist.numprodotti') }}:
|
||||
<span class="text-blue">{{ numprodottistr }}</span>
|
||||
<span :class="`text-` + (numprodottistr === 0 ? 'red' : 'blue')">{{ numprodottistr }}</span>
|
||||
</div>
|
||||
<div class="text-caption text-h7 text-grey q-pb-xs">
|
||||
<div class="text-caption text-h7 text-grey q-pb-xs">
|
||||
<q-icon name="fas fa-user" /> {{ $t('cataloglist.referenti') }}:
|
||||
<span
|
||||
v-if="myrec.referenti && myrec.referenti.length > 0"
|
||||
@@ -114,6 +111,13 @@
|
||||
>
|
||||
(Data: {{ tools.getstrDate(myrec.data_generato) }})
|
||||
</div>
|
||||
<div class="text-caption text-h7 text-grey q-pb-xs">
|
||||
<q-icon name="fas fa-list" /> Lista generata il:
|
||||
<span :class="`text-` + (tools.isDateValid(myrec.data_lista_generata) ? 'blue' : 'red')"
|
||||
>{{ tools.getstrDate(myrec.data_lista_generata) || '(non ancora generata)' }} da
|
||||
{{ myrec.username_lista_generata }}
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
v-if="myrec.pdf_online"
|
||||
class="text-caption text-h7 text-blue q-pb-xs"
|
||||
@@ -238,7 +242,7 @@
|
||||
class="q-ma-sm"
|
||||
>
|
||||
<CLabel
|
||||
:class_text="{ 'text-bold': true }"
|
||||
:class_text="{ 'text-bold': true }"
|
||||
:value="esiste_descrintro ? 'PRESENTE ' : 'MANCANTE !'"
|
||||
label="Testo descrittivo"
|
||||
:color="esiste_descrintro ? 'green' : 'red'"
|
||||
@@ -249,19 +253,32 @@
|
||||
class="q-ma-sm"
|
||||
>
|
||||
<CLabel
|
||||
:value="myrec.pdf_generato || 'ancora non è stato generato'"
|
||||
label="PDF generato"
|
||||
:value="
|
||||
tools.getstrDate(myrec.data_lista_generata) + ' da ' + myrec.username_lista_generata ||
|
||||
'ancora non è stata generata'
|
||||
"
|
||||
label="Lista generata"
|
||||
:color="myrec.pdf_generato ? 'green' : 'red'"
|
||||
:copy="true"
|
||||
/>
|
||||
<CLabel
|
||||
:value="myrec.pdf_online || 'ancora non è andato ONLINE'"
|
||||
label="PDF On-Line Ufficiale"
|
||||
:color="myrec.pdf_online ? 'green' : 'red'"
|
||||
:copy="true"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
style="width: 300px"
|
||||
class="q-ma-sm"
|
||||
>
|
||||
<CLabel
|
||||
:value="myrec.pdf_generato || 'ancora non è stato generato'"
|
||||
label="PDF generato"
|
||||
:color="myrec.pdf_generato ? 'green' : 'red'"
|
||||
:copy="true"
|
||||
/>
|
||||
<CLabel
|
||||
:value="myrec.pdf_online || 'ancora non è andato ONLINE'"
|
||||
label="PDF On-Line Ufficiale"
|
||||
:color="myrec.pdf_online ? 'green' : 'red'"
|
||||
:copy="true"
|
||||
/>
|
||||
</div>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
<q-card-actions align="center">
|
||||
|
||||
@@ -101,7 +101,7 @@ export default defineComponent({
|
||||
maxlength: props.scheda?.testo_bottom?.maxlength
|
||||
}
|
||||
|
||||
const savedColumns = tools.getCookie("selColCat");
|
||||
const savedColumns = tools.getCookie("selColCat_2");
|
||||
if (savedColumns) {
|
||||
selectedColumns.value = savedColumns;
|
||||
}
|
||||
@@ -121,6 +121,7 @@ export default defineComponent({
|
||||
const allColumns = [
|
||||
{ name: "pos", label: "Ind", field: "pos", align: "left", style: "width: 50px" },
|
||||
{ name: "drag", label: "Ord", field: "", align: "left", style: "width: 50px", edit: true },
|
||||
{ name: "validato", label: "Val", field: "validato", align: "left", style: "" },
|
||||
{ name: "image", label: "Foto", field: "image", align: "center" },
|
||||
{ name: "name", label: "Titolo del Libro", field: "name", align: "left" },
|
||||
{ name: "authors", label: "Autore", field: "authors", align: "left" },
|
||||
@@ -133,12 +134,14 @@ export default defineComponent({
|
||||
{ name: "stato", label: "Stato", field: "stato", align: "left" },
|
||||
{ name: "tipologia", label: "Tipologia", field: "tipologia", align: "left" },
|
||||
{ name: "tipoformato", label: "Formato", field: "tipoformato", align: "left" },
|
||||
{ name: "pagine", label: "Pag.", field: "pagine", align: "right" },
|
||||
{ name: "prezzo", label: "€", field: "prezzo", align: "right" },
|
||||
{ name: "prezzo_sconto", label: "€ (sconto)", field: "prezzo_sconto", align: "right" },
|
||||
{ name: "date_pub", label: "Pubblicato", field: "date_pub", align: "left" },
|
||||
//{ name: "ranking", label: "Class.", field: "ranking", align: "right" },
|
||||
//{ name: "rank3M", label: "Class. 3M", field: "rank3M", align: "right", visu: costanti.VISUCAMPI.PER_EDITORE },
|
||||
//{ name: "rank6M", label: "Class. 6M", field: "rank6M", align: "right", visu: costanti.VISUCAMPI.PER_EDITORE },
|
||||
//{ name: "rank1Y", label: "Class. 1Y", field: "rank1Y", align: "right", visu: costanti.VISUCAMPI.PER_EDITORE },
|
||||
{ name: "pagine", label: "Pag.", field: "pagine", align: "right" },
|
||||
{ name: "totVen", label: "Vend", field: "totVen", align: "right", visu: costanti.VISUCAMPI.PER_EDITORE },
|
||||
{ name: "vLast6M", label: "Ven 6M", field: "vLast6M", align: "right", visu: costanti.VISUCAMPI.PER_EDITORE },
|
||||
{ name: "fatLast6M", label: "Fat 6M", field: "fatLast6M", align: "right", visu: costanti.VISUCAMPI.PER_EDITORE },
|
||||
@@ -167,6 +170,9 @@ export default defineComponent({
|
||||
case 'authors':
|
||||
return formatAuthors(element.productInfo?.authors);
|
||||
|
||||
case 'validato':
|
||||
return element.validaprod?.esito === costanti.VALIDATO.SI ? '<span class="text-bold">SI</span>' : (element.validaprod?.esito === costanti.VALIDATO.TO_RESOLV ? '<span class="text-bold">ERR</span>' : 'NO');
|
||||
|
||||
case 'isbn':
|
||||
return element.isbn;
|
||||
|
||||
@@ -197,6 +203,12 @@ export default defineComponent({
|
||||
case 'date_pub':
|
||||
return tools.getstrDate(element.productInfo?.date_pub);
|
||||
|
||||
case 'prezzo':
|
||||
return tools.getstrDate(element.price);
|
||||
|
||||
case 'prezzo_sconto':
|
||||
return tools.getstrDate(element.sale_price);
|
||||
|
||||
case 'rank3M':
|
||||
return element.productInfo?.rank3M;
|
||||
|
||||
@@ -260,6 +272,15 @@ export default defineComponent({
|
||||
}
|
||||
return '';
|
||||
|
||||
case 'validato':
|
||||
if (element.validaprod?.esito === costanti.VALIDATO.SI) {
|
||||
return 'bg-green';
|
||||
} else if (element.validaprod?.esito === costanti.VALIDATO.TO_RESOLV) {
|
||||
return 'bg-red';
|
||||
} else {
|
||||
return 'bg-grey';
|
||||
}
|
||||
|
||||
case 'quantity':
|
||||
if (products.isPubblicato(element.productInfo)) {
|
||||
if (products.isQtaLimitata(element)) {
|
||||
@@ -291,8 +312,15 @@ export default defineComponent({
|
||||
|
||||
function getFieldStyle(element: any, field: any): Record<string, string> {
|
||||
if (!element)
|
||||
return ''
|
||||
return {}
|
||||
|
||||
switch (field.field) {
|
||||
case 'validato':
|
||||
return {
|
||||
cursor: 'pointer',
|
||||
textAlign: 'center',
|
||||
color: 'white',
|
||||
}
|
||||
case 'image':
|
||||
return {
|
||||
width: '50px',
|
||||
@@ -325,7 +353,7 @@ export default defineComponent({
|
||||
|
||||
let cookieValue: [] | null = null;
|
||||
try {
|
||||
cookieValue = tools.getCookie("selColCat");
|
||||
cookieValue = tools.getCookie("selColCat_2");
|
||||
// Se il cookie esiste e contiene una stringa JSON valida
|
||||
cookieValue = cookieValue ? cookieValue : [];
|
||||
} catch (error) {
|
||||
@@ -333,7 +361,7 @@ export default defineComponent({
|
||||
cookieValue = []; // In caso di errore, inizializza come array vuoto
|
||||
}
|
||||
|
||||
const selectedColumns = ref(cookieValue.length > 0 ? cookieValue : ["pos", "drag", "image", "name", "authors", "isbn", "catprods", "stato", "date_pub", "pagine", "trafiletto", "vLast6M", "quantity", "actions"]);
|
||||
const selectedColumns = ref(cookieValue.length > 0 ? cookieValue : ["pos", "drag", "validato", "image", "name", "authors", "isbn", "catprods", "stato", "date_pub", "pagine", "trafiletto", "fatLast1Y", "quantity", "actions"]);
|
||||
|
||||
|
||||
// 3. Funzione per verificare se una colonna è visibile (isColumnVisible)
|
||||
@@ -358,7 +386,7 @@ export default defineComponent({
|
||||
|
||||
// 8. Salvataggio delle colonne selezionate in un cookie
|
||||
const saveSelectedColumns = () => {
|
||||
tools.setCookie("selColCat", JSON.stringify(selectedColumns.value));
|
||||
tools.setCookie("selColCat_2", JSON.stringify(selectedColumns.value));
|
||||
};
|
||||
|
||||
// 9. Watcher per salvare automaticamente le preferenze quando cambiano
|
||||
@@ -485,6 +513,8 @@ export default defineComponent({
|
||||
|
||||
function getFieldClick(element: any, field: any): (() => void) | null {
|
||||
switch (field.field) {
|
||||
case 'validato':
|
||||
return () => modifyProduct(element)
|
||||
case 'image':
|
||||
return () => showProduct(element);
|
||||
|
||||
|
||||
@@ -7,13 +7,20 @@
|
||||
:options="allColumns"
|
||||
label="Colonne da visualizzare"
|
||||
multiple
|
||||
filled
|
||||
dense
|
||||
class="float-right"
|
||||
outlined
|
||||
emit-value
|
||||
map-options
|
||||
option-value="name"
|
||||
option-label="label"
|
||||
filled
|
||||
style="max-width: 300px"
|
||||
/>
|
||||
style="max-width: 200px"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="settings" />
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
|
||||
<div class="row justify-center q-mx-auto q-pt-sm text-italic">
|
||||
@@ -107,7 +114,7 @@
|
||||
:style="getFieldStyle(element, field)"
|
||||
@click="getFieldClick(element, field)?.()"
|
||||
>
|
||||
{{ getFieldValue(element, field) }}
|
||||
<span v-html="getFieldValue(element, field)"></span>
|
||||
</td>
|
||||
<!-- Azioni -->
|
||||
<td v-else-if="field.name === 'actions' && isColumnVisible('actions', true)">
|
||||
|
||||
@@ -274,6 +274,17 @@ export default defineComponent({
|
||||
|
||||
function getArrListScheda(): IRecFields[] {
|
||||
const arrlist: IRecFields[] = [
|
||||
{
|
||||
editOn: true,
|
||||
label: "Verifica",
|
||||
table: "products",
|
||||
id: myproduct.value._id,
|
||||
rec: myproduct.value,
|
||||
mykey: "validaprod",
|
||||
debounce: "1000",
|
||||
type: costanti.FieldType.verifica,
|
||||
dense: true,
|
||||
},
|
||||
{
|
||||
editOn: true,
|
||||
label: "Titolo",
|
||||
|
||||
Reference in New Issue
Block a user