corretto altre cose (workbox mancante)

This commit is contained in:
Surya Paolo
2025-05-15 21:41:25 +02:00
parent 685bc34bd0
commit daeb865e93
8 changed files with 141 additions and 410500 deletions

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
!function(){"use strict";try{self["workbox:sw:5.1.4"]&&_()}catch(t){}const t={backgroundSync:"background-sync",broadcastUpdate:"broadcast-update",cacheableResponse:"cacheable-response",core:"core",expiration:"expiration",googleAnalytics:"offline-ga",navigationPreload:"navigation-preload",precaching:"precaching",rangeRequests:"range-requests",routing:"routing",strategies:"strategies",streams:"streams"};self.workbox=new class{constructor(){return this.v={},this.t={debug:"localhost"===self.location.hostname,modulePathPrefix:null,modulePathCb:null},this.s=this.t.debug?"dev":"prod",this.o=!1,new Proxy(this,{get(e,s){if(e[s])return e[s];const o=t[s];return o&&e.loadModule("workbox-"+o),e[s]}})}setConfig(t={}){if(this.o)throw new Error("Config must be set before accessing workbox.* modules");Object.assign(this.t,t),this.s=this.t.debug?"dev":"prod"}loadModule(t){const e=this.i(t);try{importScripts(e),this.o=!0}catch(s){throw console.error(`Unable to import module '${t}' from '${e}'.`),s}}i(t){if(this.t.modulePathCb)return this.t.modulePathCb(t,this.t.debug);let e=["https://storage.googleapis.com/workbox-cdn/releases/5.1.4"];const s=`${t}.${this.s}.js`,o=this.t.modulePathPrefix;return o&&(e=o.split("/"),""===e[e.length-1]&&e.splice(e.length-1,1)),e.push(s),e.join("/")}}}();
//# sourceMappingURL=workbox-sw.js.map

View File

