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

View File

@@ -116,8 +116,9 @@
: element.productInfo?.image_link : element.productInfo?.image_link
" "
style="width: 50px; height: 50px" style="width: 50px; height: 50px"
class="rounded-borders cursor-pointer" class="rounded-borders"
@click="showProduct(element)" :style="isProduct() ? 'cursor: pointer' : ''"
@click="isProduct() ? showProduct(element) : null"
/> />
</td> </td>
@@ -138,12 +139,16 @@
> >
<q-list> <q-list>
<q-item <q-item
v-if="isVisibleEditBtn"
clickable clickable
v-close-popup v-close-popup
@click="modifyProduct(element)" @click="modifyProduct(element)"
> >
<q-item-section> <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-section>
</q-item> </q-item>
<q-item <q-item
@@ -152,7 +157,10 @@
@click="removeProduct(element)" @click="removeProduct(element)"
> >
<q-item-section> <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-section>
</q-item> </q-item>
</q-list> </q-list>

View File

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

View File

@@ -26,25 +26,28 @@ export const useCatalogStore = defineStore('CatalogStore', {
}), }),
getters: { getters: {
getCatalogById: (state) => async (id: string) => { getCatalogById: (state) => (id: string) => {
// carica in memoria il catalogo singolo return state.catalogs.find((cat: ICatalog) => cat._id === id) || null;
// 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;
}, },
}, },
actions: { 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) { async loadCatalogById(id: string) {
const userStore = useUserStore();
const globalStore = useGlobalStore(); const globalStore = useGlobalStore();
let ris = null; let ris = null;
@@ -54,15 +57,12 @@ export const useCatalogStore = defineStore('CatalogStore', {
console.log('catalogs', res.data.catalog); console.log('catalogs', res.data.catalog);
if (res.data.catalog) { if (res.data.catalog) {
// console.log('RISULTANTE CATEGORIES DAL SERVER = ', res.data.categories) // console.log('RISULTANTE CATEGORIES DAL SERVER = ', res.data.categories)
this.updateDataCatalog(res);
return res.data.product; return res.data.product;
} else {
return null;
} }
return null;
}) })
.catch((error) => { .catch((error) => {
console.log('error loadCatalogById', error); console.log('error loadCatalogById', error);
userStore.setErrorCatch(error);
return new Types.AxiosError(serv_constants.RIS_CODE_ERR, null, toolsext.ERR_GENERICO, 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) { if (getCatalogoByMyPage.value) {
tabcatalogo.value = tools.getCookie('TAB_CAT', 'lista'); tabcatalogo.value = tools.getCookie('TAB_CAT', 'lista');
} else { } else {
tabcatalogo.value = 'lista'; tabcatalogo.value = 'visu'
} }
optrigenera.value.visibilitaDisp = tools.getCookie( optrigenera.value.visibilitaDisp = tools.getCookie(
@@ -1394,12 +1394,14 @@ export default defineComponent({
); );
loadpage.value = false; loadpage.value = false;
if (showListaFiltrata.value) { if (showListaFiltrata.value || !getCatalogoByMyPage.value) {
// Carica tutti i prodotti // Carica tutti i prodotti
await productStore.loadProducts(true); await productStore.loadProducts(true);
} else { } else {
if (getCatalogoByMyPage.value && props.idPage) {
getCatalogoByMyPage.value.lista_prodotti = await catalogStore.loadProductsOnlyByIdPageCatalog(props.idPage); getCatalogoByMyPage.value.lista_prodotti = await catalogStore.loadProductsOnlyByIdPageCatalog(props.idPage);
} }
}
mycolumns.value = fieldsTable.getArrColsByTable('products'); mycolumns.value = fieldsTable.getArrColsByTable('products');

View File

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