- 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

@@ -20,6 +20,7 @@ import { CImgTitle } from '@src/components/CImgTitle';
import { CImgPoster } from '@src/components/CImgPoster';
import { CTitle } from '@src/components/CTitle/index';
import { tools } from '@tools';
import { useRouter } from 'vue-router';
import { shared_consts } from '@src/common/shared_vuejs';
import { LandingFooter } from '@src/components/LandingFooter';
import { COpenStreetMap } from '@src/components/COpenStreetMap';
@@ -103,6 +104,7 @@ export default defineComponent({
setup(props, { emit }) {
const globalStore = useGlobalStore();
const catalogStore = useCatalogStore();
const router = useRouter();
const { setmeta, getsrcbyimg } = MixinMetaTags();
const { setValDb, getValDb } = MixinBase();
@@ -748,6 +750,14 @@ export default defineComponent({
}
}
function naviga(path: string) {
router.push(path);
}
function isElementoSpecifico() {
return myel.value.type === shared_consts.ELEMTYPE.CATALOGO;
}
onMounted(mounted);
return {
@@ -814,6 +824,8 @@ export default defineComponent({
importPage,
globalStore,
catalogStore,
naviga,
isElementoSpecifico,
};
},
});

View File

@@ -199,6 +199,7 @@
expand-separator
label="Dimensioni"
icon="fas fa-expand-alt"
v-if="!isElementoSpecifico()"
>
<div class="row">
<CMySlider
@@ -277,6 +278,7 @@
expand-separator
label="Allineamento"
icon="fas fa-align-center"
v-if="!isElementoSpecifico()"
>
<div class="row">
<q-select
@@ -359,6 +361,7 @@
expand-separator
label="Animazione"
icon="fas fa-play-circle"
v-if="!isElementoSpecifico()"
>
<CSelectAnimation
v-if="enableEdit && showAnimation"
@@ -373,6 +376,7 @@
expand-separator
label="Banner Iniziale"
icon="fas fa-play-circle"
v-if="!isElementoSpecifico()"
>
<div>Banner:</div>
@@ -1490,7 +1494,9 @@
:name="ind"
dense
:label="
`${ind}. ` + recscheda.scheda.name ? recscheda.scheda.name : `Scheda ` + (ind + 1)
`${ind}. ` + recscheda.scheda.name
? recscheda.scheda.name
: `Scheda ` + (ind + 1)
"
>
<div class="row">
@@ -1500,7 +1506,7 @@
rounded
outlined
v-model="recscheda.scheda.linkIdTemplate"
:options="globalStore.getSchedeOpt('SEARCH_')"
:options="globalStore.getSchedeOptByTag('SEARCH_')"
@update:model-value="modifElem"
label="Scheda collegata:"
style="width: 350px"
@@ -1508,6 +1514,20 @@
map-options
>
</q-select>
<q-btn
v-if="recscheda.scheda.linkIdTemplate"
icon="fas fa-edit"
label="Modifica Template"
color="primary"
@click="
naviga(
productStore.getFilePathByLinkIdTemplate(
recscheda.scheda.linkIdTemplate
)
)
"
>
</q-btn>
<q-toggle
v-model="recscheda.scheda.isTemplate"
@@ -1808,7 +1828,10 @@
v-model="myel.catalogo.selectedVersionStampabile"
:options="[
{ label: 'Versione Web', value: shared_consts.PREPARA_PDF.WEB },
{ label: 'Versione Stampabile', value: shared_consts.PREPARA_PDF.STAMPA },
{
label: 'Versione Stampabile',
value: shared_consts.PREPARA_PDF.STAMPA,
},
]"
label="Seleziona Versione"
emit-value
@@ -1837,6 +1860,7 @@
label="Catalogo collegato:"
style="width: 250px"
emit-value
:disabled="myel.catalogo.dimensioni_def.isTemplate"
map-options
>
</q-select>
@@ -1890,7 +1914,11 @@
:key="rec._id"
:name="ind"
dense
:label="`${ind}. ` + rec.scheda.name ? rec.scheda.name : `Scheda ` + (ind + 1)"
:label="
`${ind}. ` + rec.scheda.name
? rec.scheda.name
: `Scheda ` + (ind + 1)
"
>
</q-tab>
</q-tabs>
@@ -1979,7 +2007,7 @@
rounded
outlined
v-model="recscheda.scheda.linkIdTemplate"
:options="globalStore.getSchedeOpt()"
:options="globalStore.getSchedeOptByTag()"
@update:model-value="modifElem"
label="Scheda collegata:"
style="width: 350px"
@@ -1987,6 +2015,24 @@
map-options
>
</q-select>
LL: {{Products.getFilePathByLinkIdTemplate(
recscheda.scheda.linkIdTemplate
)}}
<q-btn
v-if="recscheda.scheda.linkIdTemplate"
icon="fas fa-edit"
label="Modifica Template"
color="primary"
@click="
naviga(
Products.getFilePathByLinkIdTemplate(
recscheda.scheda.linkIdTemplate
)
)
"
>
</q-btn>
<CMySlideNumber
v-model="recscheda.scheda.scalex"
label="Scale X:"
@@ -2010,7 +2056,7 @@
rounded
outlined
v-model="idSchedaDaCopiare"
:options="globalStore.getSchedeOpt()"
:options="globalStore.getSchedeOptByTag()"
@update:model-value="modifElem"
label="Scegli Scheda"
style="width: 250px"
@@ -2389,7 +2435,9 @@
</q-toggle>
<CMySlider
label="Primi N in Classifica"
v-model="recscheda.scheda.etichette.bestseller.quantiFattRaggiunti"
v-model="
recscheda.scheda.etichette.bestseller.quantiFattRaggiunti
"
:min="1"
:max="100"
color="green"
@@ -2408,6 +2456,7 @@
dense-toggle
expand-separator
label="Prima Pagina"
v-if="false"
icon="fas fa-play-circle"
>
<div class="row">
@@ -2436,6 +2485,7 @@
dense-toggle
expand-separator
label="Ultima Pagina"
v-if="false"
icon="fas fa-play-circle"
>
<div class="row">
@@ -2462,6 +2512,7 @@
dense-toggle
expand-separator
label="Per Stampa"
v-if="tools.isAdmin()"
icon="fas fa-play-circle"
>
<q-toggle
@@ -2527,7 +2578,10 @@
</q-select>
<div v-if="myel.catalogo.areadistampa.format.length > 1">
Ratio:
{{ myel.catalogo.areadistampa.format[0] / myel.catalogo.areadistampa.format[1] }}
{{
myel.catalogo.areadistampa.format[0] /
myel.catalogo.areadistampa.format[1]
}}
</div>
<q-select
rounded
@@ -2643,7 +2697,14 @@
<div>
<q-dialog
v-model="visuadd"
style="width: 600px; max-width: 100%; position: fixed; left: 0; top: 0; height: 100%"
style="
width: 600px;
max-width: 100%;
position: fixed;
left: 0;
top: 0;
height: 100%;
"
transition-show="slide-up"
transition-hide="slide-down"
>

View File

@@ -74,6 +74,7 @@ export default defineComponent({
const argomentistr = ref('')
const numprodtot = ref(0)
const editorestr = ref('')
const editore_escludi_str = ref('')
const products = useProducts()
@@ -141,6 +142,13 @@ export default defineComponent({
editorestr.value += rectrovato?.name + ' '
}
}
editore_escludi_str.value = ''
if (myrec.value.editore_escludi) {
for (const receditore of myrec.value.editore_escludi) {
const rectrovato: IPublisher = products.publishers.find((editore: IPublisher) => editore._id === receditore)
editores_escludi_tr.value += rectrovato?.name + ' '
}
}
statecolor.value = 'negative'
@@ -224,6 +232,7 @@ export default defineComponent({
apriInfo,
collanestr,
editorestr,
editorestr_escludi,
pagina_collegata,
esiste_descrintro,
argomentistr,

View File

@@ -92,6 +92,13 @@
<q-icon name="fas fa-book-open" /> {{ $t('cataloglist.casaeditrice') }}:
<span class="text-blue">{{ editorestr }}</span>
</div>
<div
v-if="!tools.isUtente() && editore_escludi_str && dettagli"
class="text-caption text-h7 text-grey q-pb-xs"
>
<q-icon name="fas fa-book-open" /> {{ $t('cataloglist.editore_escludi') }}:
<span class="text-blue">{{ editorestr_escludi }}</span>
</div>
<div
v-if="!tools.isUtente() && !esiste_descrintro && dettagli"
class="text-caption text-h7 text-grey q-pb-xs"

View File

@@ -1,11 +1,12 @@
<template>
<div style="width: 380px">
<q-banner
v-if="label"
rounded
dense
class="bg-blue-1 text-red"
color="primary q-title"
style="text-align: center"
style="text-align: center;"
>
{{ label }}
</q-banner>

View File

@@ -187,7 +187,7 @@ export default defineComponent({
async function updateproduct() {
console.log('props.id', props.id)
// console.log('props.id', props.id)
myproduct.value = await products.getProductById(props.id)
// products.updateQuantityAvailable(myproduct.value._id)

View File

@@ -13,6 +13,7 @@ export interface ICatalog {
idTipoFormato?: number[]
condition_andor: number,
editore?: string[]
editore_escludi?: string[]
collana_info?: ICollana
descr_introduttiva?: string
idPageAssigned?: string

View File

@@ -2057,6 +2057,8 @@ const msg_it = {
idPageAssigned_stampa: 'Pagina Assegnata (per STAMPA)',
descr_introduttiva: 'Descrizione Introduttiva (circa 1300 battute)',
editore: 'Marchio Editoriale',
editore_includi: 'Includi Editoriale',
editore_escludi: 'Escludi Editoriale',
versione_perstampa: 'Per Stampa',
pdf_generato: 'Pdf generato',
pdf_online: 'Pdf online Ufficiale',

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'

View File

@@ -730,6 +730,21 @@ export default defineComponent({
return editore;
}
function getEditore_escludiDaFiltrare(def_editori?: string[]) {
let editore: string[] = [];
// Cerca se nella lista cataloghi c'è la Collana di questa Pagina !
const trovatocatalogo = myCatalog.value;
if (trovatocatalogo) {
editore = trovatocatalogo.editore_escludi! || [];
} else {
editore = def_editori || [];
}
return editore;
}
function filterProducts(
products: IProduct[],
searchtext: string | string[],
@@ -739,6 +754,7 @@ export default defineComponent({
filtroidTipologie: number[],
filtroidTipoFormato: number[],
editore: string[],
editore_escludi: string[],
idCollane: string[],
arrargomstr: any[],
op_andor: IOpAndOr,
@@ -770,6 +786,7 @@ export default defineComponent({
const boolfiltroVuotoidTipologie = filtroidTipologie.length === 0;
const boolfiltroVuotoidTipoFormato = filtroidTipoFormato.length === 0;
const boolfiltroVuotoEditore = editore.length === 0;
const boolfiltroVuotoEditore_escludi = editore_escludi.length === 0;
const boolfiltroVuotoCollane = idCollane.length === 0;
const boolfiltroVuotoArgomenti = arrargomstr.length === 0;
@@ -783,6 +800,7 @@ export default defineComponent({
boolfiltroVuotoidTipologie &&
boolfiltroVuotoidTipoFormato &&
boolfiltroVuotoEditore &&
boolfiltroVuotoEditore_escludi &&
boolfiltroVuotoCollane &&
boolfiltroVuotoArgomenti &&
catstr === '' &&
@@ -916,6 +934,11 @@ export default defineComponent({
? se_tutti_veri
: editore.includes(product.productInfo.idPublisher);
// Filtri per editore_escludi
const hasPublished_escludi = boolfiltroVuotoEditore_escludi
? se_tutti_veri
: !editore_escludi.includes(product.productInfo.idPublisher);
// Filtri per GAS
const productgassel =
!gasselstr ||
@@ -943,6 +966,7 @@ export default defineComponent({
hasCollana,
hasCollanaStr,
hasPublished,
hasPublished_escludi,
];
// Decido se combinare in AND o OR sulla base della scelta globale
@@ -998,7 +1022,11 @@ export default defineComponent({
optcatalogo.value.idTipoFormato
);
const editore = getEditoreDaFiltrare(optcatalogo.value.editore);
const editore_escludi = getEditore_escludiDaFiltrare(
optcatalogo.value.editore_escludi
);
const filtroPublishers = editore || [];
const filtroPublishers_escludi = editore_escludi || [];
const idCollane = getIdCollaneDaFiltrare(optcatalogo.value.idCollane);
const filtroCollane = idCollane || [];
@@ -1046,6 +1074,7 @@ export default defineComponent({
filtroidTipologie,
filtroidTipoFormato,
filtroPublishers,
filtroPublishers_escludi,
filtroCollane,
arrargomstr,
op_andor,
@@ -1150,6 +1179,7 @@ export default defineComponent({
!arraysEqual(scheda.idTipologie, schedaprec?.idTipologie) ||
!arraysEqual(scheda.idTipoFormato, schedaprec?.idTipoFormato) ||
!arraysEqual(scheda.editore, schedaprec?.editore) ||
!arraysEqual(scheda.editore_escludi, schedaprec?.editore_escludi) ||
!arraysEqual(scheda.idCollane, schedaprec?.idCollane);
return isDifferent;
}
@@ -1163,7 +1193,9 @@ export default defineComponent({
const filtroidTipologie = scheda.idTipologie || [];
const filtroidTipoFormato = getidTipoFormatoDaFiltrare(scheda.idTipoFormato);
const editore = getEditoreDaFiltrare(scheda.editore);
const editore_escludi = getEditore_escludiDaFiltrare(scheda.editore_escludi);
const filtroPublishers = editore || [];
const filtroPublishers_escludi = editore_escludi || [];
const idCollane = getIdCollaneDaFiltrare(scheda.idCollane);
const filtroCollane = idCollane || [];
const arrargomstr =
@@ -1194,6 +1226,7 @@ export default defineComponent({
filtroidTipologie,
filtroidTipoFormato,
filtroPublishers,
filtroPublishers_escludi,
filtroCollane,
arrargomstr,
op_andor,
@@ -1518,7 +1551,7 @@ export default defineComponent({
// console.log('mounted Catalogo')
let mycat = null;
let instampa = false
let instampa = false;
if (optcatalogo.value.idCatalogSel) {
// controlla se è stato passato l'id dalla pagina:
@@ -2581,7 +2614,7 @@ export default defineComponent({
icon: 'check',
});
} else {
let error = ris?.error
let error = ris?.error;
$q.notify({
color: 'negative',
message: `PDF NON generato Errore: ${error}!`,
@@ -2864,6 +2897,12 @@ export default defineComponent({
updateCatalogoPadre();
}
function updatecatalogmodif(field: string, val: any) {
if (field) {
myCatalog.value[field] = val;
}
}
onMounted(mounted);
return {
@@ -2956,6 +2995,7 @@ export default defineComponent({
getSfondoImgCatalogo,
isStampa,
onlyCatalogoPDF,
updatecatalogmodif,
};
},
});

View File

@@ -1547,6 +1547,7 @@
:type="costanti.FieldType.multiselect"
jointable="t_web_tipiformatos"
class="q-mb-md"
@save="(v) => updatecatalogmodif('idTipoFormato', v)"
:dense="false"
>
</CMyValueDb>
@@ -1563,6 +1564,7 @@
debounce="1000"
:type="costanti.FieldType.op_andor"
class="q-mb-md"
@save="(v) => updatecatalogmodif('condition_andor', v)"
:dense="false"
>
</CMyValueDb>
@@ -1577,6 +1579,7 @@
debounce="1000"
:type="costanti.FieldType.multiselect"
jointable="catprods"
@save="(v) => updatecatalogmodif('argomenti', v)"
class="q-mb-md"
:dense="false"
>
@@ -1592,6 +1595,7 @@
debounce="1000"
:type="costanti.FieldType.multiselect"
jointable="collanastotali"
@save="(v) => updatecatalogmodif('idCollane', v)"
class="q-mb-md"
:dense="false"
>
@@ -1599,7 +1603,7 @@
<CMyValueDb
v-if="myCatalog"
:editOn="true"
:title="t('cataloglist.editore')"
:title="t('cataloglist.editore_includi')"
table="catalogs"
:id="myCatalog._id"
:rec="myCatalog"
@@ -1607,6 +1611,23 @@
debounce="1000"
:type="costanti.FieldType.multiselect"
jointable="publishers_totali"
@save="(v) => updatecatalogmodif('editore', v)"
class="q-mb-md"
:dense="false"
>
</CMyValueDb>
<CMyValueDb
v-if="myCatalog"
:editOn="true"
:title="t('cataloglist.editore_escludi')"
table="catalogs"
:id="myCatalog._id"
:rec="myCatalog"
mykey="editore_escludi"
debounce="1000"
:type="costanti.FieldType.multiselect"
jointable="publishers_totali"
@save="(v) => updatecatalogmodif('editore_escludi', v)"
class="q-mb-md"
:dense="false"
>