@@ -107,6 +107,8 @@ export default defineComponent({
const allColumns = ref([]);
const isVisibleEditBtn = ref(false)
// Colonne della tabella
const allColumns_Raccolta = ref([
{ name: 'pos', label: 'Ind', field: 'pos', align: 'left', style: 'width: 50px', notsortable: true },
@@ -208,8 +210,10 @@ export default defineComponent({
if (props.table === 'products') {
allColumns.value = allColumns_Catalog.value;
isVisibleEditBtn.value = true
} else if (props.table === 'catalogs') {
allColumns.value = allColumns_Raccolta.value;
isVisibleEditBtn.value = false
}
optionscatalogo.value = {
@@ -783,6 +787,10 @@ export default defineComponent({
return image;
}
function isProduct() {
return props.table === 'products'
}
onMounted(mounted);
return {
@@ -825,6 +833,8 @@ export default defineComponent({
exportToCSV,
isSortable,
getImageByElement,
isVisibleEditBtn,
isProduct,
};
},
});

View File

@@ -116,8 +116,9 @@
: element.productInfo?.image_link
"
style="width: 50px; height: 50px"
class="rounded-borders cursor-pointer"
@click="showProduct(element)"
class="rounded-borders"
:style="isProduct() ? 'cursor: pointer' : ''"
@click="isProduct() ? showProduct(element) : null"
/>
</td>
@@ -138,12 +139,16 @@
>
<q-list>
<q-item
v-if="isVisibleEditBtn"
clickable
v-close-popup
@click="modifyProduct(element)"
>
<q-item-section>
<q-item-label>Modifica</q-item-label>
<q-item-label>
<q-icon name="edit" size="20px" class="q-mr-xs" />
Modifica
</q-item-label>
</q-item-section>
</q-item>
<q-item
@@ -152,7 +157,10 @@
@click="removeProduct(element)"
>
<q-item-section>
<q-item-label>Elimina</q-item-label>
<q-item-label>
<q-icon name="delete" size="20px" class="q-mr-xs" />
Elimina
</q-item-label>
</q-item-section>
</q-item>
</q-list>

View File

@@ -152,7 +152,10 @@ export default defineComponent({
} else if (props.table === 'catalogs') {
if (id) {
myproduct.value = await catalogStore.getCatalogById(id);
myproduct.value = catalogStore.getCatalogById(id);
if (!myproduct.value) {
await catalogStore.fetchCatalogById(id)
}
} else {
myproduct.value = null;
}

View File

@@ -26,25 +26,28 @@ export const useCatalogStore = defineStore('CatalogStore', {
}),
getters: {
getCatalogById: (state) => async (id: string) => {
// carica in memoria il catalogo singolo
// se non lo trovo, allora lo carica dal server
let cat = state.catalogs.find((cat: ICatalog) => cat._id === id);
if ((cat && !cat.prodotti_caricati_inmem) || !cat) {
// Lo carica dal server
cat = await this.loadCatalogById(id);
}
return cat;
getCatalogById: (state) => (id: string) => {
return state.catalogs.find((cat: ICatalog) => cat._id === id) || null;
},
},
actions: {
async fetchCatalogById(id: string) {
// Controlla se è già in memoria
let cat = this.getCatalogById(id);
if (!cat || !cat.prodotti_caricati_inmem) {
// Carica dal server
const ris = await this.loadCatalogById(id);
if (ris) {
// Aggiorna lo store con i dati ricevuti
this.updateDataCatalog(ris);
cat = this.getCatalogById(id);
}
}
return cat;
},
async loadCatalogById(id: string) {
const userStore = useUserStore();
const globalStore = useGlobalStore();
let ris = null;
@@ -54,15 +57,12 @@ export const useCatalogStore = defineStore('CatalogStore', {
console.log('catalogs', res.data.catalog);
if (res.data.catalog) {
// console.log('RISULTANTE CATEGORIES DAL SERVER = ', res.data.categories)
this.updateDataCatalog(res);
return res.data.product;
} else {
return null;
}
return null;
})
.catch((error) => {
console.log('error loadCatalogById', error);
userStore.setErrorCatch(error);
return new Types.AxiosError(serv_constants.RIS_CODE_ERR, null, toolsext.ERR_GENERICO, error);
});

View File

@@ -1376,7 +1376,7 @@ export default defineComponent({
if (getCatalogoByMyPage.value) {
tabcatalogo.value = tools.getCookie('TAB_CAT', 'lista');
} else {
tabcatalogo.value = 'lista';
tabcatalogo.value = 'visu'
}
optrigenera.value.visibilitaDisp = tools.getCookie(
@@ -1394,12 +1394,14 @@ export default defineComponent({
);
loadpage.value = false;
if (showListaFiltrata.value) {
if (showListaFiltrata.value || !getCatalogoByMyPage.value) {
// Carica tutti i prodotti
await productStore.loadProducts(true);
} else {
if (getCatalogoByMyPage.value && props.idPage) {
getCatalogoByMyPage.value.lista_prodotti = await catalogStore.loadProductsOnlyByIdPageCatalog(props.idPage);
}
}
mycolumns.value = fieldsTable.getArrColsByTable('products');

View File

@@ -273,7 +273,7 @@
>
</q-tab>
<q-tab
v-if="showListaFiltrata"
v-if="showListaFiltrata && false"
name="autori"
icon="fas fa-user"
label="Autori"
@@ -301,7 +301,7 @@
</q-tabs>
<CTitleBanner
v-show="tabcatalogo === 'visu'"
v-show="tabcatalogo === 'visu' && !tools.isUtente()"
class="q-pa-xs"
title="Genera PDF"
bgcolor="bg-blue"
@@ -340,6 +340,7 @@
:color="optcatalogo.indebug ? `positive` : 'primary'"
></q-btn>
</div>
<div v-if="getCatalogoByMyPage">
<div
v-if="getCatalogoByMyPage.pdf_generato"
class="bg-green-1 q-ma-sm q-pa-sm"
@@ -432,6 +433,7 @@
</div>
</div>
</div>
</div>
</CTitleBanner>
<q-tab-panels