- scheda prodotto migliorata

- aggiornamento filtri
This commit is contained in:
Surya Paolo
2025-04-24 01:03:20 +02:00
parent fc015404a6
commit 8d6c53803e
18 changed files with 420 additions and 152 deletions

View File

@@ -13,7 +13,10 @@ import type {
StateConnection,
ISchedaSingola,
IOptQueryGM,
IOptCatalogo
IOptCatalogo,
IProduct,
IProductInfo,
IVariazione
} from '@model';
import {
ICity, IMySkill,
@@ -442,6 +445,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
else if (table === 'authors') ris = Products.authors
else if (table === 'publishers') ris = Products.publishers
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
else if (table === 'queryais') ris = state.queryAIList
else if (table === 'sharewithus') ris = state.sharewithus
@@ -1829,6 +1834,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
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.authors = (res.data.authors) ? [...res.data.authors] : []
Products.publishers = (res.data.publishers) ? [...res.data.publishers] : []
@@ -2676,15 +2683,41 @@ export const useGlobalStore = defineStore('GlobalStore', {
}
},
async updateTablesInMemory(data: any) {
const table = data.table
const id = data.idRecUpdated
if (!id)
return
const productStore = useProducts()
try {
if (table === 'products') {
await productStore.loadProductById(id)
} else if (table === 'productinfos') {
}
} catch (error) {
console.error("Errore durante l'aggiornamento della tabella in memoria:", error);
}
},
async updateAllBookTableContent(options: any) {
try {
// aggiungi idapp ad options
options.idapp = tools.getEnv('VITE_APP_ID')
return Api.SendReq('/apisqlsrv/updateAllBook', 'POST', { options })
.then((res) => {
return await Api.SendReq('/apisqlsrv/updateAllBook', 'POST', { options })
.then(async (res) => {
if (res?.data?.data?.logerror) {
return { error: 'Errore ' + res?.data?.data?.logerror }
}
await this.updateTablesInMemory(res.data.data)
return res.data.data
}).catch((error: any) => {
console.error('Error fetchTableContent: ', error)
return { error: 'Errore ' + error }
})
} catch (error) {
console.error("Errore nel recupero della tabella:", error);