- Finalmente risolto il calcolo e l'impaginazione del PDF, per WEb e per Stampa (300 dpi) !
- corretto altre cose sulla lista cataloghi.
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
{
|
||||
"singleAttributePerLine": true,
|
||||
"printWidth": 80,
|
||||
"printWidth": 100,
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"semi": true,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "es5",
|
||||
"bracketSpacing": true,
|
||||
|
||||
BIN
alimentazione_sana-stampabile_compressed copia-converted.pdf
Normal file
BIN
alimentazione_sana-stampabile_compressed copia-converted.pdf
Normal file
Binary file not shown.
Binary file not shown.
@@ -2527,5 +2527,10 @@ export const shared_consts = {
|
||||
ONBOTTOM: '1',
|
||||
},
|
||||
|
||||
PREPARA_PDF: {
|
||||
WEB: 1,
|
||||
STAMPA: 2,
|
||||
},
|
||||
PUNTI_PER_POLLICE: 96
|
||||
|
||||
}
|
||||
|
||||
@@ -41,6 +41,16 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
quality: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: 'original',
|
||||
},
|
||||
resize: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
imgGall: {
|
||||
type: Object as PropType<IImgGallery[] | string | undefined | null>,
|
||||
required: true,
|
||||
@@ -62,6 +72,10 @@ export default defineComponent({
|
||||
const fullscreen = ref(false)
|
||||
const fullscreensrc = ref('')
|
||||
|
||||
const uploadOptions = ref({ // qui definisci le opzioni da passare
|
||||
quality: 'original', // esempio di opzione di qualità
|
||||
resize: true // opzione per abilitare il ridimensionamento
|
||||
})
|
||||
|
||||
function isValid(myobj: any): boolean {
|
||||
return (myobj && typeof myobj !== 'string' && typeof myobj !== 'undefined')
|
||||
@@ -101,6 +115,10 @@ export default defineComponent({
|
||||
]
|
||||
}
|
||||
|
||||
uploadOptions.value = {
|
||||
quality: props.quality,
|
||||
resize: props.resize,
|
||||
}
|
||||
}
|
||||
|
||||
function getnumimages() {
|
||||
@@ -396,6 +414,7 @@ export default defineComponent({
|
||||
isListImgValid,
|
||||
costanti,
|
||||
getrealdirectory,
|
||||
uploadOptions,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -81,7 +81,8 @@
|
||||
: 'Aggiungi Immagine'
|
||||
" accept="image/*" :url="getUrl()" :headers="tools.getheaders()" :max-file-size="3000000"
|
||||
:multiple="!single" auto-upload hide-upload-btn no-thumbnails @uploaded="uploaded" @rejected="onRejected"
|
||||
style="width: 208px"></q-uploader>
|
||||
style="width: 208px"
|
||||
:options="uploadOptions"></q-uploader>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -347,6 +347,7 @@ export default defineComponent({
|
||||
myel.value.catalogo.areadistampa.margini = { left: '0.59', top: '0.59', right: '0.59', bottom: '0.28' };
|
||||
myel.value.catalogo.print_isTemplate = false;
|
||||
myel.value.catalogo.print_linkIdTemplate = '';
|
||||
myel.value.catalogo.print_linkIdTemplatePerStampa = '';
|
||||
}
|
||||
|
||||
myel.value.catalogo.areadistampa = tools.resetRecIAreaDiStampa(myel.value.catalogo.areadistampa);
|
||||
@@ -356,6 +357,7 @@ export default defineComponent({
|
||||
myel.value.catalogo.dimensioni_def = {
|
||||
isTemplate: false,
|
||||
linkIdTemplate: '',
|
||||
linkIdTemplatePerStampa: '',
|
||||
name: '',
|
||||
pagina: {},
|
||||
};
|
||||
|
||||
@@ -1489,7 +1489,9 @@
|
||||
:key="recscheda._id"
|
||||
:name="ind"
|
||||
dense
|
||||
:label="`${ind}. ` + recscheda.scheda.name ? recscheda.scheda.name : `Scheda ` + (ind + 1)"
|
||||
:label="
|
||||
`${ind}. ` + recscheda.scheda.name ? recscheda.scheda.name : `Scheda ` + (ind + 1)
|
||||
"
|
||||
>
|
||||
<div class="row">
|
||||
<q-select
|
||||
@@ -1501,7 +1503,7 @@
|
||||
:options="globalStore.getSchedeOpt('SEARCH_')"
|
||||
@update:model-value="modifElem"
|
||||
label="Scheda collegata:"
|
||||
style="width: 250px"
|
||||
style="width: 350px"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
@@ -1780,6 +1782,20 @@
|
||||
label="Pagina di Default"
|
||||
icon="fas fa-play-circle"
|
||||
>
|
||||
<q-select
|
||||
v-model="myel.catalogo.selectedVersionStampabile"
|
||||
:options="[
|
||||
{ label: 'Versione Web', value: shared_consts.PREPARA_PDF.WEB },
|
||||
{ label: 'Versione Stampabile', value: shared_consts.PREPARA_PDF.STAMPA },
|
||||
]"
|
||||
label="Seleziona Versione"
|
||||
emit-value
|
||||
map-options
|
||||
style="width: 300px"
|
||||
@update:model-value="modifElem"
|
||||
>
|
||||
</q-select>
|
||||
|
||||
<q-toggle
|
||||
v-model="myel.catalogo.dimensioni_def.isTemplate"
|
||||
color="positive"
|
||||
@@ -1802,6 +1818,20 @@
|
||||
map-options
|
||||
>
|
||||
</q-select>
|
||||
<q-select
|
||||
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
|
||||
v-if="enableEdit"
|
||||
rounded
|
||||
outlined
|
||||
v-model="myel.catalogo.dimensioni_def.linkIdTemplatePerStampa"
|
||||
:options="Products.getOptCatalogoTemplate()"
|
||||
@update:model-value="modifElem"
|
||||
label="Catalogo collegato per STAMPA:"
|
||||
style="width: 250px"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
</q-select>
|
||||
|
||||
<div
|
||||
v-if="myel.catalogo.dimensioni_def.pagina"
|
||||
@@ -1944,7 +1974,21 @@
|
||||
:options="globalStore.getSchedeOpt()"
|
||||
@update:model-value="modifElem"
|
||||
label="Scheda collegata:"
|
||||
style="width: 250px"
|
||||
style="width: 350px"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
</q-select>
|
||||
<q-select
|
||||
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
|
||||
v-if="enableEdit"
|
||||
rounded
|
||||
outlined
|
||||
v-model="recscheda.scheda.linkIdTemplatePerStampa"
|
||||
:options="globalStore.getSchedeOpt()"
|
||||
@update:model-value="modifElem"
|
||||
label="Scheda collegata STAMPA:"
|
||||
style="width: 350px"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
@@ -2428,13 +2472,32 @@
|
||||
:options="Products.getOptCatalogoPrintTemplate()"
|
||||
@update:model-value="modifElem"
|
||||
label="Catalogo Stampa collegato:"
|
||||
style="width: 250px"
|
||||
style="width: 350px"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
</q-select>
|
||||
<q-select
|
||||
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
|
||||
v-if="enableEdit"
|
||||
rounded
|
||||
outlined
|
||||
v-model="myel.catalogo.print_linkIdTemplatePerStampa"
|
||||
:options="Products.getOptCatalogoPrintTemplate()"
|
||||
@update:model-value="modifElem"
|
||||
label="Catalogo Stampa collegato per STAMPA:"
|
||||
style="width: 350px"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
</q-select>
|
||||
|
||||
<div :class="{ 'sfondo_print': !myel.catalogo.print_linkIdTemplate, 'bg-grey': myel.catalogo.print_linkIdTemplate }">
|
||||
<div
|
||||
:class="{
|
||||
sfondo_print: !myel.catalogo.print_linkIdTemplate,
|
||||
'bg-grey': myel.catalogo.print_linkIdTemplate,
|
||||
}"
|
||||
>
|
||||
Per Stampa:
|
||||
<q-toggle
|
||||
v-model="myel.catalogo.printable"
|
||||
@@ -2456,7 +2519,7 @@
|
||||
|
||||
<q-select
|
||||
rounded
|
||||
style="width: 200px"
|
||||
style="width: 350px"
|
||||
outlined
|
||||
v-model="myel.catalogo.areadistampa.format"
|
||||
:options="tools.SelectListFormatPDF"
|
||||
|
||||
@@ -1,11 +1,4 @@
|
||||
import {
|
||||
PropType,
|
||||
computed,
|
||||
defineComponent,
|
||||
onMounted,
|
||||
ref,
|
||||
watch,
|
||||
} from 'vue';
|
||||
import { PropType, computed, defineComponent, onMounted, ref, watch } from 'vue';
|
||||
import draggable from 'vuedraggable';
|
||||
|
||||
import { tools } from '@tools';
|
||||
@@ -54,6 +47,11 @@ export default defineComponent({
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
idcatalog: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
optcatalogo: {
|
||||
type: Object as PropType<IOptCatalogo>,
|
||||
required: false,
|
||||
@@ -103,7 +101,7 @@ export default defineComponent({
|
||||
|
||||
function handleUpdate(newList) {
|
||||
internalProducts.value = newList;
|
||||
riaggiornaListaProdAlGenitore()
|
||||
riaggiornaListaProdAlGenitore();
|
||||
}
|
||||
|
||||
function riaggiornaListaProdAlGenitore() {
|
||||
@@ -266,6 +264,7 @@ export default defineComponent({
|
||||
field: 'validato',
|
||||
align: 'left',
|
||||
style: '',
|
||||
visu: costanti.VISUCAMPI.PER_EDITORE,
|
||||
},
|
||||
{
|
||||
name: 'scraped',
|
||||
@@ -273,6 +272,7 @@ export default defineComponent({
|
||||
field: 'scraped',
|
||||
align: 'left',
|
||||
style: '',
|
||||
visu: costanti.VISUCAMPI.PER_EDITORE,
|
||||
},
|
||||
{
|
||||
name: 'scraped_error',
|
||||
@@ -280,6 +280,7 @@ export default defineComponent({
|
||||
field: 'scraped_error',
|
||||
align: 'left',
|
||||
style: '',
|
||||
visu: costanti.VISUCAMPI.PER_EDITORE,
|
||||
},
|
||||
{
|
||||
name: 'image',
|
||||
@@ -303,6 +304,7 @@ export default defineComponent({
|
||||
label: 'Sinossi',
|
||||
field: 'trafiletto',
|
||||
align: 'left',
|
||||
visu: costanti.VISUCAMPI.PER_EDITORE,
|
||||
},
|
||||
{
|
||||
name: 'catprods',
|
||||
@@ -421,6 +423,12 @@ export default defineComponent({
|
||||
},
|
||||
]);
|
||||
|
||||
const allColumnsComputed = computed(() => {
|
||||
return allColumns.value.filter(
|
||||
(col) => !col.visu || col.visu === costanti.VISUCAMPI.PER_TUTTI
|
||||
);
|
||||
});
|
||||
|
||||
async function mounted() {
|
||||
console.log('mounted CProductTable');
|
||||
loading.value = true;
|
||||
@@ -515,10 +523,7 @@ export default defineComponent({
|
||||
switch (field.field) {
|
||||
case 'image':
|
||||
return element.productInfo?.imagefile
|
||||
? tools.getFullFileNameByImageFile(
|
||||
'productInfos',
|
||||
element.productInfo?.imagefile
|
||||
)
|
||||
? tools.getFullFileNameByImageFile('productInfos', element.productInfo?.imagefile)
|
||||
: element.productInfo?.image_link;
|
||||
|
||||
case 'name':
|
||||
@@ -538,9 +543,7 @@ export default defineComponent({
|
||||
: 'NO';
|
||||
|
||||
case 'scraped':
|
||||
return element.scraped === true
|
||||
? '<span class="text-bold">SI</span>'
|
||||
: '';
|
||||
return element.scraped === true ? '<span class="text-bold">SI</span>' : '';
|
||||
case 'scraped_error':
|
||||
return element.scraped_error === true
|
||||
? '<span class="text-bold text-red">ERR</span>'
|
||||
@@ -550,8 +553,7 @@ export default defineComponent({
|
||||
return element.isbn;
|
||||
|
||||
case 'trafiletto':
|
||||
return element.productInfo?.descr_trafiletto_catalogo?.length >
|
||||
100
|
||||
return element.productInfo?.descr_trafiletto_catalogo?.length > 100
|
||||
? 'SI ✏️'
|
||||
: 'NO ✏️';
|
||||
|
||||
@@ -562,9 +564,7 @@ export default defineComponent({
|
||||
return element.arrvariazioni?.[0]?.edizione;
|
||||
|
||||
case 'casaeditrice':
|
||||
return products.getCasaEditriceByIdPublisher(
|
||||
element.productInfo?.idPublisher
|
||||
);
|
||||
return products.getCasaEditriceByIdPublisher(element.productInfo?.idPublisher);
|
||||
|
||||
case 'idCollana':
|
||||
return tools.formatCollane(element.productInfo?.idCollana);
|
||||
@@ -575,9 +575,7 @@ export default defineComponent({
|
||||
);
|
||||
|
||||
case 'tipologia':
|
||||
return products.getDescrByIdTipologia(
|
||||
element.arrvariazioni?.[0]?.idTipologia || ''
|
||||
);
|
||||
return products.getDescrByIdTipologia(element.arrvariazioni?.[0]?.idTipologia || '');
|
||||
|
||||
case 'tipoformato':
|
||||
return products.getDescrByIdTipoFormato(
|
||||
@@ -591,9 +589,7 @@ export default defineComponent({
|
||||
return element.price ? '€ ' + element.price.toFixed(2) : '';
|
||||
|
||||
case 'prezzo_sconto':
|
||||
return element.sale_price
|
||||
? '€ ' + element.sale_price.toFixed(2)
|
||||
: '';
|
||||
return element.sale_price ? '€ ' + element.sale_price.toFixed(2) : '';
|
||||
|
||||
case 'rank3M':
|
||||
return element.productInfo?.rank3M;
|
||||
@@ -627,9 +623,7 @@ export default defineComponent({
|
||||
|
||||
case 'quantity':
|
||||
if (tools.isUtente())
|
||||
return tools.getDescrQuantitàByQuantity(
|
||||
element.arrvariazioni?.[0]?.quantita
|
||||
);
|
||||
return tools.getDescrQuantitàByQuantity(element.arrvariazioni?.[0]?.quantita);
|
||||
else return element.arrvariazioni?.[0]?.quantita;
|
||||
|
||||
default:
|
||||
@@ -665,9 +659,7 @@ export default defineComponent({
|
||||
case 'validato':
|
||||
if (element.validaprod?.esito === costanti.VALIDATO.SI) {
|
||||
return 'bg-green';
|
||||
} else if (
|
||||
element.validaprod?.esito === costanti.VALIDATO.TO_RESOLV
|
||||
) {
|
||||
} else if (element.validaprod?.esito === costanti.VALIDATO.TO_RESOLV) {
|
||||
return 'bg-red';
|
||||
} else {
|
||||
return 'bg-grey';
|
||||
@@ -839,19 +831,14 @@ export default defineComponent({
|
||||
persistent: false,
|
||||
})
|
||||
.onOk(() => {
|
||||
internalProducts.value = internalProducts.value.filter(
|
||||
(p: any) => p._id !== product._id
|
||||
);
|
||||
internalProducts.value = internalProducts.value.filter((p: any) => p._id !== product._id);
|
||||
emit('update:lista_prodotti', internalProducts.value); // Notifica il parent del cambiamento
|
||||
});
|
||||
};
|
||||
|
||||
// 8. Salvataggio delle colonne selezionate in un cookie
|
||||
const saveSelectedColumns = () => {
|
||||
tools.setCookie(
|
||||
addstr.value + 'selColCat_2',
|
||||
JSON.stringify(selectedColumns.value)
|
||||
);
|
||||
tools.setCookie(addstr.value + 'selColCat_2', JSON.stringify(selectedColumns.value));
|
||||
};
|
||||
|
||||
// 9. Watcher per salvare automaticamente le preferenze quando cambiano
|
||||
@@ -896,13 +883,20 @@ export default defineComponent({
|
||||
|
||||
function showProduct(element: any) {
|
||||
if (isProduct()) {
|
||||
selProd.value = element;
|
||||
let link_macro = element.productInfo?.link_macro;
|
||||
|
||||
showProd.value = true;
|
||||
if (tools.isUtente() && link_macro) {
|
||||
tools.openUrl(link_macro + '?utm_source=catalog&id=' + props.idcatalog)
|
||||
} else {
|
||||
selProd.value = element;
|
||||
|
||||
showProd.value = true;
|
||||
}
|
||||
} else if (isCatalog()) {
|
||||
// Apri la pagina del catalogo
|
||||
if (element.idPageAssigned) {
|
||||
const mypagepath = productStore.getPathByPage(element.idPageAssigned);
|
||||
|
||||
// fai il route sulla pagina myfilename
|
||||
$router.push(`/${mypagepath}`);
|
||||
}
|
||||
@@ -956,7 +950,7 @@ export default defineComponent({
|
||||
}
|
||||
return prod;
|
||||
});
|
||||
riaggiornaListaProdAlGenitore()
|
||||
riaggiornaListaProdAlGenitore();
|
||||
} catch (e) {
|
||||
console.error('err', e);
|
||||
}
|
||||
@@ -967,12 +961,11 @@ export default defineComponent({
|
||||
loading.value = true;
|
||||
updatefromgm.value = true;
|
||||
field_updated_fromGM.value = '';
|
||||
field_updated_fromGM.value =
|
||||
await globalStore.getGM_FieldOf_T_Web_Articoli(
|
||||
selProd.value.productInfo.sku!,
|
||||
field,
|
||||
shared_consts.CmdQueryMs.GET
|
||||
);
|
||||
field_updated_fromGM.value = await globalStore.getGM_FieldOf_T_Web_Articoli(
|
||||
selProd.value.productInfo.sku!,
|
||||
field,
|
||||
shared_consts.CmdQueryMs.GET
|
||||
);
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
@@ -987,40 +980,36 @@ export default defineComponent({
|
||||
sortAttribute.value = sortAttributeToSort;
|
||||
sortDirection.value = 1;
|
||||
}
|
||||
internalProducts.value = internalProducts.value.sort(
|
||||
(a: any, b: any) => {
|
||||
const aVal = getFieldValue(a, { field: sortAttributeToSort });
|
||||
const bVal = getFieldValue(b, { field: sortAttributeToSort });
|
||||
if (aVal instanceof Date && bVal instanceof Date) {
|
||||
return sortDirection.value === 1
|
||||
? aVal.getTime() - bVal.getTime()
|
||||
: bVal.getTime() - aVal.getTime();
|
||||
}
|
||||
if (
|
||||
typeof aVal === 'string' &&
|
||||
typeof bVal === 'string' &&
|
||||
aVal.match(/^\d{1,2}\/\d{1,2}\/\d{4}$/) &&
|
||||
bVal.match(/^\d{1,2}\/\d{1,2}\/\d{4}$/)
|
||||
) {
|
||||
const aDate = new Date(aVal.split('/').reverse().join('-'));
|
||||
const bDate = new Date(bVal.split('/').reverse().join('-'));
|
||||
return sortDirection.value === 1
|
||||
? aDate.getTime() - bDate.getTime()
|
||||
: bDate.getTime() - aDate.getTime();
|
||||
}
|
||||
if (typeof aVal === 'number' && typeof bVal === 'number') {
|
||||
return sortDirection.value === 1 ? aVal - bVal : bVal - aVal;
|
||||
}
|
||||
if (typeof aVal === 'string' && typeof bVal === 'string') {
|
||||
return sortDirection.value === 1
|
||||
? aVal.localeCompare(bVal)
|
||||
: bVal.localeCompare(aVal);
|
||||
}
|
||||
internalProducts.value = internalProducts.value.sort((a: any, b: any) => {
|
||||
const aVal = getFieldValue(a, { field: sortAttributeToSort });
|
||||
const bVal = getFieldValue(b, { field: sortAttributeToSort });
|
||||
if (aVal instanceof Date && bVal instanceof Date) {
|
||||
return sortDirection.value === 1
|
||||
? String(aVal).localeCompare(String(bVal))
|
||||
: String(bVal).localeCompare(String(aVal));
|
||||
? aVal.getTime() - bVal.getTime()
|
||||
: bVal.getTime() - aVal.getTime();
|
||||
}
|
||||
);
|
||||
if (
|
||||
typeof aVal === 'string' &&
|
||||
typeof bVal === 'string' &&
|
||||
aVal.match(/^\d{1,2}\/\d{1,2}\/\d{4}$/) &&
|
||||
bVal.match(/^\d{1,2}\/\d{1,2}\/\d{4}$/)
|
||||
) {
|
||||
const aDate = new Date(aVal.split('/').reverse().join('-'));
|
||||
const bDate = new Date(bVal.split('/').reverse().join('-'));
|
||||
return sortDirection.value === 1
|
||||
? aDate.getTime() - bDate.getTime()
|
||||
: bDate.getTime() - aDate.getTime();
|
||||
}
|
||||
if (typeof aVal === 'number' && typeof bVal === 'number') {
|
||||
return sortDirection.value === 1 ? aVal - bVal : bVal - aVal;
|
||||
}
|
||||
if (typeof aVal === 'string' && typeof bVal === 'string') {
|
||||
return sortDirection.value === 1 ? aVal.localeCompare(bVal) : bVal.localeCompare(aVal);
|
||||
}
|
||||
return sortDirection.value === 1
|
||||
? String(aVal).localeCompare(String(bVal))
|
||||
: String(bVal).localeCompare(String(aVal));
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1062,9 +1051,7 @@ export default defineComponent({
|
||||
.join('|'),
|
||||
...internalProducts.value.map((product: any) => {
|
||||
return selectedColumns.value
|
||||
.filter(
|
||||
(col) => !allColumns.value.find((c) => c.name === col)?.noexp
|
||||
)
|
||||
.filter((col) => !allColumns.value.find((c) => c.name === col)?.noexp)
|
||||
.map((col: string) => {
|
||||
const field = { field: col };
|
||||
return field.field === 'pos'
|
||||
@@ -1075,8 +1062,7 @@ export default defineComponent({
|
||||
}),
|
||||
].join('\r\n');
|
||||
|
||||
const filename =
|
||||
'prodotti_' + new Date().toISOString().slice(0, 10) + '.csv';
|
||||
const filename = 'prodotti_' + new Date().toISOString().slice(0, 10) + '.csv';
|
||||
const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' });
|
||||
const link = document.createElement('a');
|
||||
const url = URL.createObjectURL(blob);
|
||||
@@ -1091,10 +1077,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function isSortable(field: string): boolean {
|
||||
return (
|
||||
allColumns &&
|
||||
!allColumns.value.find((col) => col.name === field)?.notsortable
|
||||
);
|
||||
return allColumns && !allColumns.value.find((col) => col.name === field)?.notsortable;
|
||||
}
|
||||
|
||||
function getImageByElement(element) {
|
||||
@@ -1161,6 +1144,7 @@ export default defineComponent({
|
||||
isVisibleEditBtn,
|
||||
isProduct,
|
||||
isCatalog,
|
||||
allColumnsComputed,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<div class="q-mb-md text-right">
|
||||
<q-select
|
||||
v-model="selectedColumns"
|
||||
:options="allColumns"
|
||||
:options="allColumnsComputed"
|
||||
label="Colonne da visualizzare"
|
||||
multiple
|
||||
filled
|
||||
@@ -42,7 +42,7 @@
|
||||
<!-- Intestazioni (Thead) -->
|
||||
<thead>
|
||||
<tr>
|
||||
<template v-for="col in allColumns">
|
||||
<template v-for="col in allColumnsComputed">
|
||||
<th
|
||||
v-if="isColumnVisible(col.name)"
|
||||
:key="col.name"
|
||||
@@ -90,7 +90,7 @@
|
||||
}"
|
||||
>
|
||||
<template
|
||||
v-for="field in allColumns"
|
||||
v-for="field in allColumnsComputed"
|
||||
:key="field.name"
|
||||
>
|
||||
<!-- Icona Drag Handle -->
|
||||
|
||||
@@ -199,40 +199,6 @@ export default defineComponent({
|
||||
return lista && lista.value && lista.value._id ? lista.value._id : '';
|
||||
}
|
||||
|
||||
function populateDataWithlinkIdTemplate() {
|
||||
// console.log('populateDataWithlinkIdTemplate')
|
||||
|
||||
if (optcatalogo.value) {
|
||||
// LINK PAGINA
|
||||
if (optcatalogo.value.dimensioni_def.linkIdTemplate) {
|
||||
const reccatalog = globalStore.sovrascriviPaginaDefaultFromTemplate(optcatalogo.value.dimensioni_def.linkIdTemplate, optcatalogo.value.dimensioni_def);
|
||||
if (reccatalog) {
|
||||
optcatalogo.value.dimensioni_def.pagina = { ...reccatalog.dimensioni_def.pagina};
|
||||
}
|
||||
}
|
||||
|
||||
if (optcatalogo.value.print_linkIdTemplate) {
|
||||
const reccatalog = globalStore.sovrascriviAreadistampaFromTemplate(optcatalogo.value.print_linkIdTemplate, optcatalogo.value);
|
||||
if (reccatalog) {
|
||||
optcatalogo.value.areadistampa = { ...reccatalog.areadistampa};
|
||||
}
|
||||
}
|
||||
|
||||
// LINK SCHEDA
|
||||
for (const recscheda of optcatalogo.value.arrSchede!) {
|
||||
if (recscheda.scheda?.linkIdTemplate) {
|
||||
// ricopia da Template:
|
||||
const myscheda = globalStore.sovrascriviSchedaFromTemplate(recscheda.scheda?.linkIdTemplate, recscheda);
|
||||
if (myscheda) {
|
||||
recscheda.scheda = { ...myscheda };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// console.log(' FINE - populateDataWithlinkIdTemplate')
|
||||
}
|
||||
|
||||
function isProductLibro() {
|
||||
return props.table === 'products';
|
||||
}
|
||||
@@ -264,7 +230,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
if (props.nameLinkTemplate) {
|
||||
populateDataWithlinkIdTemplate();
|
||||
optcatalogo.value = productStore.populateDataWithlinkIdTemplate(optcatalogo.value);
|
||||
}
|
||||
|
||||
if (props.visu === shared_consts.VISU_SEARCHPROD_MODE.INSERT) {
|
||||
|
||||
@@ -794,6 +794,7 @@ export interface IAreaDiStampa {
|
||||
export interface IElementiPagina {
|
||||
isTemplate?: boolean,
|
||||
linkIdTemplate?: string,
|
||||
linkIdTemplatePerStampa?: string,
|
||||
name?: string,
|
||||
pagina: IDimensioni
|
||||
}
|
||||
@@ -818,6 +819,7 @@ export interface IMyScheda {
|
||||
isTemplate?: boolean,
|
||||
isPagIntro?: boolean,
|
||||
linkIdTemplate?: string,
|
||||
linkIdTemplatePerStampa?: string,
|
||||
name?: string,
|
||||
numschede_perRiga?: number
|
||||
numschede_perCol?: number
|
||||
@@ -905,11 +907,13 @@ export interface IOptCatalogo {
|
||||
|
||||
print_isTemplate?: boolean
|
||||
print_linkIdTemplate?: string
|
||||
print_linkIdTemplatePerStampa?: string
|
||||
|
||||
dimensioni_def?: IElementiPagina
|
||||
|
||||
arrSchede?: ISchedaSingola[]
|
||||
aggiorna?: number
|
||||
selectedVersionStampabile?: number
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ export default defineComponent({
|
||||
};
|
||||
|
||||
const convertPdf = async () => {
|
||||
globalStore.convertPdf(pdfFile.value, width.value, height.value, compressione.value)
|
||||
globalStore.convertPdf(pdfFile.value, true, width.value, height.value, compressione.value)
|
||||
}
|
||||
|
||||
const execPdf = async () => {
|
||||
|
||||
@@ -366,6 +366,7 @@ export const colmyScheda = [
|
||||
AddCol({ name: 'isTemplate', label_trans: 'scheda.isTemplate', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'isPagIntro', label_trans: 'scheda.isPagIntro', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'linkIdTemplate', label_trans: 'scheda.linkIdTemplate', fieldtype: costanti.FieldType.string }),
|
||||
AddCol({ name: 'linkIdTemplatePerStampa', label_trans: 'scheda.linkIdTemplatePerStampa', fieldtype: costanti.FieldType.string }),
|
||||
AddCol({ name: 'widthscheda', label_trans: 'scheda.widthscheda', fieldtype: costanti.FieldType.number }),
|
||||
AddCol({ name: 'widthpag', label_trans: 'scheda.widthpag', fieldtype: costanti.FieldType.number }),
|
||||
AddCol({ name: 'widthimg', label_trans: 'scheda.widthimg', fieldtype: costanti.FieldType.number }),
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -215,17 +215,12 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
getters: {
|
||||
sovrascriviSchedaFromTemplate:
|
||||
(state: IGlobalState) =>
|
||||
(
|
||||
idTemplate: string,
|
||||
origScheda: ISchedaSingola,
|
||||
optcatalogo: IOptCatalogo
|
||||
) => {
|
||||
(idTemplate: string, origScheda: ISchedaSingola, optcatalogo: IOptCatalogo) => {
|
||||
const arrschede: ISchedaSingola[] = state.myschedas;
|
||||
const myfindscheda = arrschede.find(
|
||||
(recscheda: ISchedaSingola) => recscheda.scheda?._id === idTemplate
|
||||
);
|
||||
|
||||
const linkIdTemplate = origScheda.scheda?.linkIdTemplate;
|
||||
const precname = origScheda.scheda?.name;
|
||||
|
||||
if (myfindscheda) {
|
||||
@@ -235,7 +230,9 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
myschedatocopy.scheda._id = origScheda.scheda?._id;
|
||||
myschedatocopy.scheda.isTemplate = false;
|
||||
myschedatocopy.scheda.name = precname;
|
||||
myschedatocopy.scheda.linkIdTemplate = linkIdTemplate;
|
||||
myschedatocopy.scheda.linkIdTemplatePerStampa =
|
||||
origScheda.scheda?.linkIdTemplatePerStampa;
|
||||
myschedatocopy.scheda.linkIdTemplate = origScheda.scheda?.linkIdTemplate;
|
||||
|
||||
return myschedatocopy.scheda;
|
||||
}
|
||||
@@ -245,13 +242,9 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
},
|
||||
|
||||
sovrascriviPaginaDefaultFromTemplate:
|
||||
(state: IGlobalState) =>
|
||||
(idTemplate: string, origDimensioni: IDimensioni) => {
|
||||
const myfindelem = state.myelems.find(
|
||||
(myelem: IMyElem) => myelem._id === idTemplate
|
||||
);
|
||||
(state: IGlobalState) => (idTemplate: string, origDimensioni: IDimensioni) => {
|
||||
const myfindelem = state.myelems.find((myelem: IMyElem) => myelem._id === idTemplate);
|
||||
|
||||
const linkIdTemplate = origDimensioni.linkIdTemplate;
|
||||
const precname = origDimensioni.name;
|
||||
|
||||
if (myfindelem) {
|
||||
@@ -261,8 +254,9 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
// myelemtocopy.scheda._id = origScheda.scheda?._id;
|
||||
myelemtocopy.catalogo.dimensioni_def.isTemplate = false;
|
||||
myelemtocopy.catalogo.dimensioni_def.name = precname;
|
||||
myelemtocopy.catalogo.dimensioni_def.linkIdTemplate =
|
||||
linkIdTemplate;
|
||||
myelemtocopy.catalogo.dimensioni_def.linkIdTemplatePerStampa =
|
||||
origDimensioni.linkIdTemplatePerStampa;
|
||||
myelemtocopy.catalogo.dimensioni_def.linkIdTemplate = origDimensioni.linkIdTemplate;
|
||||
|
||||
return myelemtocopy.catalogo;
|
||||
}
|
||||
@@ -272,21 +266,26 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
},
|
||||
|
||||
sovrascriviAreadistampaFromTemplate:
|
||||
(state: IGlobalState) =>
|
||||
(idTemplate: string, optCatalogo: IOptCatalogo) => {
|
||||
const myfindelem = state.myelems.find(
|
||||
(myelem: IMyElem) => myelem._id === idTemplate
|
||||
);
|
||||
|
||||
const linkIdTemplate = optCatalogo.print_linkIdTemplate;
|
||||
(state: IGlobalState) => (idTemplate: string, optCatalogo: IOptCatalogo) => {
|
||||
const myfindelem = state.myelems.find((myelem: IMyElem) => myelem._id === idTemplate);
|
||||
|
||||
if (myfindelem) {
|
||||
const myelemtocopy = tools.jsonCopy(myfindelem);
|
||||
|
||||
if (myelemtocopy) {
|
||||
const linkIdTemplate =
|
||||
myelemtocopy.catalogo.selectedVersionStampabile === shared_consts.PREPARA_PDF.STAMPA
|
||||
? myelemtocopy.catalogo.print_linkIdTemplate
|
||||
: myelemtocopy.catalogo.print_linkIdTemplatePerStampa;
|
||||
// myelemtocopy.scheda._id = origScheda.scheda?._id;
|
||||
myelemtocopy.catalogo.print_isTemplate = false;
|
||||
myelemtocopy.catalogo.print_linkIdTemplate = linkIdTemplate;
|
||||
if (
|
||||
myelemtocopy.catalogo.selectedVersionStampabile === shared_consts.PREPARA_PDF.STAMPA
|
||||
)
|
||||
myelemtocopy.catalogo.print_linkIdTemplatePerStampa = linkIdTemplate;
|
||||
else {
|
||||
myelemtocopy.catalogo.print_linkIdTemplate = linkIdTemplate;
|
||||
}
|
||||
|
||||
return myelemtocopy.catalogo;
|
||||
}
|
||||
@@ -316,32 +315,24 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
},
|
||||
|
||||
getColByStatusSkills: (state: IGlobalState) => (id: number) => {
|
||||
const ctrec = state.statusSkills.find(
|
||||
(mystatus: IStatusSkill) => mystatus._id === id
|
||||
);
|
||||
const ctrec = state.statusSkills.find((mystatus: IStatusSkill) => mystatus._id === id);
|
||||
return ctrec && ctrec.color ? ctrec.color : 'green';
|
||||
},
|
||||
|
||||
getStatusSkillById: (state: IGlobalState) => (id: number) => {
|
||||
const ctrec = state.statusSkills.find(
|
||||
(mystatus: IStatusSkill) => mystatus._id === id
|
||||
);
|
||||
const ctrec = state.statusSkills.find((mystatus: IStatusSkill) => mystatus._id === id);
|
||||
return ctrec ? ctrec.descr : '';
|
||||
},
|
||||
|
||||
getStatusSkillIconById: (state: IGlobalState) => (id: number) => {
|
||||
const ctrec = state.statusSkills.find(
|
||||
(mystatus: IStatusSkill) => mystatus._id === id
|
||||
);
|
||||
const ctrec = state.statusSkills.find((mystatus: IStatusSkill) => mystatus._id === id);
|
||||
return ctrec ? ctrec.icon : '';
|
||||
},
|
||||
|
||||
isNewVersionAvailable: (state: IGlobalState) => {
|
||||
// console.log('cfgServer', cfgServer)
|
||||
const serversrec = state.cfgServer.find(
|
||||
(x) =>
|
||||
x.chiave === toolsext.SERVKEY_VERS &&
|
||||
x.idapp === tools.getEnv('VITE_APP_ID')
|
||||
(x) => x.chiave === toolsext.SERVKEY_VERS && x.idapp === tools.getEnv('VITE_APP_ID')
|
||||
);
|
||||
// console.log('Record ', serversrec)
|
||||
if (serversrec) {
|
||||
@@ -383,9 +374,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
isMyLang: (state: IGlobalState) => (rec: any) => {
|
||||
if (!rec.lang) return true;
|
||||
|
||||
return (
|
||||
rec.lang === toolsext.getLocale(false) || toolsext.getLocale() === ''
|
||||
);
|
||||
return rec.lang === toolsext.getLocale(false) || toolsext.getLocale() === '';
|
||||
},
|
||||
|
||||
getPage:
|
||||
@@ -429,9 +418,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
.sort((a: any, b: any) => a.order - b.order);
|
||||
|
||||
// Trova l'indice dell'elemento con _id = idelem
|
||||
const index = sortedElems.findIndex(
|
||||
(elem: IMyElem) => elem._id === idelem
|
||||
);
|
||||
const index = sortedElems.findIndex((elem: IMyElem) => elem._id === idelem);
|
||||
|
||||
// ritorna l'elemento precedente
|
||||
if (index > 0) {
|
||||
@@ -450,9 +437,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
.sort((a: any, b: any) => a.order - b.order);
|
||||
|
||||
// Trova l'indice dell'elemento con _id = idelem
|
||||
const index = sortedElems.findIndex(
|
||||
(elem: IMyElem) => elem._id === idelem
|
||||
);
|
||||
const index = sortedElems.findIndex((elem: IMyElem) => elem._id === idelem);
|
||||
|
||||
// ritorna l'elemento successivo
|
||||
if (index < sortedElems.length - 1) {
|
||||
@@ -518,16 +503,14 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
else if (table === toolsext.TABNEWSLETTER) ris = state.newstosent;
|
||||
else if (table === toolsext.TABGALLERY) ris = state.gallery;
|
||||
else if (table === toolsext.TABTEMPLEMAIL) ris = state.templemail;
|
||||
else if (table === toolsext.TABDESTNEWSLETTER)
|
||||
ris = state.destnewsletter;
|
||||
else if (table === toolsext.TABDESTNEWSLETTER) ris = state.destnewsletter;
|
||||
else if (table === toolsext.TABOPZEMAIL) ris = state.opzemail;
|
||||
else if (table === toolsext.TABMAILINGLIST) ris = state.mailinglist;
|
||||
else if (table === toolsext.TABMYPAGE) ris = state.mypage;
|
||||
else if (table === 'mypages_id') ris = state.mypage;
|
||||
else if (table === toolsext.TABMYELEMS) ris = state.myelems;
|
||||
else if (table === toolsext.TABCATALOGS) ris = catalogStore.catalogs!;
|
||||
else if (table === toolsext.TABRACCOLTA_CATALOGHI)
|
||||
ris = catalogStore.raccoltacataloghis!;
|
||||
else if (table === toolsext.TABRACCOLTA_CATALOGHI) ris = catalogStore.raccoltacataloghis!;
|
||||
else if (table === toolsext.TABCALZOOM) ris = state.calzoom;
|
||||
else if (table === 'producers') ris = state.producers;
|
||||
else if (table === 'storehouses') ris = state.storehouses;
|
||||
@@ -550,8 +533,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
else if (table === 'authors') ris = Products.authors;
|
||||
else if (table === 'publishers') ris = Products.publishers;
|
||||
else if (table === 'publishers_totali') ris = Products.publishers;
|
||||
else if (table === 't_web_statiprodottos')
|
||||
ris = Products.stati_prodotto;
|
||||
else if (table === 't_web_statiprodottos') ris = Products.stati_prodotto;
|
||||
else if (table === 't_web_tipologies') ris = Products.tipologie;
|
||||
else if (table === 't_web_tipiformatos') ris = Products.tipoformato;
|
||||
else if (table === 'catais') ris = state.catAI;
|
||||
@@ -559,20 +541,15 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
else if (table === 'sharewithus') ris = state.sharewithus;
|
||||
else if (table === 'paymenttypes') ris = state.paymenttypes;
|
||||
else if (table === 'circuits') ris = circuitStore.listcircuits;
|
||||
else if (table === 'listcircuits')
|
||||
ris = circuitStore.getCircuitsLabelValue();
|
||||
else if (table === 'listaccounts')
|
||||
ris = circuitStore.getAccountsListNameValue();
|
||||
else if (table === 'listcircuits') ris = circuitStore.getCircuitsLabelValue();
|
||||
else if (table === 'listaccounts') ris = circuitStore.getAccountsListNameValue();
|
||||
else if (table === 'bookings') return calendarStore.bookedevent;
|
||||
else if (table === 'users') return userStore.usersList;
|
||||
else if (table === 'friends') return userStore.my.profile.friends;
|
||||
else if (table === 'lista_editori') {
|
||||
ris = userStore.listaEditori;
|
||||
} else if (table === 'friendsandme')
|
||||
return [
|
||||
{ username: userStore.my.username },
|
||||
...userStore.my.profile.friends,
|
||||
];
|
||||
return [{ username: userStore.my.username }, ...userStore.my.profile.friends];
|
||||
// else if (table === 'mygroups')
|
||||
// return userStore.groups
|
||||
else if (table === 'mygroups') return state.mygroups;
|
||||
@@ -590,12 +567,10 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
else if (table === toolsext.TABSECTORS) return state.sectors;
|
||||
else if (table === 'sectorgoods') return state.sectorgoods;
|
||||
else if (table === 'catgrps') return state.catgrps;
|
||||
else if (table === 'schedeopt')
|
||||
return Products.getSchedeOpt(state.myschedas);
|
||||
else if (table === 'schedeopt') return Products.getSchedeOpt(state.myschedas);
|
||||
else if (table === 'provinces')
|
||||
return state.provinces.filter(
|
||||
(rec: IProvince) =>
|
||||
!rec.card && rec.prov !== 'ITA' && rec.prov !== 'EST'
|
||||
(rec: IProvince) => !rec.card && rec.prov !== 'ITA' && rec.prov !== 'EST'
|
||||
);
|
||||
else if (table === 'cards') {
|
||||
const arrprov: any[] = state.provinces.filter(
|
||||
@@ -603,9 +578,10 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
);
|
||||
if (arrprov) {
|
||||
// const idCardArray: { _id: number, card: string }[] = arrprov.map(({ _id, card }) => ({ _id, card }));
|
||||
const idCardArray: { card: string; label: string }[] = arrprov.map(
|
||||
({ card }) => ({ card, label: card })
|
||||
);
|
||||
const idCardArray: { card: string; label: string }[] = arrprov.map(({ card }) => ({
|
||||
card,
|
||||
label: card,
|
||||
}));
|
||||
return idCardArray;
|
||||
}
|
||||
return [];
|
||||
@@ -625,8 +601,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
return ris;
|
||||
},
|
||||
|
||||
getCmdClick: (state: IGlobalState): string =>
|
||||
state.clickcmd ? state.clickcmd : '',
|
||||
getCmdClick: (state: IGlobalState): string => (state.clickcmd ? state.clickcmd : ''),
|
||||
|
||||
gettemplemailbyId:
|
||||
(mystate: IGlobalState) =>
|
||||
@@ -637,9 +612,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
getdestnewsletterbyId:
|
||||
(mystate: IGlobalState) =>
|
||||
(id: string): string => {
|
||||
const myrec = mystate.destnewsletter.find(
|
||||
(rec: IDestNewsletter) => rec._id === id
|
||||
);
|
||||
const myrec = mystate.destnewsletter.find((rec: IDestNewsletter) => rec._id === id);
|
||||
return !!myrec ? myrec.descr! : '';
|
||||
},
|
||||
},
|
||||
@@ -662,15 +635,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
return [];
|
||||
},
|
||||
|
||||
setValueSettingsByKey({
|
||||
key,
|
||||
value,
|
||||
serv,
|
||||
}: {
|
||||
key: string;
|
||||
value: any;
|
||||
serv: boolean;
|
||||
}): any {
|
||||
setValueSettingsByKey({ key, value, serv }: { key: string; value: any; serv: boolean }): any {
|
||||
// Update the Server
|
||||
|
||||
// Update in Memory
|
||||
@@ -679,18 +644,14 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
else myrec = this.settings.find((rec: any) => rec.key === key);
|
||||
|
||||
if (myrec) {
|
||||
if (
|
||||
myrec.type === costanti.FieldType.date ||
|
||||
myrec.type === costanti.FieldType.onlydate
|
||||
)
|
||||
if (myrec.type === costanti.FieldType.date || myrec.type === costanti.FieldType.onlydate)
|
||||
myrec.value_date = value;
|
||||
else if (
|
||||
myrec.type === costanti.FieldType.number ||
|
||||
myrec.type === costanti.FieldType.hours
|
||||
)
|
||||
myrec.value_num = value;
|
||||
else if (myrec.type === costanti.FieldType.boolean)
|
||||
myrec.value_bool = value;
|
||||
else if (myrec.type === costanti.FieldType.boolean) myrec.value_bool = value;
|
||||
else myrec.value_str = value;
|
||||
|
||||
// console.log('setValueSettingsByKey value', value, 'myrec', myrec)
|
||||
@@ -701,19 +662,12 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
const myrec = this.getrecSettingsByKey(key, serv);
|
||||
// console.log('getValueSettingsByKey', myrec, 'key=', key, 'srv=', serv)
|
||||
if (myrec) {
|
||||
if (
|
||||
myrec.type === costanti.FieldType.date ||
|
||||
myrec.type === costanti.FieldType.onlydate
|
||||
)
|
||||
if (myrec.type === costanti.FieldType.date || myrec.type === costanti.FieldType.onlydate)
|
||||
return myrec.value_date;
|
||||
if (
|
||||
myrec.type === costanti.FieldType.number ||
|
||||
myrec.type === costanti.FieldType.hours
|
||||
)
|
||||
if (myrec.type === costanti.FieldType.number || myrec.type === costanti.FieldType.hours)
|
||||
return myrec.value_num;
|
||||
if (myrec.type === costanti.FieldType.boolean) return myrec.value_bool;
|
||||
else if (myrec.type === costanti.FieldType.crypted)
|
||||
return '***********';
|
||||
else if (myrec.type === costanti.FieldType.crypted) return '***********';
|
||||
else if (myrec.value_str === undefined) {
|
||||
return '';
|
||||
} else {
|
||||
@@ -880,9 +834,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
}*/
|
||||
|
||||
// Sort array
|
||||
static_data.routes = static_data.routes.sort(
|
||||
(a, myb) => a.order - myb.order
|
||||
);
|
||||
static_data.routes = static_data.routes.sort((a, myb) => a.order - myb.order);
|
||||
|
||||
// console.log('static_data.routes', static_data.routes)
|
||||
|
||||
@@ -943,10 +895,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
|
||||
setleftDrawerOpen(bool: boolean) {
|
||||
this.leftDrawerOpen = bool;
|
||||
tools.localStSetItem(
|
||||
toolsext.localStorage.leftDrawerOpen,
|
||||
bool.toString()
|
||||
);
|
||||
tools.localStSetItem(toolsext.localStorage.leftDrawerOpen, bool.toString());
|
||||
},
|
||||
|
||||
setCategorySel(cat: string | null) {
|
||||
@@ -1558,18 +1507,9 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
|
||||
const obj = { test: 'OK! Versione Client: ' + tools.getvers(), timeout };
|
||||
|
||||
return Api.SendReq(
|
||||
'/api/test-lungo',
|
||||
'POST',
|
||||
obj,
|
||||
false,
|
||||
false,
|
||||
0,
|
||||
5000,
|
||||
null,
|
||||
null,
|
||||
{ timeout }
|
||||
)
|
||||
return Api.SendReq('/api/test-lungo', 'POST', obj, false, false, 0, 5000, null, null, {
|
||||
timeout,
|
||||
})
|
||||
.then((res) => {
|
||||
return res;
|
||||
})
|
||||
@@ -1922,13 +1862,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
});
|
||||
},
|
||||
|
||||
async GetArrDoniNavi({
|
||||
ricalcola,
|
||||
showall,
|
||||
}: {
|
||||
ricalcola: boolean;
|
||||
showall: boolean;
|
||||
}) {
|
||||
async GetArrDoniNavi({ ricalcola, showall }: { ricalcola: boolean; showall: boolean }) {
|
||||
console.log('GetArrDoniNavi');
|
||||
|
||||
const mydata = {
|
||||
@@ -1952,13 +1886,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
});
|
||||
},
|
||||
|
||||
async GetFlotte({
|
||||
ricalcola,
|
||||
showall,
|
||||
}: {
|
||||
ricalcola: boolean;
|
||||
showall: boolean;
|
||||
}) {
|
||||
async GetFlotte({ ricalcola, showall }: { ricalcola: boolean; showall: boolean }) {
|
||||
console.log('GetFlotte');
|
||||
|
||||
const mydata = {
|
||||
@@ -2016,11 +1944,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
},
|
||||
|
||||
async loadTest(ind: number, numval: number) {
|
||||
const restest = await Api.SendReq(
|
||||
`/testpao/?numval=${numval}&ind=${ind}`,
|
||||
'GET',
|
||||
null
|
||||
);
|
||||
const restest = await Api.SendReq(`/testpao/?numval=${numval}&ind=${ind}`, 'GET', null);
|
||||
return restest;
|
||||
},
|
||||
|
||||
@@ -2052,103 +1976,55 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
console.log('____________________________ res', res);
|
||||
this.serverError = false;
|
||||
if (res.status === 200) {
|
||||
calendarStore.bookedevent = res.data.bookedevent
|
||||
? res.data.bookedevent
|
||||
: [];
|
||||
calendarStore.eventlist = res.data.eventlist
|
||||
? res.data.eventlist
|
||||
: [];
|
||||
calendarStore.operators = res.data.operators
|
||||
? res.data.operators
|
||||
: [];
|
||||
calendarStore.internalpages = res.data.internalpages
|
||||
? res.data.internalpages
|
||||
: [];
|
||||
calendarStore.bookedevent = res.data.bookedevent ? res.data.bookedevent : [];
|
||||
calendarStore.eventlist = res.data.eventlist ? res.data.eventlist : [];
|
||||
calendarStore.operators = res.data.operators ? res.data.operators : [];
|
||||
calendarStore.internalpages = res.data.internalpages ? res.data.internalpages : [];
|
||||
calendarStore.wheres = res.data.wheres ? res.data.wheres : [];
|
||||
calendarStore.contribtype = res.data.contribtype
|
||||
? res.data.contribtype
|
||||
: [];
|
||||
calendarStore.contribtype = res.data.contribtype ? res.data.contribtype : [];
|
||||
|
||||
circuitStore.listcircuits = res.data.listcircuits
|
||||
? res.data.listcircuits
|
||||
: [];
|
||||
circuitStore.listaccounts = res.data.listaccounts
|
||||
? res.data.listaccounts
|
||||
: [];
|
||||
circuitStore.listcircuits = res.data.listcircuits ? res.data.listcircuits : [];
|
||||
circuitStore.listaccounts = res.data.listaccounts ? res.data.listaccounts : [];
|
||||
|
||||
catalogStore.catalogs = res.data.catalogs;
|
||||
catalogStore.raccoltacataloghis = res.data.raccoltacataloghis;
|
||||
|
||||
this.settings = res.data.settings ? [...res.data.settings] : [];
|
||||
this.disciplines = res.data.disciplines
|
||||
? [...res.data.disciplines]
|
||||
: [];
|
||||
this.paymenttypes = res.data.paymenttypes
|
||||
? [...res.data.paymenttypes]
|
||||
: [];
|
||||
this.disciplines = res.data.disciplines ? [...res.data.disciplines] : [];
|
||||
this.paymenttypes = res.data.paymenttypes ? [...res.data.paymenttypes] : [];
|
||||
this.gallery = res.data.gallery ? [...res.data.gallery] : [];
|
||||
this.calzoom = res.data.calzoom ? [...res.data.calzoom] : [];
|
||||
Products.products = res.data.products ? [...res.data.products] : [];
|
||||
Products.productInfos = res.data.productInfos
|
||||
? [...res.data.productInfos]
|
||||
: [];
|
||||
Products.productInfos = res.data.productInfos ? [...res.data.productInfos] : [];
|
||||
this.producers = res.data.producers ? [...res.data.producers] : [];
|
||||
this.storehouses = res.data.storehouses
|
||||
? [...res.data.storehouses]
|
||||
: [];
|
||||
this.storehouses = res.data.storehouses ? [...res.data.storehouses] : [];
|
||||
this.providers = res.data.providers ? [...res.data.providers] : [];
|
||||
|
||||
Products.catprods = res.data.catprods ? [...res.data.catprods] : [];
|
||||
Products.catprtotali = res.data.catprtotali
|
||||
? [...res.data.catprtotali]
|
||||
: [];
|
||||
Products.catprtotali = res.data.catprtotali ? [...res.data.catprtotali] : [];
|
||||
Products.collane = res.data.collane ? [...res.data.collane] : [];
|
||||
Products.subcatprods = res.data.subcatprods
|
||||
? [...res.data.subcatprods]
|
||||
: [];
|
||||
Products.stati_prodotto = res.data.stati_prodotto
|
||||
? [...res.data.stati_prodotto]
|
||||
: [];
|
||||
Products.tipologie = res.data.tipologie
|
||||
? [...res.data.tipologie]
|
||||
: [];
|
||||
Products.tipoformato = res.data.tipoformato
|
||||
? [...res.data.tipoformato]
|
||||
: [];
|
||||
Products.catprods_gas = res.data.catprods_gas
|
||||
? [...res.data.catprods_gas]
|
||||
: [];
|
||||
Products.subcatprods = res.data.subcatprods ? [...res.data.subcatprods] : [];
|
||||
Products.stati_prodotto = res.data.stati_prodotto ? [...res.data.stati_prodotto] : [];
|
||||
Products.tipologie = res.data.tipologie ? [...res.data.tipologie] : [];
|
||||
Products.tipoformato = res.data.tipoformato ? [...res.data.tipoformato] : [];
|
||||
Products.catprods_gas = res.data.catprods_gas ? [...res.data.catprods_gas] : [];
|
||||
Products.authors = res.data.authors ? [...res.data.authors] : [];
|
||||
Products.publishers = res.data.publishers
|
||||
? [...res.data.publishers]
|
||||
: [];
|
||||
Products.publishers = res.data.publishers ? [...res.data.publishers] : [];
|
||||
|
||||
this.gasordines = res.data.gasordines
|
||||
? [...res.data.gasordines]
|
||||
: [];
|
||||
this.scontisticas = res.data.scontisticas
|
||||
? [...res.data.scontisticas]
|
||||
: [];
|
||||
this.gasordines = res.data.gasordines ? [...res.data.gasordines] : [];
|
||||
this.scontisticas = res.data.scontisticas ? [...res.data.scontisticas] : [];
|
||||
this.groups = res.data.groups ? [...res.data.groups] : [];
|
||||
this.resps = res.data.resps ? [...res.data.resps] : [];
|
||||
this.workers = res.data.workers ? [...res.data.workers] : [];
|
||||
this.departments = res.data.departments
|
||||
? [...res.data.departments]
|
||||
: [];
|
||||
this.categories = res.data.categories
|
||||
? [...res.data.categories]
|
||||
: [];
|
||||
this.departments = res.data.departments ? [...res.data.departments] : [];
|
||||
this.categories = res.data.categories ? [...res.data.categories] : [];
|
||||
this.levels = res.data.levels ? [...res.data.levels] : [];
|
||||
this.skills = res.data.skills ? [...res.data.skills] : [];
|
||||
this.goods = res.data.goods ? [...res.data.goods] : [];
|
||||
// this.subSkills = (res.data.subSkills) ? [...res.data.subSkills] : []
|
||||
this.statusSkills = res.data.statusSkills
|
||||
? [...res.data.statusSkills]
|
||||
: [];
|
||||
this.statusSkills = res.data.statusSkills ? [...res.data.statusSkills] : [];
|
||||
this.sectors = res.data.sectors ? [...res.data.sectors] : [];
|
||||
this.sectorgoods = res.data.sectorgoods
|
||||
? [...res.data.sectorgoods]
|
||||
: [];
|
||||
this.sectorgoods = res.data.sectorgoods ? [...res.data.sectorgoods] : [];
|
||||
this.provinces = res.data.provinces ? [...res.data.provinces] : [];
|
||||
this.catgrps = res.data.catgrps ? [...res.data.catgrps] : [];
|
||||
this.catAI = res.data.catAI ? [...res.data.catAI] : [];
|
||||
@@ -2156,14 +2032,11 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
this.site = res.data.site ? res.data.site : {};
|
||||
this.mygroups = res.data.mygroups ? [...res.data.mygroups] : [];
|
||||
this.adtypes = res.data.adtypes ? [...res.data.adtypes] : [];
|
||||
this.adtypegoods = res.data.adtypegoods
|
||||
? [...res.data.adtypegoods]
|
||||
: [];
|
||||
this.adtypegoods = res.data.adtypegoods ? [...res.data.adtypegoods] : [];
|
||||
|
||||
// console.log('res.data.cart', res.data.cart)
|
||||
|
||||
if (res.data.cart)
|
||||
Products.cart = res.data.cart ? { ...res.data.cart } : {};
|
||||
if (res.data.cart) Products.cart = res.data.cart ? { ...res.data.cart } : {};
|
||||
else
|
||||
Products.cart = {
|
||||
items: [],
|
||||
@@ -2175,12 +2048,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
Products.orders = res.data.orders ? [...res.data.orders] : [];
|
||||
|
||||
if (showall) {
|
||||
this.newstosent = res.data.newstosent
|
||||
? [...res.data.newstosent]
|
||||
: [];
|
||||
this.mailinglist = res.data.mailinglist
|
||||
? [...res.data.mailinglist]
|
||||
: [];
|
||||
this.newstosent = res.data.newstosent ? [...res.data.newstosent] : [];
|
||||
this.mailinglist = res.data.mailinglist ? [...res.data.mailinglist] : [];
|
||||
}
|
||||
this.mypage = res.data.mypage ? [...res.data.mypage] : [];
|
||||
for (const page of this.mypage) {
|
||||
@@ -2245,10 +2114,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
if (error.status === toolsext.ERR_RETRY_LOGIN) {
|
||||
} else {
|
||||
if (
|
||||
error.status ===
|
||||
serv_constants.RIS_CODE__HTTP_FORBIDDEN_TOKEN_EXPIRED ||
|
||||
error.status ===
|
||||
serv_constants.RIS_CODE__HTTP_FORBIDDEN_INVALID_TOKEN
|
||||
error.status === serv_constants.RIS_CODE__HTTP_FORBIDDEN_TOKEN_EXPIRED ||
|
||||
error.status === serv_constants.RIS_CODE__HTTP_FORBIDDEN_INVALID_TOKEN
|
||||
) {
|
||||
} else {
|
||||
this.serverError = true;
|
||||
@@ -2304,8 +2171,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
const key = fieldsTable.getKeyByTable(col.jointable);
|
||||
const myres: any = [];
|
||||
mylist.forEach((myrec: any) => {
|
||||
if (tools.isBitActive(val, myrec[key]))
|
||||
myres.push(mythis.t(myrec.label));
|
||||
if (tools.isBitActive(val, myrec[key])) myres.push(mythis.t(myrec.label));
|
||||
});
|
||||
|
||||
return myres;
|
||||
@@ -2333,9 +2199,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
let risultato = '';
|
||||
|
||||
if (tools.isObject(collab)) {
|
||||
risultato = mylist
|
||||
.filter((myrec: any) => myrec.username === val)
|
||||
.map(collab);
|
||||
risultato = mylist.filter((myrec: any) => myrec.username === val).map(collab);
|
||||
} else {
|
||||
const myris = mylist.find((myrec: any) => myrec[key] === val);
|
||||
if (myris) risultato = myris[collab];
|
||||
@@ -2365,9 +2229,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
// console.table(mylist)
|
||||
// console.log('key=', key, 'collab', collab, 'val', collab)
|
||||
|
||||
const myris = mylist.filter((myrec: any) =>
|
||||
arrval.includes(myrec[key])
|
||||
);
|
||||
const myris = mylist.filter((myrec: any) => arrval.includes(myrec[key]));
|
||||
// console.log('myris', myris)
|
||||
if (myris) {
|
||||
console.log('collab', collab);
|
||||
@@ -2514,44 +2376,35 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
shared_consts.Accepted.CHECK_SEE_VIDEO_PRINCIPI,
|
||||
];
|
||||
else if (table === 'fieldstype') myarr = costanti.FieldTypeArr;
|
||||
else if (table === 'metodo_pagamento')
|
||||
myarr = tools.SelectMetodiPagamento;
|
||||
else if (table === 'metodo_pagamento') myarr = tools.SelectMetodiPagamento;
|
||||
else if (table === 'confsite_opt') myarr = tools.ConfSiteOpt;
|
||||
else if (table === 'confpages_lang') myarr = costanti.ArrLang;
|
||||
else if (table === 'bottype') myarr = shared_consts.BotType;
|
||||
else if (table === 'visibility') myarr = shared_consts.Visibility;
|
||||
else if (table === 'cat_interesse_arcadei')
|
||||
myarr = shared_consts.Cat_Interesse_Arcadei;
|
||||
else if (table === 'cat_interesse_arcadei') myarr = shared_consts.Cat_Interesse_Arcadei;
|
||||
else if (table === 'pub_to_share') myarr = shared_consts.Pub_to_Share;
|
||||
else if (table === 'visibilGroup') myarr = shared_consts.VisibilGroup;
|
||||
else if (table === 'statuscircuit') myarr = shared_consts.StatusCircuit;
|
||||
else if (table === 'elemtypes') myarr = shared_consts.TypesElem;
|
||||
else if (table === 'fonts_installed')
|
||||
myarr = shared_consts.FontsInstalled;
|
||||
else if (table === 'fonts_installed') myarr = shared_consts.FontsInstalled;
|
||||
else if (table === 'lang') myarr = shared_consts.Lang;
|
||||
else if (table === 'regions') myarr = shared_consts.Regions;
|
||||
else if (table === 'shippings') myarr = shared_consts.Shippings;
|
||||
else if (table === 'otherfilters') myarr = shared_consts.OtherFilters;
|
||||
else if (table === toolsext.TABCALDATE) myarr = this.getArrDateEvent();
|
||||
else if (table === toolsext.TABCALALLDATE)
|
||||
myarr = this.getArrAllDateEvent();
|
||||
else if (table === toolsext.TABCALALLDATE) myarr = this.getArrAllDateEvent();
|
||||
else if (table === toolsext.TABTYPEHOSP) myarr = shared_consts.TypeHosps;
|
||||
else if (table === 'tipodest') myarr = shared_consts.DESTNEWSLETTER_ARRAY;
|
||||
else if (table === 'versions') myarr = shared_consts.VERSIONI_PRODOTTO;
|
||||
else if (table === toolsext.TABPEOPLE) myarr = shared_consts.People;
|
||||
else if (table === toolsext.TABTYPEACCOM) myarr = shared_consts.TypeAccom;
|
||||
else if (table === toolsext.TABLOCACCOM)
|
||||
myarr = shared_consts.LocationAccom;
|
||||
else if (table === toolsext.TABLOCACCOM) myarr = shared_consts.LocationAccom;
|
||||
else if (table === toolsext.TABPREF) myarr = shared_consts.Preferences;
|
||||
else if (table === toolsext.TABUNITS)
|
||||
myarr = shared_consts.Units_Of_Measure_ListBox;
|
||||
else if (table === toolsext.TABTYPECASH)
|
||||
myarr = shared_consts.TypeCashStr;
|
||||
else if (table === 'usernotifs')
|
||||
myarr = shared_consts.UsersNotif_Adv_List;
|
||||
else if (table === toolsext.TABUNITS) myarr = shared_consts.Units_Of_Measure_ListBox;
|
||||
else if (table === toolsext.TABTYPECASH) myarr = shared_consts.TypeCashStr;
|
||||
else if (table === 'usernotifs') myarr = shared_consts.UsersNotif_Adv_List;
|
||||
else if (table === 'typenotifs') myarr = shared_consts.TypeNotifs_Arr;
|
||||
else if (table === toolsext.TABTIPODIATTIVITA)
|
||||
myarr = shared_consts.TipoDiAttivita;
|
||||
else if (table === toolsext.TABTIPODIATTIVITA) myarr = shared_consts.TipoDiAttivita;
|
||||
else myarr = this.getListByTable(table, value2);
|
||||
|
||||
if (costanti.TABLES_ARRAY.includes(table)) {
|
||||
@@ -2634,12 +2487,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
getTableJoinLabelValueByName(col: IColGridTable) {
|
||||
let myarrrec: any = [];
|
||||
if (col.jointable) {
|
||||
let myarrtab = this.getTableJoinByName(
|
||||
col.jointable,
|
||||
col.addall,
|
||||
col.addnone,
|
||||
col.filter
|
||||
);
|
||||
let myarrtab = this.getTableJoinByName(col.jointable, col.addall, col.addnone, col.filter);
|
||||
|
||||
const key = fieldsTable.getKeyByTable(col.jointable);
|
||||
const collab = fieldsTable.getLabelByTable(col.jointable);
|
||||
@@ -2684,22 +2532,20 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
async delMyElem($q: any, t: any, myelem: IMyElem) {
|
||||
if (!myelem._id) return false;
|
||||
|
||||
return await this.DeleteRec({ table: 'myelems', id: myelem._id }).then(
|
||||
async (ris) => {
|
||||
if (ris) {
|
||||
this.myelems = this.myelems.filter((rec) => rec._id !== myelem._id);
|
||||
return await this.DeleteRec({ table: 'myelems', id: myelem._id }).then(async (ris) => {
|
||||
if (ris) {
|
||||
this.myelems = this.myelems.filter((rec) => rec._id !== myelem._id);
|
||||
|
||||
// Aggiorna anche tutto il sito...
|
||||
// await this.loadSite()
|
||||
// Aggiorna anche tutto il sito...
|
||||
// await this.loadSite()
|
||||
|
||||
tools.showPositiveNotif($q, t('db.deletedrecord'));
|
||||
return true;
|
||||
} else {
|
||||
tools.showNegativeNotif($q, t('db.recdelfailed'));
|
||||
return false;
|
||||
}
|
||||
tools.showPositiveNotif($q, t('db.deletedrecord'));
|
||||
return true;
|
||||
} else {
|
||||
tools.showNegativeNotif($q, t('db.recdelfailed'));
|
||||
return false;
|
||||
}
|
||||
);
|
||||
});
|
||||
},
|
||||
|
||||
async saveMyElem($q: any, t: any, myelem: IMyElem) {
|
||||
@@ -2779,12 +2625,14 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
dimensioni_def: {
|
||||
isTemplate: false,
|
||||
linkIdTemplate: '',
|
||||
linkIdTemplatePerStampa: '',
|
||||
name: '',
|
||||
pagina: tools.resetRecIDimensioni(null),
|
||||
},
|
||||
areadistampa: tools.resetRecIAreaDiStampa(null),
|
||||
print_isTemplate: false,
|
||||
print_linkIdTemplate: '',
|
||||
print_linkIdTemplatePerStampa: '',
|
||||
};
|
||||
},
|
||||
createRaccoltaCataloghiVuoto(): IOptCatalogo {
|
||||
@@ -2799,22 +2647,18 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
dimensioni_def: {
|
||||
isTemplate: false,
|
||||
linkIdTemplate: '',
|
||||
linkIdTemplatePerStampa: '',
|
||||
name: '',
|
||||
pagina: tools.resetRecIDimensioni(null),
|
||||
},
|
||||
areadistampa: tools.resetRecIAreaDiStampa(null),
|
||||
print_isTemplate: false,
|
||||
print_linkIdTemplate: '',
|
||||
print_linkIdTemplatePerStampa: '',
|
||||
};
|
||||
},
|
||||
|
||||
async prepareAddNewElem(
|
||||
order: any,
|
||||
$q: any,
|
||||
t: any,
|
||||
myelem: any,
|
||||
newtype: any
|
||||
) {
|
||||
async prepareAddNewElem(order: any, $q: any, t: any, myelem: any, newtype: any) {
|
||||
const newrec: IMyElem = {
|
||||
_id: undefined,
|
||||
type: newtype,
|
||||
@@ -2863,10 +2707,10 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
});
|
||||
},
|
||||
|
||||
async execConvertPDF(paramquery: any) {
|
||||
async execConvertPDF(paramquery: any, blob = false) {
|
||||
// console.log('paramquery', paramquery)
|
||||
let responseopt = {};
|
||||
if (paramquery.blob) {
|
||||
if (blob) {
|
||||
responseopt.responseType = 'blob';
|
||||
}
|
||||
return Api.SendReq(
|
||||
@@ -2908,14 +2752,15 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
|
||||
async convertPdf(
|
||||
pdfFile: any,
|
||||
salvasufiledascaricare,
|
||||
width: string,
|
||||
height: string,
|
||||
compressione: string,
|
||||
stampa: boolean,
|
||||
dir_out: string = '',
|
||||
file_out: string = '',
|
||||
print: boolean = false,
|
||||
optcatalogo: IOptCatalogo | null = null,
|
||||
salvasufiledascaricare
|
||||
) {
|
||||
try {
|
||||
if (!pdfFile) {
|
||||
@@ -2923,8 +2768,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
return;
|
||||
}
|
||||
|
||||
const filenameToDownload =
|
||||
tools.removeFileExtension(pdfFile.name) + '-compresso.pdf';
|
||||
const filenameToDownload = tools.removeFileExtension(pdfFile.name) + '-compresso.pdf';
|
||||
|
||||
const formData = new FormData();
|
||||
if (pdfFile instanceof File) {
|
||||
@@ -2934,22 +2778,21 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
formData.append('height', height); // Dimensione del PDF in cm
|
||||
formData.append('compressione', compressione);
|
||||
formData.append('dir_out', dir_out);
|
||||
formData.append('stampa', stampa ? '1' : '0');
|
||||
formData.append('file_out', file_out);
|
||||
formData.append('idapp', tools.getEnv('VITE_APP_ID'));
|
||||
if (print && optcatalogo) {
|
||||
formData.append('print_left', optcatalogo.areadistampa.margini.left); // 15, 0.59"
|
||||
formData.append('print_top', optcatalogo.areadistampa.margini.top);
|
||||
formData.append(
|
||||
'print_right',
|
||||
optcatalogo.areadistampa.margini.right
|
||||
);
|
||||
formData.append(
|
||||
'print_bottom',
|
||||
optcatalogo.areadistampa.margini.bottom
|
||||
); // 7 mm 0,275"
|
||||
formData.append('print_right', optcatalogo.areadistampa.margini.right);
|
||||
formData.append('print_bottom', optcatalogo.areadistampa.margini.bottom); // 7 mm 0,275"
|
||||
}
|
||||
formData.append('salvasufiledascaricare', salvasufiledascaricare ? 'true' : 'false');
|
||||
|
||||
const response = await this.execConvertPDF(formData);
|
||||
|
||||
console.log('2) Invia le immagini al convertitore/compressione di PDF...');
|
||||
|
||||
const response = await this.execConvertPDF(formData, salvasufiledascaricare);
|
||||
|
||||
if (response) {
|
||||
if (salvasufiledascaricare) {
|
||||
@@ -2966,6 +2809,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
} else {
|
||||
return response;
|
||||
}
|
||||
|
||||
console.log('3) Generazione PDF completata !', response);
|
||||
} else {
|
||||
console.error('No data returned from the server.');
|
||||
}
|
||||
@@ -3037,20 +2882,14 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
return arrrec;
|
||||
},
|
||||
|
||||
async getGM_FieldOf_T_Web_Articoli(
|
||||
sku: string,
|
||||
field: string,
|
||||
cmd: number
|
||||
) {
|
||||
async getGM_FieldOf_T_Web_Articoli(sku: string, field: string, cmd: number) {
|
||||
const options: IOptQueryGM = {
|
||||
nameTable: 'T_Web_Articoli',
|
||||
campispeciali: !field,
|
||||
numrec: 1,
|
||||
query: '',
|
||||
where:
|
||||
'T.IdArticolo =' +
|
||||
sku +
|
||||
' AND T.DataPubblicazione IS NOT NULL ORDER BY T.DataOra DESC;',
|
||||
'T.IdArticolo =' + sku + ' AND T.DataPubblicazione IS NOT NULL ORDER BY T.DataOra DESC;',
|
||||
fieldGM: field,
|
||||
showQtaDisponibile: false,
|
||||
outhtml: false,
|
||||
@@ -3086,11 +2925,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
return valueris;
|
||||
},
|
||||
|
||||
async setGM_FieldOf_T_Web_Articoli(
|
||||
sku: string,
|
||||
data: Record<string, any>,
|
||||
cmd: number
|
||||
) {
|
||||
async setGM_FieldOf_T_Web_Articoli(sku: string, data: Record<string, any>, cmd: number) {
|
||||
try {
|
||||
// Verifica se i campi specificati sono validi
|
||||
if (!data || Object.keys(data).length === 0) {
|
||||
@@ -3112,10 +2947,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
// Restituiamo il risultato dell'operazione
|
||||
return result;
|
||||
} catch (error) {
|
||||
console.error(
|
||||
"Errore durante l'aggiornamento dei campi:",
|
||||
error.message
|
||||
);
|
||||
console.error("Errore durante l'aggiornamento dei campi:", error.message);
|
||||
throw new Error(
|
||||
`Errore durante l'aggiornamento dei campi per lo SKU ${sku}: ${error.message}`
|
||||
);
|
||||
@@ -3151,13 +2983,9 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
if (table === 'products') {
|
||||
await productStore.loadProductById(id, true);
|
||||
} else if (table === 'productinfos') {
|
||||
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(
|
||||
"Errore durante l'aggiornamento della tabella in memoria:",
|
||||
error
|
||||
);
|
||||
console.error("Errore durante l'aggiornamento della tabella in memoria:", error);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -3235,9 +3063,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
|
||||
if (mytablerec && resdata && resdata.rec) {
|
||||
// Trova l'indice del record da aggiornare
|
||||
const index = mytablerec.findIndex(
|
||||
(item: any) => item._id === resdata.rec._id
|
||||
);
|
||||
const index = mytablerec.findIndex((item: any) => item._id === resdata.rec._id);
|
||||
|
||||
if (index !== -1 && index !== undefined) {
|
||||
// Aggiorna il record mantenendo reattività
|
||||
|
||||
@@ -125,7 +125,7 @@ body {
|
||||
margin-bottom: calc(5 * var(--scalecatalog) * 1px);
|
||||
}
|
||||
|
||||
.book-pagina-title, .book-pagina-title-footer {
|
||||
.book-pagina-title {
|
||||
font-family: 'DINPro', sans-serif;
|
||||
margin-top: calc(50 * var(--scalecatalog) * 1px);
|
||||
margin-bottom: calc(0 * var(--scalecatalog) * 1px);
|
||||
@@ -135,8 +135,10 @@ body {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.book-pagina-title-footer{
|
||||
.book-pagina-title-footer {
|
||||
font-family: 'DINPro', sans-serif;
|
||||
font-size: calc(20 * var(--scalecatalog) * 1px) !important;
|
||||
font-weight: bold;
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -139,9 +139,7 @@
|
||||
class="text-center q-py-sm prod_trov"
|
||||
>
|
||||
<div
|
||||
v-if="
|
||||
cat === '' && arrProducts.length === 0 && showListaFiltrata
|
||||
"
|
||||
v-if="cat === '' && arrProducts.length === 0 && showListaFiltrata"
|
||||
class="row justify-center text-h6"
|
||||
>
|
||||
Seleziona {{ filtroStrApplicato }}
|
||||
@@ -178,10 +176,7 @@
|
||||
</q-inner-loading>
|
||||
|
||||
<q-btn
|
||||
v-if="
|
||||
!showListaFiltrata &&
|
||||
(tools.isEditor() || tools.isCommerciale())
|
||||
"
|
||||
v-if="!showListaFiltrata && (tools.isEditor() || tools.isCommerciale())"
|
||||
rounded
|
||||
icon="fas fa-redo"
|
||||
label="Rigenera Lista"
|
||||
@@ -244,6 +239,7 @@
|
||||
:lista_prodotti="myCatalog?.lista_prodotti"
|
||||
@update:lista_prodotti="updateProducts"
|
||||
:optcatalogo="optcatalogo"
|
||||
:idcatalog="myCatalog._id"
|
||||
table="products"
|
||||
@rigenera="generaListaLibri()"
|
||||
/>
|
||||
@@ -319,11 +315,7 @@
|
||||
</q-tabs>
|
||||
|
||||
<CTitleBanner
|
||||
v-show="
|
||||
tabcatalogo === 'visu' &&
|
||||
!tools.isUtente() &&
|
||||
arrProducts?.length > 0
|
||||
"
|
||||
v-show="tabcatalogo === 'visu' && !tools.isUtente() && arrProducts?.length > 0"
|
||||
class="q-pa-xs"
|
||||
title="Genera PDF"
|
||||
bgcolor="bg-blue"
|
||||
@@ -339,21 +331,39 @@
|
||||
class="row justify-center"
|
||||
>
|
||||
<q-btn
|
||||
v-if="
|
||||
optcatalogo.pdf && !optcatalogo.generazionePDFInCorso
|
||||
"
|
||||
:label="`1) PREPARA PDF`"
|
||||
@click="preparePDF"
|
||||
v-if="optcatalogo.pdf && !optcatalogo.generazionePDFInCorso"
|
||||
:label="`PREPARA PDF WEB`"
|
||||
@click="preparePDFWeb"
|
||||
></q-btn>
|
||||
<q-btn
|
||||
v-if="optcatalogo.pdf && !optcatalogo.generazionePDFInCorso"
|
||||
:label="`PREPARA PDF STAMPA`"
|
||||
@click="preparePDFStampa"
|
||||
></q-btn>
|
||||
|
||||
<q-select
|
||||
v-if="optcatalogo.generazionePDFInCorso"
|
||||
v-model="optcatalogo.selectedVersionStampabile"
|
||||
:options="[
|
||||
{ label: 'Versione Web', value: shared_consts.PREPARA_PDF.WEB },
|
||||
{ label: 'Versione Stampabile', value: shared_consts.PREPARA_PDF.STAMPA },
|
||||
]"
|
||||
label="Seleziona Versione"
|
||||
:disable="true"
|
||||
emit-value
|
||||
map-options
|
||||
style="width: 300px"
|
||||
@update:model-value="modifElem"
|
||||
>
|
||||
</q-select>
|
||||
|
||||
<q-btn
|
||||
v-if="optcatalogo.generazionePDFInCorso"
|
||||
:label="`Termina Generazione`"
|
||||
@click="terminaPDF"
|
||||
></q-btn>
|
||||
<q-btn
|
||||
v-if="
|
||||
optcatalogo.pdf && optcatalogo.generazionePDFInCorso
|
||||
"
|
||||
v-if="optcatalogo.pdf && optcatalogo.generazionePDFInCorso"
|
||||
:label="`2) Genera PDF ` + getPdfFilename()"
|
||||
@click="generatePDF()"
|
||||
color="positive"
|
||||
@@ -365,15 +375,158 @@
|
||||
:push="optcatalogo.indebug"
|
||||
:color="optcatalogo.indebug ? `positive` : 'primary'"
|
||||
></q-btn>
|
||||
<q-input
|
||||
v-if="optcatalogo.pdf && optcatalogo.indebug"
|
||||
@update:model-value="modifElem"
|
||||
v-model="ratioconvert"
|
||||
label="Ratio Convert"
|
||||
type="number"
|
||||
step="0.01"
|
||||
outlined
|
||||
dense
|
||||
style="width: 100px; margin-right: 10px"
|
||||
></q-input>
|
||||
<q-btn
|
||||
v-if="
|
||||
optcatalogo.pdf &&
|
||||
!optcatalogo.generazionePDFInCorso &&
|
||||
optcatalogo.indebug
|
||||
"
|
||||
:label="`CONVERTI VALORI`"
|
||||
@click="convertiValori"
|
||||
></q-btn>
|
||||
</div>
|
||||
<CTitleBanner
|
||||
v-show="
|
||||
tabcatalogo === 'visu' && !tools.isUtente() && arrProducts?.length > 0
|
||||
"
|
||||
class="q-pa-xs"
|
||||
title="Configurazione"
|
||||
bgcolor="bg-blue"
|
||||
clcolor="text-white"
|
||||
mystyle=""
|
||||
myclass="myshad"
|
||||
:canopen="true"
|
||||
:visible="false"
|
||||
>
|
||||
<div
|
||||
v-if="tools.isAdmin()"
|
||||
class="row justify-center"
|
||||
>
|
||||
<div class="justify-center">
|
||||
<q-select
|
||||
rounded
|
||||
style="width: 200px"
|
||||
outlined
|
||||
v-model="optcatalogo.areadistampa.format"
|
||||
:options="tools.SelectListFormatPDF"
|
||||
@update:model-value="modifElem"
|
||||
dense
|
||||
label="Formato:"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
</q-select>
|
||||
<div v-if="optcatalogo.areadistampa.format.length > 1">
|
||||
Ratio:
|
||||
{{
|
||||
optcatalogo.areadistampa.format[0] /
|
||||
optcatalogo.areadistampa.format[1]
|
||||
}}
|
||||
</div>
|
||||
<q-select
|
||||
rounded
|
||||
style="width: 200px"
|
||||
outlined
|
||||
v-model="optcatalogo.areadistampa.scale"
|
||||
:options="tools.SelectListScalePDF"
|
||||
@update:model-value="modifElem"
|
||||
dense
|
||||
label="Scale:"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
</q-select>
|
||||
<q-select
|
||||
rounded
|
||||
style="width: 200px"
|
||||
outlined
|
||||
v-model="optcatalogo.areadistampa.scale_printable"
|
||||
:options="tools.SelectListScalePDF"
|
||||
@update:model-value="modifElem"
|
||||
dense
|
||||
label="Scale per Stampa:"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
</q-select>
|
||||
<q-select
|
||||
rounded
|
||||
style="width: 200px"
|
||||
outlined
|
||||
v-model="optcatalogo.areadistampa.scalecanvas"
|
||||
:options="tools.SelectListQualityPDF"
|
||||
@update:model-value="modifElem"
|
||||
dense
|
||||
label="Qualità:"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
</q-select>
|
||||
<q-select
|
||||
rounded
|
||||
style="width: 150px"
|
||||
outlined
|
||||
v-model="optcatalogo.areadistampa.orientation"
|
||||
:options="tools.SelectListOrientamentoPDF"
|
||||
@update:model-value="modifElem"
|
||||
dense
|
||||
label="Orientamento:"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
</q-select>
|
||||
<q-select
|
||||
rounded
|
||||
style="width: 150px"
|
||||
outlined
|
||||
v-model="optcatalogo.areadistampa.unit"
|
||||
:options="tools.SelectListUnitPDF"
|
||||
@update:model-value="modifElem"
|
||||
dense
|
||||
label="Unità:"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
</q-select>
|
||||
<q-toggle
|
||||
v-model="optcatalogo.areadistampa.compress"
|
||||
color="positive"
|
||||
icon="fas fa-file-pdf"
|
||||
label="Comprimi"
|
||||
@update:model-value="modifElem"
|
||||
>
|
||||
</q-toggle>
|
||||
</div>
|
||||
<div>
|
||||
<CBorders
|
||||
label="Margini di Stampa (mm):"
|
||||
v-model="optcatalogo.areadistampa.margini"
|
||||
@update:model-value="modifElem"
|
||||
addstr=""
|
||||
></CBorders>
|
||||
</div>
|
||||
</div>
|
||||
</CTitleBanner>
|
||||
<div v-if="strout">
|
||||
{{ strout }}
|
||||
</div>
|
||||
<div v-if="myCatalog">
|
||||
<div
|
||||
v-if="myCatalog.pdf_generato"
|
||||
class="bg-green-1 q-ma-sm q-pa-sm"
|
||||
>
|
||||
<div
|
||||
class="bg-blue-1 text-red text-bold text-h6 q-ma-sm q-pa-sm"
|
||||
>
|
||||
<div class="bg-blue-1 text-red text-bold text-h6 q-ma-sm q-pa-sm">
|
||||
<strong>PDF generati Temporanei</strong>
|
||||
</div>
|
||||
|
||||
@@ -389,11 +542,11 @@
|
||||
<q-td :props="props">
|
||||
<a
|
||||
v-if="props.row.pdf"
|
||||
:href="tools.getHost() + props.row.pdf"
|
||||
:href="tools.getURLByHostAndFilePath(props.row.pdf)"
|
||||
target="_blank"
|
||||
class="text-bold"
|
||||
>
|
||||
{{ tools.getHost() + props.row.pdf }}
|
||||
{{ tools.getURLByHostAndFilePath(props.row.pdf) }}
|
||||
</a>
|
||||
<span v-else>-</span>
|
||||
</q-td>
|
||||
@@ -420,15 +573,11 @@
|
||||
</q-table>
|
||||
|
||||
<div class="bg-red-1 q-pa-md q-mt-md">
|
||||
<div
|
||||
class="bg-blue-1 text-green text-bold text-h6 q-ma-sm q-pa-sm"
|
||||
>
|
||||
<div class="bg-blue-1 text-green text-bold text-h6 q-ma-sm q-pa-sm">
|
||||
<strong>PDF Pubblicati OnLine</strong>
|
||||
</div>
|
||||
|
||||
<table
|
||||
class="q-table q-table--flat q-table--dense q-ma-none q-pa-none"
|
||||
>
|
||||
<table class="q-table q-table--flat q-table--dense q-ma-none q-pa-none">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
@@ -437,20 +586,16 @@
|
||||
<td>
|
||||
<a
|
||||
v-if="myCatalog.pdf_online"
|
||||
:href="
|
||||
tools.getHost() + myCatalog.pdf_online
|
||||
"
|
||||
:href="tools.getURLByHostAndFilePath(myCatalog.pdf_online)"
|
||||
target="_blank"
|
||||
class="text-bold"
|
||||
>
|
||||
{{ tools.getHost() + myCatalog.pdf_online }}
|
||||
{{ tools.getURLByHostAndFilePath(myCatalog.pdf_online) }}
|
||||
</a>
|
||||
<span v-else>-</span>
|
||||
</td>
|
||||
<td>
|
||||
{{
|
||||
tools.getstrDateTime(myCatalog.data_online)
|
||||
}}
|
||||
{{ tools.getstrDateTime(myCatalog.data_online) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -461,25 +606,17 @@
|
||||
<a
|
||||
v-if="myCatalog.pdf_online_stampa"
|
||||
:href="
|
||||
tools.getHost() +
|
||||
myCatalog.pdf_online_stampa
|
||||
tools.getURLByHostAndFilePath(myCatalog.pdf_online_stampa)
|
||||
"
|
||||
target="_blank"
|
||||
class="text-bold"
|
||||
>
|
||||
{{
|
||||
tools.getHost() +
|
||||
myCatalog.pdf_online_stampa
|
||||
}}
|
||||
{{ tools.getURLByHostAndFilePath(myCatalog.pdf_online_stampa) }}
|
||||
</a>
|
||||
<span v-else>-</span>
|
||||
</td>
|
||||
<td>
|
||||
{{
|
||||
tools.getstrDateTime(
|
||||
myCatalog.data_online_stampa
|
||||
)
|
||||
}}
|
||||
{{ tools.getstrDateTime(myCatalog.data_online_stampa) }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -597,23 +734,15 @@
|
||||
item.type === costanti.FieldType.select ||
|
||||
item.type === costanti.FieldType.select_by_server
|
||||
"
|
||||
:label="
|
||||
item.value && item.value._id > 0
|
||||
? undefined
|
||||
: labelcombo(item)
|
||||
"
|
||||
:label="item.value && item.value._id > 0 ? undefined : labelcombo(item)"
|
||||
v-model:value="item.value"
|
||||
:addall="item.addall"
|
||||
:addnone="item.addnone"
|
||||
:addlast="true"
|
||||
:tablesel="
|
||||
item.type === costanti.FieldType.select_by_server
|
||||
? item.tablesel
|
||||
: ''
|
||||
"
|
||||
:pickup="
|
||||
item.type === costanti.FieldType.select_by_server
|
||||
item.type === costanti.FieldType.select_by_server ? item.tablesel : ''
|
||||
"
|
||||
:pickup="item.type === costanti.FieldType.select_by_server"
|
||||
:label-color="$q.dark.isActive ? 'white' : 'black'"
|
||||
myclass="comboselector"
|
||||
color="primary"
|
||||
@@ -626,8 +755,7 @@
|
||||
:filter_extra="item.filter_extra"
|
||||
style="font-size: 0.8rem !important"
|
||||
:useinput="
|
||||
item.useinput &&
|
||||
item.type !== costanti.FieldType.select_by_server
|
||||
item.useinput && item.type !== costanti.FieldType.select_by_server
|
||||
"
|
||||
>
|
||||
</CMySelect>
|
||||
@@ -665,11 +793,7 @@
|
||||
|
||||
<div class="text-center q-py-sm prod_trov">
|
||||
<div
|
||||
v-if="
|
||||
cat === '' &&
|
||||
arrProducts.length === 0 &&
|
||||
showListaFiltrata
|
||||
"
|
||||
v-if="cat === '' && arrProducts.length === 0 && showListaFiltrata"
|
||||
class="row justify-center text-h6"
|
||||
>
|
||||
Seleziona {{ filtroStrApplicato }}
|
||||
@@ -716,26 +840,17 @@
|
||||
optcatalogo.first_page.text_html &&
|
||||
optcatalogo.first_page.text_html.contenuto
|
||||
"
|
||||
:style="
|
||||
generateStyleByPageDim(
|
||||
optcatalogo,
|
||||
optcatalogo.first_page
|
||||
)
|
||||
"
|
||||
:style="generateStyleByPageDim(optcatalogo, optcatalogo.first_page)"
|
||||
>
|
||||
<div
|
||||
v-html="optcatalogo.first_page.text_html.contenuto"
|
||||
></div>
|
||||
<div v-html="optcatalogo.first_page.text_html.contenuto"></div>
|
||||
</div>
|
||||
<div :style="generateStyleCatalogo(optcatalogo)">
|
||||
<div
|
||||
v-if="!nascondi"
|
||||
:style="generateStyleCatalogo(optcatalogo)"
|
||||
>
|
||||
<div class="flex-container-book">
|
||||
<q-infinite-scroll
|
||||
v-if="
|
||||
!optcatalogo.pdf &&
|
||||
arrLoaded &&
|
||||
arrLoaded.length > 0 &&
|
||||
!ismounting
|
||||
"
|
||||
v-if="!optcatalogo.pdf && arrLoaded && arrLoaded.length > 0 && !ismounting"
|
||||
ref="myinfscroll"
|
||||
:initial-index="0"
|
||||
@load="onLoadScroll"
|
||||
@@ -794,17 +909,13 @@
|
||||
>
|
||||
<!-- Itera sulle schede -->
|
||||
<div
|
||||
v-for="(
|
||||
recscheda, schedaIndex
|
||||
) in optcatalogo.arrSchede"
|
||||
v-for="(recscheda, schedaIndex) in optcatalogo.arrSchede"
|
||||
:key="schedaIndex"
|
||||
>
|
||||
<div v-if="recscheda && recscheda.scheda">
|
||||
<!-- Itera sulle pagine -->
|
||||
<div
|
||||
v-for="(page, pageIndex) in groupedPages(
|
||||
recscheda
|
||||
)"
|
||||
v-for="(page, pageIndex) in groupedPages(recscheda)"
|
||||
:key="pageIndex"
|
||||
>
|
||||
<div
|
||||
@@ -815,24 +926,15 @@
|
||||
'card-page': false,
|
||||
'pdf-section': true,
|
||||
}"
|
||||
:style="
|
||||
generateStylePageScheda(
|
||||
optcatalogo,
|
||||
recscheda.scheda
|
||||
)
|
||||
"
|
||||
:style="generateStylePageScheda(optcatalogo, recscheda.scheda)"
|
||||
>
|
||||
<div
|
||||
v-if="
|
||||
recscheda.scheda.dimensioni.pagina
|
||||
?.testo_title?.contenuto
|
||||
"
|
||||
v-if="recscheda.scheda.dimensioni.pagina?.testo_title?.contenuto"
|
||||
:style="{
|
||||
'--scalecatalog':
|
||||
tools.getScale(optcatalogo),
|
||||
'--scalecatalog': tools.getScale(optcatalogo),
|
||||
'line-height':
|
||||
recscheda.scheda.dimensioni.pagina
|
||||
?.testo_title?.font.line_height,
|
||||
recscheda.scheda.dimensioni.pagina?.testo_title?.font
|
||||
.line_height,
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
position: 'relative', // Posizionamento assoluto
|
||||
@@ -854,16 +956,12 @@
|
||||
></div>
|
||||
</div>
|
||||
<div
|
||||
v-if="
|
||||
recscheda.scheda.dimensioni.pagina?.testo_up
|
||||
?.contenuto
|
||||
"
|
||||
v-if="recscheda.scheda.dimensioni.pagina?.testo_up?.contenuto"
|
||||
:style="{
|
||||
'--scalecatalog':
|
||||
tools.getScale(optcatalogo),
|
||||
'--scalecatalog': tools.getScale(optcatalogo),
|
||||
'line-height':
|
||||
recscheda.scheda.dimensioni.pagina
|
||||
?.testo_up?.font.line_height,
|
||||
recscheda.scheda.dimensioni.pagina?.testo_up?.font
|
||||
.line_height,
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
}"
|
||||
@@ -878,15 +976,14 @@
|
||||
<div
|
||||
v-if="recscheda.scheda?.dimensioni?.pagina?.testo_title"
|
||||
:style="{
|
||||
'--scalecatalog':
|
||||
tools.getScale(optcatalogo),
|
||||
'--scalecatalog': tools.getScale(optcatalogo),
|
||||
'line-height':
|
||||
recscheda.scheda.dimensioni.pagina
|
||||
?.testo_title?.font.line_height,
|
||||
recscheda.scheda.dimensioni.pagina?.testo_title?.font
|
||||
.line_height,
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
position: 'relative', // Posizionamento assoluto
|
||||
bottom: '8.5%', // Posiziona in basso
|
||||
position: 'absolute', // Posizione assoluta rispetto al contenitore padre
|
||||
bottom: '2.2%', // Posiziona in basso
|
||||
left: '50%', // Centra orizzontalmente
|
||||
transform: 'translateX(-50%)', // Correzione per centrare perfettamente
|
||||
width: '100%', // Assicura che il contenitore occupi l'intera larghezza
|
||||
@@ -902,6 +999,7 @@
|
||||
<div v-if="optcatalogo.indebug">
|
||||
IMG:
|
||||
{{ getImgIntroCatalogo(recscheda.scheda) }}
|
||||
num: {{ page.length }}
|
||||
</div>
|
||||
|
||||
<!-- Itera sulle righe di ogni pagina -->
|
||||
@@ -922,9 +1020,7 @@
|
||||
v-for="(prod, colIndex) in row"
|
||||
:key="`${pageIndex}-${rowIndex}-${colIndex}`"
|
||||
class="flex-item-book"
|
||||
:style="
|
||||
getStyleSchedaProdotto(recscheda)
|
||||
"
|
||||
:style="getStyleSchedaProdotto(recscheda)"
|
||||
>
|
||||
<CContainerCatalogoCard
|
||||
v-if="prod && prod.active"
|
||||
@@ -945,9 +1041,7 @@
|
||||
@selauthor="selauthor"
|
||||
/>
|
||||
<CProductCard
|
||||
v-else-if="
|
||||
prod && (prod.active || show_hide)
|
||||
"
|
||||
v-else-if="prod && (prod.active || show_hide)"
|
||||
:id="prod._id"
|
||||
:complete="false"
|
||||
:cosa="cosa"
|
||||
@@ -967,9 +1061,7 @@
|
||||
>
|
||||
<q-separator
|
||||
inset
|
||||
:size="
|
||||
tools.adjustSize(optcatalogo, '1px')
|
||||
"
|
||||
:size="tools.adjustSize(optcatalogo, '1px')"
|
||||
></q-separator>
|
||||
</div>
|
||||
</div>
|
||||
@@ -990,13 +1082,9 @@
|
||||
optcatalogo.last_page.text_html &&
|
||||
optcatalogo.last_page.text_html.contenuto
|
||||
"
|
||||
:style="
|
||||
generateStyleByPageDim(optcatalogo, optcatalogo.last_page)
|
||||
"
|
||||
:style="generateStyleByPageDim(optcatalogo, optcatalogo.last_page)"
|
||||
>
|
||||
<div
|
||||
v-html="optcatalogo.last_page.text_html.contenuto"
|
||||
></div>
|
||||
<div v-html="optcatalogo.last_page.text_html.contenuto"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -166,11 +166,6 @@ export default defineComponent({
|
||||
: '';
|
||||
}
|
||||
}
|
||||
if (!imagefile) {
|
||||
let myimg = costanti.CATALOGHI.PAG_SFONDO_DEFAULT;
|
||||
// Se non c'è un immagine di sfondo, allora prende quella di default
|
||||
imagefile = `url("${tools.getDirUpload() + shared_consts.getDirectoryByTable(shared_consts.TABLES_CATALOG) + '/' + myimg})"`;
|
||||
}
|
||||
|
||||
if (!imagefile && mypage) {
|
||||
imagefile = mypage.imgsfondo!.imagefile!;
|
||||
@@ -178,6 +173,12 @@ export default defineComponent({
|
||||
fit = mypage.imgsfondo!.fit!;
|
||||
}
|
||||
|
||||
if (!imagefile) {
|
||||
let myimg = costanti.CATALOGHI.PAG_SFONDO_DEFAULT;
|
||||
// Se non c'è un immagine di sfondo, allora prende quella di default
|
||||
imagefile = `url("${tools.getDirUpload() + shared_consts.getDirectoryByTable(shared_consts.TABLES_CATALOG) + '/' + myimg})"`;
|
||||
}
|
||||
|
||||
return { imagefile, fit };
|
||||
}
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
@update:lista_prodotti="updateRaccolta"
|
||||
table="catalogs"
|
||||
:optcatalogo="optcatalogo"
|
||||
:idcatalog="idPage"
|
||||
/>
|
||||
</q-tab-panel>
|
||||
|
||||
@@ -83,12 +84,12 @@
|
||||
<div v-if="getRaccoltaCataloghiByMyPage?.data_generato !== getRaccoltaCataloghiByMyPage?.data_online">
|
||||
PDF Generato:
|
||||
<a
|
||||
:href="tools.getHost() + getRaccoltaCataloghiByMyPage?.pdf_generato"
|
||||
:href="tools.getURLByHostAndFilePath(getRaccoltaCataloghiByMyPage?.pdf_generato)"
|
||||
target="_blank"
|
||||
v-if="getRaccoltaCataloghiByMyPage?.pdf_generato"
|
||||
class="text-bold"
|
||||
>
|
||||
{{ tools.getHost() + getRaccoltaCataloghiByMyPage?.pdf_generato }}
|
||||
{{ tools.getURLByHostAndFilePath(getRaccoltaCataloghiByMyPage?.pdf_generato) }}
|
||||
</a>
|
||||
<span v-else>-</span>
|
||||
<br />(del {{ tools.getstrDateTime(getRaccoltaCataloghiByMyPage?.data_generato) }})
|
||||
@@ -105,12 +106,12 @@
|
||||
<div v-if="getRaccoltaCataloghiByMyPage?.data_generato_stampa !== getRaccoltaCataloghiByMyPage?.data_online_stampa">
|
||||
PDF Generato Stampa:
|
||||
<a
|
||||
:href="tools.getHost() + getRaccoltaCataloghiByMyPage?.pdf_generato_stampa"
|
||||
:href="tools.getURLByHostAndFilePath(getRaccoltaCataloghiByMyPage?.pdf_generato_stampa)"
|
||||
target="_blank"
|
||||
v-if="getRaccoltaCataloghiByMyPage?.pdf_generato_stampa"
|
||||
class="text-bold"
|
||||
>
|
||||
{{ tools.getHost() + getRaccoltaCataloghiByMyPage?.pdf_generato_stampa }}
|
||||
{{ tools.getURLByHostAndFilePath(getRaccoltaCataloghiByMyPage?.pdf_generato_stampa) }}
|
||||
</a>
|
||||
<span v-else>-</span>
|
||||
<br />(del {{ tools.getstrDateTime(getRaccoltaCataloghiByMyPage?.data_generato_stampa) }})
|
||||
@@ -130,12 +131,12 @@
|
||||
<div v-if="getRaccoltaCataloghiByMyPage?.data_online">
|
||||
PDF OnLine:
|
||||
<a
|
||||
:href="tools.getHost() + getRaccoltaCataloghiByMyPage?.pdf_online"
|
||||
:href="tools.getURLByHostAndFilePath(getRaccoltaCataloghiByMyPage?.pdf_online)"
|
||||
target="_blank"
|
||||
v-if="getRaccoltaCataloghiByMyPage?.pdf_online"
|
||||
class="text-bold"
|
||||
>
|
||||
{{ tools.getHost() + getRaccoltaCataloghiByMyPage?.pdf_online }}
|
||||
{{ tools.getURLByHostAndFilePath(getRaccoltaCataloghiByMyPage?.pdf_online) }}
|
||||
</a>
|
||||
<span v-else>-</span>
|
||||
<br />(del {{ tools.getstrDateTime(getRaccoltaCataloghiByMyPage?.data_online) }})
|
||||
@@ -144,12 +145,12 @@
|
||||
<div v-if="getRaccoltaCataloghiByMyPage?.data_online_stampa">>
|
||||
PDF OnLine Stampa:
|
||||
<a
|
||||
:href="tools.getHost() + getRaccoltaCataloghiByMyPage?.pdf_online_stampa"
|
||||
:href="tools.getURLByHostAndFilePath(getRaccoltaCataloghiByMyPage?.pdf_online_stampa)"
|
||||
target="_blank"
|
||||
v-if="getRaccoltaCataloghiByMyPage?.pdf_online_stampa"
|
||||
class="text-bold"
|
||||
v-if="getRaccoltaCataloghiByMyPage?.pdf_online_stampa"
|
||||
>
|
||||
{{ tools.getHost() + getRaccoltaCataloghiByMyPage?.pdf_online_stampa }}
|
||||
{{ tools.getURLByHostAndFilePath(getRaccoltaCataloghiByMyPage?.pdf_online_stampa) }}
|
||||
</a>
|
||||
<span v-else>-</span>
|
||||
<br />(del {{ tools.getstrDateTime(getRaccoltaCataloghiByMyPage?.data_online_stampa) }})
|
||||
|
||||
Reference in New Issue
Block a user