- aggiornato catalogo lista con filtri per editori e grafico

This commit is contained in:
Surya Paolo
2025-02-13 21:15:04 +01:00
parent cdefb91bef
commit f0098e57b2
58 changed files with 245 additions and 116 deletions

View File

@@ -409,8 +409,11 @@ export const costanti = {
TABLES_ARRAY: ['circuits'],
TABLES_USERNAME_DATE: ['friends', 'friendsandme'],
TABLES_IMG_USERNAME: ['friends', 'friendsandme'],
TABLES_WITH_STR_TUTTI: ['lista_editori'],
FILTER_SEP: '_',
FILTER_TUTTI_STR: '[Tutti]',
FuncDialog: {
CANCEL_BOOKING: 1,
},

View File

@@ -132,18 +132,18 @@ export const colTableCatalogList = [
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit,
isadvanced_field: false,
}),
AddCol({
name: 'idPageAssigned',
label_trans: 'cataloglist.idPageAssigned',
fieldtype: costanti.FieldType.select,
jointable: 'mypages_id',
}),
AddCol({
name: 'referenti',
label_trans: 'cataloglist.referenti',
fieldtype: costanti.FieldType.multiselect,
jointable: 'lista_editori',
}),
AddCol({
name: 'idPageAssigned',
label_trans: 'cataloglist.idPageAssigned',
fieldtype: costanti.FieldType.select,
jointable: 'mypages_id',
}),
AddCol({
name: 'argomenti',
label_trans: 'cataloglist.argomenti',
@@ -297,6 +297,8 @@ export const colmyScheda = [
AddCol({ name: 'widthpag', label_trans: 'scheda.widthpag', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'widthimg', label_trans: 'scheda.widthimg', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'heightimg', label_trans: 'scheda.heightimg', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'widthcard', label_trans: 'scheda.widthcard', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'heightcard', label_trans: 'scheda.heightcard', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'height_Printable', label_trans: 'scheda.height_Printable', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'numschede_perCol', label_trans: 'scheda,numschede_perCol', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'numschede_perRiga', label_trans: 'scheda.numschede_perRiga', fieldtype: costanti.FieldType.number }),
@@ -4942,28 +4944,28 @@ export const fieldsTable = {
label: 'Amici',
columns: colTableUsersGeneric,
colkey: 'username',
collabel: 'username',
collabel: (rec: any) => `${rec.name} ${rec.surname}`,
},
{
value: 'friendsandme',
label: 'Amici_and_me',
columns: colTableUsersGeneric,
colkey: 'username',
collabel: 'username',
collabel: (rec: any) => `${rec.name} ${rec.surname}`,
},
{
value: 'lista_editori',
label: 'Editori',
columns: colTableUsersGeneric,
colkey: 'username',
collabel: 'username',
collabel: 'name',
},
{
value: 'mygroups',
label: 'Organizzazioni',
columns: colmyUserGroup,
colkey: 'groupname',
collabel: 'groupname',
collabel: (rec: any) => `${rec.groupname} `,
},
{
value: 'movements',

View File

@@ -9059,15 +9059,21 @@ export const tools = {
setRecordByField(field: any, record: any, value: any) {
let mioval = ''
if (field) {
const arrfields = field.split('.')
if (arrfields && arrfields.length > 1) {
try {
record[arrfields[0]][arrfields[1]] = value
} catch (e) {
return record
}
if (typeof field === 'function') {
// Se field è una funzione, chiamala per ottenere il campo
const fieldValue = field(record)
record[fieldValue] = value
} else {
record[field] = value
const arrfields = field.split('.')
if (arrfields && arrfields.length > 1) {
try {
record[arrfields[0]][arrfields[1]] = value
} catch (e) {
return record
}
} else {
record[field] = value
}
}
}
return record
@@ -9643,6 +9649,24 @@ export const tools = {
return Object.keys(obj).length === 0;
},
getsearchList_Cataloghi() {
return [{
visible: true,
label: 'Editore',
table: 'lista_editori',
key: 'referenti',
type: costanti.FieldType.select,
value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + shared_consts.TABLES_CATALOG + costanti.FILTER_SEP + 'referente', costanti.FILTER_TUTTI),
keycookie: '',
addall: true,
arrvalue: [],
filter: null,
useinput: false,
icon: 'fas fa-user'
}]
},
// FINE !
// getLocale() {

View File

@@ -1,4 +1,4 @@
import { IBaseOrder, ICart, IOrder, IOrderCart, IProduct, IProductsState, IProductInfo, ICatProd, IUserShort, IGasordine, IAuthor, ISubCatProd, IText, IOptCatalogo, ICatalog } from 'model'
import { IBaseOrder, ICart, IOrder, IOrderCart, IProduct, IProductsState, IProductInfo, ICatProd, IUserShort, IGasordine, IAuthor, ISubCatProd, IText, IOptCatalogo, ICatalog, ICatPrTotali } from 'model'
import { Api } from '@api'
import { serv_constants } from '@src/store/Modules/serv_constants'
@@ -170,6 +170,14 @@ export const useProducts = defineStore('Products', {
}
return ''
},
getTotaliProdottiByIdCatProd: (state: IProductsState) => (idCatProd: string): number => {
const myfirstcat = state.catprtotali!.find((rec: ICatPrTotali) => rec._id === idCatProd)
if (myfirstcat) {
return myfirstcat.quanti!
}
return 0
},
getSubCatProdsByGas: (state: IProductsState) => (idGasOrdine: string, idCatProd: string): ISubCatProd[] => {
let arrcat = state.subcatprods

View File

@@ -1778,6 +1778,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
this.providers = (res.data.providers) ? [...res.data.providers] : []
Products.catprods = (res.data.catprods) ? [...res.data.catprods] : []
Products.catprtotali = (res.data.catprtotali) ? [...res.data.catprtotali] : []
Products.collane = (res.data.collane) ? [...res.data.collane] : []
Products.subcatprods = (res.data.subcatprods) ? [...res.data.subcatprods] : []
Products.catprods_gas = (res.data.catprods_gas) ? [...res.data.catprods_gas] : []
@@ -2108,7 +2109,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
getTableJoinByName(table: string, addall?: boolean, addnone?: boolean, filter?: any, value2?: any) {
let myarr: any = []
if (table === 'permissions') myarr = [shared_consts.Permissions.Admin, shared_consts.Permissions.Manager, shared_consts.Permissions.Teacher, shared_consts.Permissions.Facilitatore, shared_consts.Permissions.Editor, shared_consts.Permissions.Zoomeri, shared_consts.Permissions.Department]
if (table === 'permissions') myarr = [shared_consts.Permissions.Admin, shared_consts.Permissions.Manager, shared_consts.Permissions.Teacher, shared_consts.Permissions.Facilitatore, shared_consts.Permissions.Editor, shared_consts.Permissions.Zoomeri, shared_consts.Permissions.Department, shared_consts.Permissions.Grafico]
else if (table === 'accepted') myarr = [shared_consts.Accepted.CHECK_READ_GUIDELINES, shared_consts.Accepted.CHECK_SEE_VIDEO_PRINCIPI]
else if (table === 'fieldstype') myarr = costanti.FieldTypeArr
else if (table === 'metodo_pagamento') myarr = tools.SelectMetodiPagamento
@@ -2160,8 +2161,10 @@ export const useGlobalStore = defineStore('GlobalStore', {
myarr = newarr
}
if (addall)
myarr = [costanti.FILTER_TUTTI, ...myarr]
if (addall) {
myarr = [costanti.FILTER_TUTTI, ...myarr]
}
if (addnone) {