- sistemato "Pare che selezionando una condizione, non sempre viene aggiornato il record !"

- Aggiunto filtro "Escludi Editoriale"
This commit is contained in:
Surya Paolo
2025-06-04 15:46:29 +02:00
parent 12f816b738
commit 06fe6eb861
13 changed files with 209 additions and 29 deletions

View File

@@ -222,7 +222,14 @@ export const colTableCatalogList = [
}),
AddCol({
name: 'editore',
label_trans: 'cataloglist.editore',
label_trans: 'cataloglist.editore_includi',
fieldtype: costanti.FieldType.multiselect,
jointable: 'publishers_totali',
isadvanced_field: true,
}),
AddCol({
name: 'editore_escludi',
label_trans: 'cataloglist.editore_escludi',
fieldtype: costanti.FieldType.multiselect,
jointable: 'publishers_totali',
isadvanced_field: true,

View File

@@ -547,16 +547,18 @@ export const useProducts = defineStore('Products', {
return options;
},
getAutoriByIdAuthors: (state: IProductsState) => (arridAuthors: []) : string => {
let strAutori = '';
for (const aut of arridAuthors) {
const found = state.authors.find((rec: IAuthor) => rec._id === aut);
if (found) {
strAutori += found.name + (found.surname ? ' ' + found.surname : '') + ', ';
getAutoriByIdAuthors:
(state: IProductsState) =>
(arridAuthors: []): string => {
let strAutori = '';
for (const aut of arridAuthors) {
const found = state.authors.find((rec: IAuthor) => rec._id === aut);
if (found) {
strAutori += found.name + (found.surname ? ' ' + found.surname : '') + ', ';
}
}
}
return strAutori.replace(/, $/, '');
},
return strAutori.replace(/, $/, '');
},
getNumProdTot: (state: IProductsState) => (): number => {
return state.products.length;
@@ -2236,7 +2238,7 @@ export const useProducts = defineStore('Products', {
return arr;
},
getSchedeOpt(arrschede: ISchedaSingola[], tag?: string): any[] {
getSchedeOptByArrSchede(arrschede: ISchedaSingola[], tag?: string): any[] {
let arr: any = [];
const globalStore = useGlobalStore();
@@ -2538,5 +2540,22 @@ export const useProducts = defineStore('Products', {
this.userActive = userStore.my;
},
getFilePathByLinkIdTemplate(linkidTemplate: string) {
try {
const globalStore = useGlobalStore();
const myelem = globalStore.myschedas.find((recscheda: IMyScheda) =>
(recscheda: ISchedaSingola) => recscheda.scheda._id === linkidTemplate
);
if (myelem) {
const idPage = myelem.idPageOrig;
const path = globalStore.getPathByIdPage(idPage);
return path ? '/' + path : '';
}
return '';
} catch (e) {
return '';
}
},
},
});

View File

@@ -336,16 +336,16 @@ export const useGlobalStore = defineStore('GlobalStore', {
return false;
},
getSchedeOpt: (state: IGlobalState) => (tag?: string) => {
getSchedeOptByTag: (state: IGlobalState) => (tag?: string) => {
const Products = useProducts();
return Products.getSchedeOpt(state.myschedas, tag);
return Products.getSchedeOptByArrSchede(state.myschedas, tag);
},
getOptCatalogoTemplate: (state: IGlobalState) => (tag?: string) => {
const Products = useProducts();
return Products.getSchedeOpt(state.myschedas, tag);
return Products.getSchedeOptByArrSchede(state.myschedas, tag);
},
getLinkIdTemplateByName: (state: IGlobalState) => (name: string) => {
@@ -556,7 +556,7 @@ 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.getSchedeOptByArrSchede(state.myschedas);
else if (table === 'provinces')
return state.provinces.filter(
(rec: IProvince) => !rec.card && rec.prov !== 'ITA' && rec.prov !== 'EST'