Cataloghi...
This commit is contained in:
@@ -1045,6 +1045,7 @@
|
||||
@save="SaveValue"
|
||||
@show="selItem(props.row, col)"
|
||||
@showandsave="showandsave"
|
||||
:dense="true"
|
||||
>
|
||||
</CMyPopupEdit>
|
||||
</div>
|
||||
@@ -1195,6 +1196,7 @@
|
||||
@save="SaveValue"
|
||||
@show="selItem(props.row, col)"
|
||||
@showandsave="showandsave"
|
||||
:dense="true"
|
||||
>
|
||||
</CMyPopupEdit>
|
||||
</div>
|
||||
@@ -1390,6 +1392,7 @@
|
||||
@showandsave="showandsave"
|
||||
@annulla="annulla"
|
||||
@update_col="update_col"
|
||||
:dense="true"
|
||||
>
|
||||
</CMyPopupEdit>
|
||||
</div>
|
||||
@@ -1507,7 +1510,7 @@
|
||||
size="md"
|
||||
dense
|
||||
:icon="!showfilteradv ? 'fas fa-arrow-down' : 'fas fa-arrow-up'"
|
||||
:label="!showfilteradv ? $t('grid.advanced_filters') : $t('grid.hide_advanced_filters')"
|
||||
:label="!showfilteradv ? $t('grid.show_campi_avanzati') : $t('grid.hide_campi_avanzati')"
|
||||
@click="showfilteradv = !showfilteradv"
|
||||
></q-btn>
|
||||
</div>
|
||||
|
||||
@@ -787,7 +787,10 @@ export default defineComponent({
|
||||
modifElem()
|
||||
}
|
||||
function updateSizeHeight(value: any) {
|
||||
myel.value.heightimg = value; // Aggiorna widthimg con il nuovo valore
|
||||
if (value)
|
||||
myel.value.heightimg = value; // Aggiorna widthimg con il nuovo valore
|
||||
else
|
||||
myel.value.heightimg = ''
|
||||
modifElem()
|
||||
}
|
||||
|
||||
@@ -1079,6 +1082,7 @@ export default defineComponent({
|
||||
modifElemAndSchede,
|
||||
exportPage,
|
||||
importPage,
|
||||
globalStore,
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
(!myel.active ? ` clEditNotActive` : ``)
|
||||
"
|
||||
>
|
||||
<div v-if="!!myel.type">
|
||||
<div v-if="myel && myel.type">
|
||||
<div class="row justify-evenly q-gutter-sm">
|
||||
<q-btn
|
||||
class="q-ma-sm"
|
||||
@@ -1508,15 +1508,16 @@
|
||||
v-if="enableEdit"
|
||||
rounded
|
||||
outlined
|
||||
v-model="myel.catalogo.idCollana"
|
||||
v-model="myel.catalogo.idCollane"
|
||||
:options="Products.collane"
|
||||
@update:model-value="modifElem"
|
||||
label="Collana"
|
||||
label="Collane"
|
||||
style="width: 300px"
|
||||
multiple
|
||||
emit-value
|
||||
map-options
|
||||
option-value="idCollana"
|
||||
option-label="descrizione"
|
||||
option-label="title"
|
||||
>
|
||||
</q-select>
|
||||
</div>
|
||||
|
||||
@@ -95,7 +95,7 @@ export default defineComponent({
|
||||
const myelemVoid = ref({ _id: objectId(), active: true, type: shared_consts.ELEMTYPE.TEXT, container: '...', path: mypathin.value } as IMyElem)
|
||||
|
||||
|
||||
const selElem = ref(globalStore.selElem)
|
||||
const selElem = ref(<IMyElem|null>globalStore.selElem)
|
||||
const site = ref(globalStore.site)
|
||||
|
||||
const onloading = ref(false)
|
||||
@@ -166,7 +166,7 @@ export default defineComponent({
|
||||
visuEditor.value = false
|
||||
}
|
||||
function selElemClick(myelem: IMyElem) {
|
||||
// console.log('mypageelem selElemClick', myelem)
|
||||
console.log('mypageelem selElemClick', myelem)
|
||||
|
||||
selElem.value = {}
|
||||
selElem.value = myelem
|
||||
|
||||
@@ -322,9 +322,9 @@
|
||||
:label="
|
||||
col.visulabel
|
||||
? $t(col.label_trans)
|
||||
: addstrrequired + visulabel
|
||||
? $t(col.label_trans)
|
||||
: ''
|
||||
: (visulabel
|
||||
? addstrrequired + $t(col.label_trans)
|
||||
: '')
|
||||
"
|
||||
type="number"
|
||||
autofocus
|
||||
@@ -672,7 +672,7 @@
|
||||
col.label
|
||||
? addstrrequired + col.label
|
||||
: col.label_trans
|
||||
? addstrrequired + $t(col.label_trans)
|
||||
? (addstrrequired + $t(col.label_trans))
|
||||
: ''
|
||||
"
|
||||
:class="{ 'cursor-pointer': canEdit }"
|
||||
@@ -697,7 +697,7 @@
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.onlydate">
|
||||
<CDateTime
|
||||
:label="col.label ? addstrrequired + col.label : addstrrequired + $t(col.label_trans)"
|
||||
:label="col.label ? (addstrrequired + col.label) : (addstrrequired + $t(col.label_trans))"
|
||||
:class="{ 'cursor-pointer': canEdit }"
|
||||
:valueDate="myvalue"
|
||||
v-model:value="myvalue"
|
||||
@@ -1197,7 +1197,7 @@
|
||||
:maxlength="col.maxlength ? col.maxlength : undefined"
|
||||
:minlength="col.minlength ? col.minlength : undefined"
|
||||
v-model="scope.value"
|
||||
:label="col.visulabel ? addstrrequired + $t(col.label_trans) : ''"
|
||||
:label="col.visulabel ? (addstrrequired + $t(col.label_trans)) : ''"
|
||||
:autogrow="col.fieldtype !== costanti.FieldType.crypted"
|
||||
@keyup.enter.stop
|
||||
autofocus
|
||||
@@ -1219,8 +1219,8 @@
|
||||
:label="
|
||||
col.visulabel
|
||||
? $t(col.label_trans)
|
||||
: addstrrequired + visulabel
|
||||
? addstrrequired + col.label
|
||||
: visulabel
|
||||
? (addstrrequired + col.label)
|
||||
: ''
|
||||
"
|
||||
>
|
||||
@@ -1495,10 +1495,10 @@
|
||||
<CDateTime
|
||||
:label="
|
||||
col.label
|
||||
? addstrrequired + col.label
|
||||
: col.label_trans
|
||||
? addstrrequired + $t(col.label_trans)
|
||||
: ''
|
||||
? (addstrrequired + col.label)
|
||||
: (col.label_trans
|
||||
? (addstrrequired + $t(col.label_trans))
|
||||
: '')
|
||||
"
|
||||
:class="{ 'cursor-pointer': canEdit }"
|
||||
v-model:value="myvalue"
|
||||
@@ -1513,7 +1513,7 @@
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.onlydate">
|
||||
<CDateTime
|
||||
:label="col.label ? addstrrequired + col.label : addstrrequired + $t(col.label_trans)"
|
||||
:label="col.label ? addstrrequired + col.label : (addstrrequired + $t(col.label_trans))"
|
||||
:class="{ 'cursor-pointer': canEdit }"
|
||||
:valueDate="myvalue"
|
||||
v-model:value="myvalue"
|
||||
@@ -1554,7 +1554,7 @@
|
||||
:maxlength="col.maxlength ? col.maxlength : undefined"
|
||||
:minlength="col.minlength ? col.minlength : undefined"
|
||||
v-model="scope.value"
|
||||
:label="col.visulabel ? addstrrequired + $t(col.label_trans) : ''"
|
||||
:label="col.visulabel ? (addstrrequired + $t(col.label_trans)) : ''"
|
||||
:autogrow="col.fieldtype !== costanti.FieldType.crypted"
|
||||
@keyup.enter.stop
|
||||
autofocus
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<q-item>
|
||||
<q-item-section side v-if="tools.canModifyThisRec(myrec, table) || editOn">
|
||||
<q-item-label>
|
||||
<q-btn rounded dense icon="fas fa-pencil-alt">
|
||||
<q-btn rounded dense icon="fas fa-pencil-alt" color="blue">
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item
|
||||
|
||||
@@ -588,7 +588,7 @@ export default defineComponent({
|
||||
valori.value = myarr.filter((v: any) => {
|
||||
let mioval = tools.getRecordByField(optlab, v)
|
||||
if (mioval)
|
||||
return mioval.toLowerCase().indexOf(mystr) > -1
|
||||
return mioval?.toLowerCase().indexOf(mystr) > -1
|
||||
else
|
||||
return false
|
||||
|
||||
@@ -698,7 +698,7 @@ export default defineComponent({
|
||||
// Se esiste già, non crearlo
|
||||
const esiste = optionsreal.value.find((rec: any) => {
|
||||
// console.log('rec[fieldval]',rec[fieldval], value.toLowerCase())
|
||||
return rec[fieldval].toLowerCase() === value.toLowerCase() && (rec[props.filter_field] === props.value_extra)
|
||||
return rec[fieldval]?.toLowerCase() === value.toLowerCase() && (rec[props.filter_field] === props.value_extra)
|
||||
})
|
||||
console.log('esiste', esiste)
|
||||
if (!esiste || (esiste && esiste.length === 0)) {
|
||||
|
||||
@@ -19,7 +19,6 @@ import { CMyFieldDb } from '@/components/CMyFieldDb'
|
||||
import { CSelectUserActive } from '@/components/CSelectUserActive'
|
||||
import { toolsext } from '@store/Modules/toolsext'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { useTestStore } from '@store/testStore'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { useProducts } from '@store/Products'
|
||||
|
||||
@@ -70,7 +69,6 @@ export default defineComponent({
|
||||
const userStore = useUserStore()
|
||||
const globalStore = useGlobalStore()
|
||||
const products = useProducts()
|
||||
const testStore = useTestStore()
|
||||
const notifStore = useNotifStore()
|
||||
|
||||
const { getnumItemsCart } = MixinUsers()
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { ICollana } from "./Products"
|
||||
|
||||
export interface FotoCatalogo {
|
||||
imagefile: string
|
||||
@@ -15,9 +16,10 @@ export interface ICatalog {
|
||||
active?: boolean
|
||||
title: string
|
||||
foto_collana?: FotoCatalogo,
|
||||
idCollana?: string
|
||||
idCollane?: number[]
|
||||
collana_info?: ICollana
|
||||
descr_introduttiva?: string
|
||||
idTemplateScheda?: string
|
||||
idPageAssigned?: string
|
||||
referenti?: string[]
|
||||
img_bordata_web?: FotoCatalogo,
|
||||
img_bordata_stampa?: FotoCatalogo,
|
||||
@@ -32,5 +34,5 @@ export interface ICatalog {
|
||||
}
|
||||
|
||||
export interface ICatalogState {
|
||||
catalog?: ICatalog
|
||||
catalogs?: ICatalog[]
|
||||
}
|
||||
@@ -799,7 +799,7 @@ export interface IMyScheda {
|
||||
excludeproductTypes?: number[]
|
||||
editore?: string[]
|
||||
argomenti?: string[]
|
||||
collana?: string
|
||||
idCollane?: number[]
|
||||
author?: string
|
||||
sort_field?: string
|
||||
sort_dir?: number
|
||||
@@ -826,7 +826,7 @@ export interface IOptCatalogo {
|
||||
Categoria?: string[]
|
||||
editore?: string[]
|
||||
argomenti?: string[]
|
||||
collana?: string
|
||||
idCollane?: number[]
|
||||
sort_field?: string
|
||||
sort_dir?: number
|
||||
pdf?: boolean
|
||||
|
||||
@@ -34,7 +34,7 @@ export interface IProductInfo {
|
||||
checkout_link?: string
|
||||
idAuthors?: string[]
|
||||
authors?: string[]
|
||||
idCollana?: string
|
||||
idCollana?: number
|
||||
collana?: ICollana
|
||||
collezione?: string
|
||||
idPublisher?: string
|
||||
@@ -223,8 +223,7 @@ export interface ICatProd {
|
||||
export interface ICollana {
|
||||
_id?: any
|
||||
idCollana: number,
|
||||
descrizione: string,
|
||||
descrizione_estesa?: string,
|
||||
title: string,
|
||||
}
|
||||
|
||||
export interface ICatAI {
|
||||
|
||||
@@ -539,6 +539,7 @@ const msg_it = {
|
||||
ritessitura: 'RITESSITURA',
|
||||
},
|
||||
reg: {
|
||||
nameorg: 'Nome Organizzazione',
|
||||
version: 'Versione',
|
||||
socio: 'Socio',
|
||||
socioresidente: 'Residente',
|
||||
@@ -2013,6 +2014,8 @@ const msg_it = {
|
||||
referenti: 'Referenti',
|
||||
img_bordata_web: 'Foto Bordo per Web',
|
||||
collane: 'Collane',
|
||||
idPageAssigned: 'Pagina Assegnata',
|
||||
descr_introduttiva: 'Descrizione Introduttiva',
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
@@ -23,7 +23,7 @@ import globalroutines from '../globalroutines/index'
|
||||
|
||||
export const useCatalogStore = defineStore('CatalogStore', {
|
||||
state: (): ICatalogState => ({
|
||||
catalog: { idapp: '', title: '' }
|
||||
catalogs: [{ idapp: '', title: '' }]
|
||||
}),
|
||||
|
||||
getters: {},
|
||||
|
||||
@@ -29,6 +29,7 @@ export const costanti = {
|
||||
'excludeproductTypes',
|
||||
'misure',
|
||||
'Categoria',
|
||||
'idCollane',
|
||||
'editore',
|
||||
'pdf',
|
||||
'Printable',
|
||||
|
||||
@@ -129,17 +129,17 @@ export const colTableCatalogList = [
|
||||
isadvanced_field: false,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'idCollana',
|
||||
name: 'idCollane',
|
||||
label_trans: 'cataloglist.collane',
|
||||
fieldtype: costanti.FieldType.select,
|
||||
fieldtype: costanti.FieldType.multiselect,
|
||||
jointable: 'collanas',
|
||||
}),
|
||||
|
||||
AddCol({
|
||||
name: 'idTemplateScheda',
|
||||
label_trans: 'scheda.linkIdTemplate',
|
||||
name: 'idPageAssigned',
|
||||
label_trans: 'cataloglist.idPageAssigned',
|
||||
fieldtype: costanti.FieldType.select,
|
||||
jointable: 'collanas',
|
||||
jointable: 'mypages_id',
|
||||
}),
|
||||
|
||||
AddCol({
|
||||
@@ -150,6 +150,8 @@ export const colTableCatalogList = [
|
||||
field_outtype: costanti.FieldType.object,
|
||||
showWhen: costanti.showWhen.InView_OnlyifExist,
|
||||
}),
|
||||
AddCol({ name: 'descr_introduttiva', label_trans: 'cataloglist.descr_introduttiva', fieldtype: costanti.FieldType.html }),
|
||||
|
||||
AddCol({
|
||||
name: 'img_bordata_web',
|
||||
label_trans: 'cataloglist.img_bordata_web',
|
||||
@@ -158,7 +160,6 @@ export const colTableCatalogList = [
|
||||
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit,
|
||||
isadvanced_field: false,
|
||||
}),
|
||||
AddCol({ name: 'idTemplateScheda', label_trans: 'scheda.linkIdTemplate', fieldtype: costanti.FieldType.string }),
|
||||
|
||||
AddCol(ModifRec),
|
||||
AddCol(DuplicateRec),
|
||||
@@ -241,7 +242,12 @@ export const colmyScheda = [
|
||||
AddCol({ name: 'editore', label_trans: 'editore' }),
|
||||
AddCol({ name: 'author', label_trans: 'scheda.author' }),
|
||||
AddCol({ name: 'argomenti', label_trans: 'scheda.argomenti' }),
|
||||
AddCol({ name: 'idCollana', label_trans: 'scheda.idCollana' }),
|
||||
AddCol({
|
||||
name: 'idCollane',
|
||||
label_trans: 'products.category',
|
||||
fieldtype: costanti.FieldType.multiselect,
|
||||
jointable: 'collanas',
|
||||
}),
|
||||
AddCol({ name: 'sort_field', label_trans: 'catalogo.sort_field', fieldtype: costanti.FieldType.string }),
|
||||
AddCol({ name: 'sort_dir', label_trans: 'catalogo.sort_dir', fieldtype: costanti.FieldType.number }),
|
||||
AddCol({ name: 'arrProdottiSpeciali', label_trans: 'editore' }),
|
||||
@@ -254,7 +260,12 @@ export const colmyelCatalogo = [
|
||||
AddCol({ name: 'pdf_filename', label_trans: 'pdf_filename' }),
|
||||
AddCol({ name: 'editore', label_trans: 'editore' }),
|
||||
AddCol({ name: 'argomenti', label_trans: 'scheda.argomenti' }),
|
||||
AddCol({ name: 'idCollana', label_trans: 'scheda.idCollana' }),
|
||||
AddCol({
|
||||
name: 'idCollane',
|
||||
label_trans: 'products.category',
|
||||
fieldtype: costanti.FieldType.multiselect,
|
||||
jointable: 'collanas',
|
||||
}),
|
||||
AddCol({ name: 'width', label_trans: 'width', fieldtype: costanti.FieldType.string }),
|
||||
AddCol({ name: 'height', label_trans: 'height', fieldtype: costanti.FieldType.string }),
|
||||
AddCol({ name: 'optcatalogo.', label_trans: 'catalogo.optcatalogo.', fieldtype: costanti.FieldType.number }),
|
||||
@@ -1067,7 +1078,7 @@ export const colmyUserPeople = [
|
||||
export const colmyUserGroup = [
|
||||
// AddCol({ name: '_id', label_trans: 'reg.id' }),
|
||||
AddCol({
|
||||
name: 'title', label_trans: 'reg.name',
|
||||
name: 'title', label_trans: 'reg.nameorg',
|
||||
field_toduplicate_nospace: 'groupname',
|
||||
required: true, noshowlabel: true, maxlength: 50
|
||||
}),
|
||||
@@ -1860,7 +1871,6 @@ export const colmyBachecas = [
|
||||
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
|
||||
noshowlabel: true,
|
||||
icon: 'mood',
|
||||
isadvanced_field: true,
|
||||
sortable: false,
|
||||
typeobj: 'checkbox',
|
||||
}),
|
||||
@@ -4195,6 +4205,13 @@ export const fieldsTable = {
|
||||
colkey: 'path',
|
||||
collabel: 'title',
|
||||
},
|
||||
{
|
||||
value: 'mypages_id',
|
||||
label: 'Pagine Web (ID)',
|
||||
columns: colmypage,
|
||||
colkey: '_id',
|
||||
collabel: 'title',
|
||||
},
|
||||
{
|
||||
value: 'products',
|
||||
label: 'Prodotti',
|
||||
@@ -4270,7 +4287,7 @@ export const fieldsTable = {
|
||||
label: 'Collane',
|
||||
columns: colTableCollane,
|
||||
colkey: 'idCollana',
|
||||
collabel: 'descrizione',
|
||||
collabel: 'title',
|
||||
},
|
||||
{
|
||||
value: 'catais',
|
||||
@@ -4948,6 +4965,13 @@ export const fieldsTable = {
|
||||
colkey: '_id',
|
||||
collabel: 'title',
|
||||
},
|
||||
{
|
||||
value: 'schedeopt',
|
||||
label: 'Template Cataloghi',
|
||||
columns: colTableGeneric,
|
||||
colkey: 'value',
|
||||
collabel: 'label',
|
||||
},
|
||||
],
|
||||
|
||||
}
|
||||
|
||||
@@ -7506,9 +7506,9 @@ export const tools = {
|
||||
// console.log('arrimage', arrimage)
|
||||
|
||||
if (shared_consts.TABLES_DIRECTORY_A_PARTE.includes(table)) {
|
||||
return costanti.DIR_UPLOAD + `${table}/` + groupname + '/' + arrimage[0].imagefile
|
||||
return costanti.DIR_UPLOAD + `${table}/` + groupname + '/' + arrimage[0]?.imagefile
|
||||
} else if (shared_consts.TABLES_DIRECTORY_SINGLE_IMG.includes(table)) {
|
||||
return costanti.DIR_UPLOAD + `${table}/` + groupname + '/' + arrimage[0].imagefile
|
||||
return costanti.DIR_UPLOAD + `${table}/` + groupname + '/' + arrimage[0]?.imagefile
|
||||
} else {
|
||||
// console.log('username', username, 'table', table)
|
||||
if (arrimage && arrimage.length > 0) {
|
||||
@@ -7540,7 +7540,7 @@ export const tools = {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (shared_consts.TABLES_WITH_ADMINS.includes(tablesel)) {
|
||||
if (userStore.isAdmin)
|
||||
return true
|
||||
@@ -9317,6 +9317,21 @@ export const tools = {
|
||||
return rec ? rec.strsingolo : ''
|
||||
},
|
||||
|
||||
getMainUrl(fullUrl: string) {
|
||||
try {
|
||||
// Crea un oggetto URL dall'input
|
||||
const url = new URL(fullUrl);
|
||||
|
||||
// Estrai il protocollo (http o https) e l'host (dominio)
|
||||
const mainUrl = `${url.host}`;
|
||||
|
||||
return mainUrl;
|
||||
} catch (error) {
|
||||
console.error("URL non valido:", error);
|
||||
return null;
|
||||
}
|
||||
},
|
||||
|
||||
getGradientByColors(col1: string, col2: string, col3: string): string {
|
||||
let mystr = ''
|
||||
if (col1) {
|
||||
|
||||
@@ -49,20 +49,6 @@ async function getConfig(id: any) {
|
||||
return globalroutines('read', 'config', null, id)
|
||||
}
|
||||
|
||||
async function getstateConnSaved() {
|
||||
const config = await getConfig(costanti.CONFIG_ID_CFG)
|
||||
// console.log('config', config)
|
||||
if (config) {
|
||||
if (config.length > 1) {
|
||||
const cfgstateconn = config[1]
|
||||
return cfgstateconn.stateconn
|
||||
} else {
|
||||
return 'online'
|
||||
}
|
||||
} else {
|
||||
return 'offline'
|
||||
}
|
||||
}
|
||||
|
||||
export const useGlobalStore = defineStore('GlobalStore', {
|
||||
state: (): IGlobalState => ({
|
||||
@@ -353,6 +339,34 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
return !!rec ? rec.name + ' ' + rec.surname : ''
|
||||
},
|
||||
|
||||
getSchedeOpt(): any [] {
|
||||
const arrschede: ISchedaSingola[] = this.myschedas
|
||||
|
||||
let arr: any = []
|
||||
|
||||
arr.push({ label: '[Nessuna]', value: '' })
|
||||
|
||||
if (arrschede) {
|
||||
arrschede.forEach((recscheda: ISchedaSingola) => {
|
||||
let pagename = ''
|
||||
if (recscheda.scheda) {
|
||||
if (recscheda.idPageOrig) {
|
||||
const page = this.mypage.find((page) => (`${page._id}`) === recscheda.idPageOrig)
|
||||
pagename = page ? page.title! : ''
|
||||
}
|
||||
if (pagename)
|
||||
pagename = '[Pag: ' + pagename + '] '
|
||||
|
||||
const mylabel = pagename + (recscheda.scheda ? recscheda.scheda!.name : '')
|
||||
arr.push({ label: mylabel, value: recscheda.scheda!._id })
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return arr
|
||||
|
||||
},
|
||||
|
||||
getListByTable: (state: IGlobalState) => (table: string, value2?: any): any => {
|
||||
let ris: any = []
|
||||
|
||||
@@ -384,8 +398,9 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
else if (table === toolsext.TABOPZEMAIL) ris = state.opzemail
|
||||
else if (table === toolsext.TABMAILINGLIST) ris = state.mailinglist
|
||||
else if (table === toolsext.TABMYPAGE) ris = state.mypage
|
||||
else if (table === 'mypages_id') ris = state.mypage
|
||||
else if (table === toolsext.TABMYELEMS) ris = state.myelems
|
||||
else if (table === toolsext.TABCATALOGS) ris = catalogStore.catalog!
|
||||
else if (table === toolsext.TABCATALOGS) ris = catalogStore.catalogs!
|
||||
else if (table === toolsext.TABCALZOOM) ris = state.calzoom
|
||||
else if (table === 'producers') ris = state.producers
|
||||
else if (table === 'storehouses') ris = state.storehouses
|
||||
@@ -451,6 +466,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
return state.catgrps
|
||||
else if (table === 'collanas')
|
||||
return Products.collane
|
||||
else if (table === 'schedeopt')
|
||||
return state.getSchedeOpt
|
||||
else if (table === 'provinces')
|
||||
return state.provinces.filter((rec: IProvince) => (!rec.card) && (rec.prov !== 'ITA') && (rec.prov !== 'EST'))
|
||||
else if (table === 'cards') {
|
||||
@@ -1725,7 +1742,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
circuitStore.listcircuits = (res.data.listcircuits) ? res.data.listcircuits : []
|
||||
circuitStore.listaccounts = (res.data.listaccounts) ? res.data.listaccounts : []
|
||||
|
||||
catalogStore.catalog = res.data.catalogs
|
||||
catalogStore.catalogs = res.data.catalogs
|
||||
|
||||
this.settings = (res.data.settings) ? [...res.data.settings] : []
|
||||
this.disciplines = (res.data.disciplines) ? [...res.data.disciplines] : []
|
||||
@@ -2456,32 +2473,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
},
|
||||
|
||||
SchedeOpt() {
|
||||
const arrschede: ISchedaSingola[] = this.getMySchede()
|
||||
|
||||
let arr: any = []
|
||||
|
||||
arr.push({ label: '[Nessuna]', value: '' })
|
||||
|
||||
if (arrschede) {
|
||||
arrschede.forEach((recscheda: ISchedaSingola) => {
|
||||
let pagename = ''
|
||||
if (recscheda.scheda) {
|
||||
if (recscheda.idPageOrig) {
|
||||
const page = this.getPageById(recscheda.idPageOrig)
|
||||
pagename = page ? page.title! : ''
|
||||
}
|
||||
if (pagename)
|
||||
pagename = '[Pag: ' + pagename + '] '
|
||||
|
||||
const mylabel = pagename + (recscheda.scheda ? recscheda.scheda!.name : '')
|
||||
arr.push({ label: mylabel, value: recscheda.scheda!._id })
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return arr
|
||||
return this.getSchedeOpt
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
@@ -20,15 +20,6 @@ export const useTestStore = defineStore({
|
||||
return (rec.lang === toolsext.getLocale(false) || toolsext.getLocale() === '')
|
||||
},
|
||||
|
||||
prova1: (state: ITest) => (myval: number): boolean => {
|
||||
return (myval > 1)
|
||||
},
|
||||
|
||||
prova2: (): boolean => {
|
||||
// @ts-ignore
|
||||
return this.prova1(2)
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
actions: {
|
||||
|
||||
@@ -14,10 +14,11 @@ import { CProductCard } from '@src/components/CProductCard'
|
||||
import { CMySelect } from '@src/components/CMySelect'
|
||||
import { CContainerCatalogoCard } from '@src/components/CContainerCatalogoCard'
|
||||
import { CSelectUserActive } from '@src/components/CSelectUserActive'
|
||||
import { IOptCatalogo, IDimensioni, IFilterCatalogo, IMyScheda, IProdView, IProduct, ISchedaSingola, ISearchList } from 'model'
|
||||
import { IOptCatalogo, IDimensioni, IFilterCatalogo, IMyScheda, IProdView, IProduct, ISchedaSingola, ISearchList, ICatalog } from 'model'
|
||||
|
||||
|
||||
import { fieldsTable } from '@store/Modules/fieldsTable'
|
||||
import { useCatalogStore } from '@src/store/CatalogStore'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'Catalogo',
|
||||
@@ -208,6 +209,23 @@ export default defineComponent({
|
||||
return lista && lista.value && lista.value.hasOwnProperty('name') ? lista.value.name : ''
|
||||
}
|
||||
|
||||
function getIdCollaneDaFiltrare() {
|
||||
let idCollane: number[] = []
|
||||
|
||||
const catalogStore = useCatalogStore()
|
||||
|
||||
// Cerca se nella lista cataloghi c'è la Collana di questa Pagina !
|
||||
let trovato = catalogStore.catalogs?.find((catalog: ICatalog) => catalog.idPageAssigned)
|
||||
|
||||
if (trovato) {
|
||||
|
||||
} else {
|
||||
idCollane = optcatalogo.value.idCollane! || []
|
||||
}
|
||||
|
||||
return idCollane
|
||||
}
|
||||
|
||||
function calcArrProducts() {
|
||||
// console.log('calcArrProducts')
|
||||
|
||||
@@ -228,7 +246,10 @@ export default defineComponent({
|
||||
let boolfiltroVuotoExcludeProductTypes = filtroExcludeProductTypes.length === 0
|
||||
|
||||
let filtroPublishers = optcatalogo.value.editore || []
|
||||
|
||||
let filtroCollane = getIdCollaneDaFiltrare()
|
||||
let boolfiltroVuotoEditore = (filtroPublishers.length === 0)
|
||||
let boolfiltroVuotoCollane = (filtroCollane.length === 0)
|
||||
|
||||
//console.log('filtroVersione', filtroProductTypes)
|
||||
|
||||
@@ -247,7 +268,7 @@ export default defineComponent({
|
||||
}
|
||||
let lowerSearchText = (searchtext || '').toLowerCase().trim();
|
||||
lowerSearchText = lowerSearchText.replace(/[-@:=]/g, '');
|
||||
if ((!lowerSearchText || (lowerSearchText && lowerSearchText.length < 2)) && !catstr && boolfiltroVuotoProductTypes && boolfiltroVuotoExcludeProductTypes && boolfiltroVuotoEditore && !filtroAuthor && (!gasselstr && (cosa.value !== shared_consts.PROD.GAS))) {
|
||||
if ((!lowerSearchText || (lowerSearchText && lowerSearchText.length < 2)) && !catstr && boolfiltroVuotoProductTypes && boolfiltroVuotoExcludeProductTypes && boolfiltroVuotoCollane && boolfiltroVuotoEditore && boolfiltroVuotoCollana && !filtroAuthor && (!gasselstr && (cosa.value !== shared_consts.PROD.GAS))) {
|
||||
|
||||
} else {
|
||||
|
||||
@@ -265,6 +286,7 @@ export default defineComponent({
|
||||
|
||||
let hasProductTypes = true
|
||||
let hasPublished = true
|
||||
let hasCollana = true
|
||||
let hasExcludeProductTypes = false
|
||||
|
||||
//++AddCATALOGO_FIELDS
|
||||
@@ -276,6 +298,9 @@ export default defineComponent({
|
||||
if (optcatalogo.value && !boolfiltroVuotoEditore) {
|
||||
hasPublished = !optcatalogo.value.editore || (optcatalogo.value.editore && optcatalogo.value.editore.includes(product.productInfo.idPublisher!))
|
||||
}
|
||||
if (optcatalogo.value && !boolfiltroVuotoCollane) {
|
||||
hasCollana = !optcatalogo.value.idCollane || (optcatalogo.value.idCollane && optcatalogo.value.idCollane.includes(product.productInfo.idCollana!))
|
||||
}
|
||||
|
||||
if (optcatalogo.value && !boolfiltroVuotoExcludeProductTypes) {
|
||||
// check if productInfo.productTypes array exclude some item in optcatalogo.value.ProductTypes array
|
||||
@@ -294,7 +319,7 @@ export default defineComponent({
|
||||
// Check if all words in lowerSearchText are present in lowerName
|
||||
let allWordsPresent = lowerSearchText.split(/\s+/).every(word => new RegExp(`\\b${word}\\b`, 'i').test(lowerName));
|
||||
|
||||
return (codeMatch.test(product.productInfo.code || '') || allWordsPresent) && hasCategoria && hasArgomentiCat && hasAuthor && productgassel && hasProductTypes && hasPublished && !hasExcludeProductTypes;
|
||||
return (codeMatch.test(product.productInfo.code || '') || allWordsPresent) && hasCategoria && hasCollana && hasArgomentiCat && hasAuthor && productgassel && hasProductTypes && hasPublished && !hasExcludeProductTypes;
|
||||
} else {
|
||||
console.error('product or product.productInfo is null');
|
||||
return false;
|
||||
@@ -378,7 +403,9 @@ export default defineComponent({
|
||||
let boolfiltroVuotoExcludeProductTypes = filtroExcludeProductTypes.length === 0
|
||||
|
||||
let filtroPublishers = scheda.editore || []
|
||||
let filtroCollane = getIdCollaneDaFiltrare()
|
||||
let boolfiltroVuotoEditore = (filtroPublishers.length === 0)
|
||||
let boolfiltroVuotoCollane = (filtroCollane.length === 0)
|
||||
|
||||
//console.log('filtroVersione', filtroProductTypes)
|
||||
|
||||
@@ -429,6 +456,7 @@ export default defineComponent({
|
||||
|
||||
let hasProductTypes = true
|
||||
let hasPublished = true
|
||||
let hasCollane = true
|
||||
let hasExcludeProductTypes = false
|
||||
|
||||
if (!boolfiltroVuotoProductTypes) {
|
||||
@@ -439,12 +467,16 @@ export default defineComponent({
|
||||
hasPublished = !scheda.editore || (scheda.editore && scheda.editore.includes(product.productInfo.idPublisher!))
|
||||
}
|
||||
|
||||
if (optcatalogo.value && !boolfiltroVuotoCollane) {
|
||||
hasCollane = !optcatalogo.value.idCollane || (optcatalogo.value.idCollane && optcatalogo.value.idCollane.includes(product.productInfo.idCollana!))
|
||||
}
|
||||
|
||||
if (!boolfiltroVuotoExcludeProductTypes) {
|
||||
// check if productInfo.productTypes array exclude some item in scheda.ProductTypes array
|
||||
hasExcludeProductTypes = !scheda.excludeproductTypes || (scheda.excludeproductTypes && (product.productInfo.productTypes || []).every((item: any) => scheda.excludeproductTypes!.includes(item)))
|
||||
}
|
||||
|
||||
return searchMatch && hasCategoria && hasArgomentiCat && hasAuthor && hasProductTypes && hasPublished && !hasExcludeProductTypes;
|
||||
return searchMatch && hasCategoria && hasArgomentiCat && hasAuthor && hasProductTypes && hasPublished && hasCollane && !hasExcludeProductTypes;
|
||||
} else {
|
||||
console.error('product or product.productInfo is null');
|
||||
return false;
|
||||
|
||||
@@ -250,7 +250,7 @@
|
||||
type="a"
|
||||
size="md"
|
||||
rounded
|
||||
:label="$t('reg.website')"
|
||||
:label="$t('reg.website') + ' ' + tools.getMainUrl(getLinkWebSite())"
|
||||
:href="getLinkWebSite()"
|
||||
target="__blank"
|
||||
></q-btn>
|
||||
|
||||
Reference in New Issue
Block a user