- ottimizzato il caricamento del sito
- ottimizzato il caricamento del catalogo.
This commit is contained in:
@@ -154,7 +154,7 @@ export default defineComponent({
|
||||
};
|
||||
|
||||
function updateCatalogoPadre() {
|
||||
console.log('catalogo.ts PADRE');
|
||||
// console.log('catalogo.ts PADRE');
|
||||
emit('update:modelValue', optcatalogo.value);
|
||||
//emit('updateCatalogo', optcatalogo.value);
|
||||
}
|
||||
@@ -405,7 +405,7 @@ export default defineComponent({
|
||||
watch(
|
||||
() => optcatalogo.value.aggiorna,
|
||||
(newval, oldval) => {
|
||||
console.log('Aggiorna array...');
|
||||
// console.log('Aggiorna array...');
|
||||
generatearrProdToViewSorted();
|
||||
}
|
||||
);
|
||||
@@ -580,7 +580,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function populateDataWithlinkIdTemplate() {
|
||||
console.log('populateDataWithlinkIdTemplate')
|
||||
// console.log('populateDataWithlinkIdTemplate')
|
||||
|
||||
if (optcatalogo.value) {
|
||||
// LINK PAGINA
|
||||
@@ -830,17 +830,23 @@ export default defineComponent({
|
||||
})
|
||||
.sort((a, b) => (getProductsSorted([a, b], sortField, sortDir)[0] === a ? -1 : 1));
|
||||
|
||||
console.log(' sortField=' + sortField);
|
||||
console.log(' sortDir=' + sortDir);
|
||||
console.log(' Filtro=' + arrargomstr);
|
||||
console.log(' idCollane=' + idCollane);
|
||||
console.log('PRODOTTI FILTRATI:', arrris.length);
|
||||
// console.log(' sortField=' + sortField);
|
||||
// console.log(' sortDir=' + sortDir);
|
||||
// console.log(' Filtro=' + arrargomstr);
|
||||
// console.log(' idCollane=' + idCollane);
|
||||
// console.log('PRODOTTI FILTRATI:', arrris.length);
|
||||
|
||||
return arrris;
|
||||
}
|
||||
|
||||
async function calcArrProducts(generalista?: boolean) {
|
||||
console.log('calcArrProducts (generalista=' + generalista + ')');
|
||||
// console.log('calcArrProducts (generalista=' + generalista + ')');
|
||||
|
||||
if (generalista) {
|
||||
// Devono esistere tutti i prodotti
|
||||
await productStore.loadProducts(true);
|
||||
}
|
||||
|
||||
|
||||
if (!loadpage.value) return;
|
||||
|
||||
@@ -872,7 +878,7 @@ export default defineComponent({
|
||||
// Se nel catalogo è stato già generato, allora gli passo quello.
|
||||
const trovatocatalogo = getCatalogoByMyPage.value;
|
||||
|
||||
if (editore) console.log('FILTRO editore', editore);
|
||||
// if (editore) console.log('FILTRO editore', editore);
|
||||
|
||||
if (showListaFiltrata.value) {
|
||||
generalista = true;
|
||||
@@ -933,9 +939,9 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
console.log('***** FINE calcArrPROD');
|
||||
// console.log('***** FINE calcArrPROD');
|
||||
|
||||
console.log('areadistampa FINITO...', optcatalogo.value.areadistampa)
|
||||
// console.log('areadistampa FINITO...', optcatalogo.value.areadistampa)
|
||||
|
||||
generatinglist.value = false;
|
||||
rigeneraLibri.value = false;
|
||||
@@ -1073,9 +1079,9 @@ export default defineComponent({
|
||||
function getProductsSorted(arrprod: IProduct[], sort_field: string, sort_dir: number): IProduct[] {
|
||||
if (sort_field) {
|
||||
// console.log('--- Primi 10 elementi INIZIALI:');
|
||||
arrprod.slice(0, 15).forEach((product, index) => {
|
||||
/*arrprod.slice(0, 15).forEach((product, index) => {
|
||||
console.log(`${index + 1}. ${product.productInfo?.name} (${product.productInfo?.date_pub})`);
|
||||
});
|
||||
});*/
|
||||
|
||||
// Crea una copia dell'array per non modificare l'originale
|
||||
const sortedArr = [...arrprod].sort((a: IProduct, b: IProduct) => {
|
||||
@@ -1101,11 +1107,11 @@ export default defineComponent({
|
||||
// logga i primi N elementi, mostrando il nome del prodotto (productInfo.name e la data di pibblicazione : productinfo.date_pub
|
||||
if (sortedArr.length > 0) {
|
||||
// console.log('Primi 15 elementi ordinati: ***** ');
|
||||
sortedArr.slice(0, 15).forEach((product, index) => {
|
||||
/*sortedArr.slice(0, 15).forEach((product, index) => {
|
||||
console.log(`${index + 1}. ${product.productInfo?.name} (${product.productInfo?.date_pub})`);
|
||||
});
|
||||
});*/
|
||||
} else {
|
||||
console.log('Nessun prodotto trovato.');
|
||||
// console.log('Nessun prodotto trovato.');
|
||||
}
|
||||
|
||||
return sortedArr;
|
||||
@@ -1355,7 +1361,12 @@ export default defineComponent({
|
||||
);
|
||||
|
||||
loadpage.value = false;
|
||||
await productStore.loadProducts(true);
|
||||
if (showListaFiltrata.value) {
|
||||
// Carica tutti i prodotti
|
||||
await productStore.loadProducts(true);
|
||||
} else {
|
||||
getCatalogoByMyPage.value.lista_prodotti = await catalogStore.loadProductsOnlyByIdPageCatalog(props.idPage);
|
||||
}
|
||||
|
||||
mycolumns.value = fieldsTable.getArrColsByTable('products');
|
||||
|
||||
|
||||
@@ -1070,7 +1070,7 @@
|
||||
@close="addnewProd = false"
|
||||
nameLinkTemplate="SEARCH_Prima"
|
||||
:empty="true"
|
||||
table="catalogs"
|
||||
table="products"
|
||||
>
|
||||
</CSearchProduct>
|
||||
</CMyDialog>
|
||||
|
||||
Reference in New Issue
Block a user