diff --git a/.env.development b/.env.development index d62f9f2f..6ca5c815 100755 --- a/.env.development +++ b/.env.development @@ -1,6 +1,6 @@ APP_VERSION="1.0.37" SERVICE_WORKER_FILE="service-worker.js" -APP_ID="18" +APP_ID="13" DIRECTORY_LOCAL="newfreeplanet" DIRECTORY_SERVER="freeplanet_serverside" SERVERDIR_WEBSITE="" @@ -12,7 +12,7 @@ LANG_DEFAULT="it" PAO_APP_ID="KKPPAA5KJK435J3KSS9F9D8S9F8SD98F9SDF" MASTER_KEY="KKPPSS5KJK435J3KSS9F9D8S9F8SD3CR3T" MONGODB_HOST="https://localhost:3000" -LOGO_REG='gruppomacro-logo-full.png' +LOGO_REG='riso-logo-full.png' TEST_NAME="Paolo" TEST_SURNAME="Arena" TEST_EMAIL="" diff --git a/now.txt b/now.txt index e5f5d4ff..63f31c52 100644 --- a/now.txt +++ b/now.txt @@ -1 +1 @@ -TERMINA DI LAVORARE SU riso.app: (Sovrascrivo !) +TERMINA DI LAVORARE SU gruppomacro.app: (Sovrascrivo !) diff --git a/package.json b/package.json index 5ad8f06e..bcb1a608 100755 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { - "name": "gruppomacro", + "name": "riso", "version": "0.6.1", - "description": "Gruppo Macro Editori", - "productName": "Gruppo Macro", + "description": "Siamo la Rete Italiana di Scambio Orizzontale, abbiamo creato questa piattaforma per metterla al servizio di chi vuole riscoprire il valore della condivisione e della cooperazione. Valori semplici e profondi che ci aiutano a ritrovare il Senso della Vita, perduto in questa società consumista, e riporti quei Sani Pricìpi Naturali ed Umani di Fratellanza che intere popolazioni antiche conoscevano bene.", + "productName": "Riso", "author": "Paolo Arena", "private": true, "keywords": [], diff --git a/public/images/arcadei/borgovivo.png b/public/images/arcadei/borgovivo.png new file mode 100644 index 00000000..de6d475f Binary files /dev/null and b/public/images/arcadei/borgovivo.png differ diff --git a/public/images/arcadei/boscovivo.png b/public/images/arcadei/boscovivo.png new file mode 100644 index 00000000..0af031a9 Binary files /dev/null and b/public/images/arcadei/boscovivo.png differ diff --git a/public/images/arcadei/img1.png b/public/images/arcadei/img1.png new file mode 100644 index 00000000..8f25fe63 Binary files /dev/null and b/public/images/arcadei/img1.png differ diff --git a/public/images/arcadei/ortovivo-gsa.png b/public/images/arcadei/ortovivo-gsa.png new file mode 100644 index 00000000..4cb7eea8 Binary files /dev/null and b/public/images/arcadei/ortovivo-gsa.png differ diff --git a/public/images/arcadei/pandeldia.png b/public/images/arcadei/pandeldia.png new file mode 100644 index 00000000..9ff66ff1 Binary files /dev/null and b/public/images/arcadei/pandeldia.png differ diff --git a/public/images/arcadei/prospera.png b/public/images/arcadei/prospera.png new file mode 100644 index 00000000..1f3712f9 Binary files /dev/null and b/public/images/arcadei/prospera.png differ diff --git a/public/images/arcadei/saluteviva.png b/public/images/arcadei/saluteviva.png new file mode 100644 index 00000000..f8da1f0b Binary files /dev/null and b/public/images/arcadei/saluteviva.png differ diff --git a/public/images/arcadei/scuolaviva.png b/public/images/arcadei/scuolaviva.png new file mode 100644 index 00000000..b6e0c1a2 Binary files /dev/null and b/public/images/arcadei/scuolaviva.png differ diff --git a/public/images/ferrara.jpg b/public/images/ferrara.jpg new file mode 100644 index 00000000..b4615a3a Binary files /dev/null and b/public/images/ferrara.jpg differ diff --git a/public/images/freeplanet-logo-full.odg b/public/images/freeplanet-logo-full.odg new file mode 100755 index 00000000..854da650 Binary files /dev/null and b/public/images/freeplanet-logo-full.odg differ diff --git a/public/images/freeplanet-logo-full.svg b/public/images/freeplanet-logo-full.svg new file mode 100755 index 00000000..b9c10df3 --- /dev/null +++ b/public/images/freeplanet-logo-full.svg @@ -0,0 +1,1186 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/images/gm-android-icon-192x192.png b/public/images/gm-android-icon-192x192.png deleted file mode 100644 index cd503622..00000000 Binary files a/public/images/gm-android-icon-192x192.png and /dev/null differ diff --git a/public/images/gm-android-icon-512x512.png b/public/images/gm-android-icon-512x512.png deleted file mode 100644 index 1669de97..00000000 Binary files a/public/images/gm-android-icon-512x512.png and /dev/null differ diff --git a/public/images/gm-apple-touch-icon.png b/public/images/gm-apple-touch-icon.png deleted file mode 100644 index 9626b275..00000000 Binary files a/public/images/gm-apple-touch-icon.png and /dev/null differ diff --git a/public/images/gruppomacro-logo-full.png b/public/images/gruppomacro-logo-full.png deleted file mode 100644 index d6e578b8..00000000 Binary files a/public/images/gruppomacro-logo-full.png and /dev/null differ diff --git a/public/images/riso-android-icon-144x144.png b/public/images/riso-android-icon-144x144.png new file mode 100644 index 00000000..37dcd661 Binary files /dev/null and b/public/images/riso-android-icon-144x144.png differ diff --git a/public/images/riso-android-icon-192x192.png b/public/images/riso-android-icon-192x192.png new file mode 100644 index 00000000..95b960e9 Binary files /dev/null and b/public/images/riso-android-icon-192x192.png differ diff --git a/public/images/riso-android-icon-36x36.png b/public/images/riso-android-icon-36x36.png new file mode 100644 index 00000000..c78a13a3 Binary files /dev/null and b/public/images/riso-android-icon-36x36.png differ diff --git a/public/images/riso-android-icon-384x384.png b/public/images/riso-android-icon-384x384.png new file mode 100644 index 00000000..ce1ffc47 Binary files /dev/null and b/public/images/riso-android-icon-384x384.png differ diff --git a/public/images/riso-android-icon-48x48.png b/public/images/riso-android-icon-48x48.png new file mode 100644 index 00000000..499e8674 Binary files /dev/null and b/public/images/riso-android-icon-48x48.png differ diff --git a/public/images/riso-android-icon-512x512.png b/public/images/riso-android-icon-512x512.png new file mode 100644 index 00000000..e1c31acd Binary files /dev/null and b/public/images/riso-android-icon-512x512.png differ diff --git a/public/images/riso-android-icon-72x72.png b/public/images/riso-android-icon-72x72.png new file mode 100644 index 00000000..f95f7320 Binary files /dev/null and b/public/images/riso-android-icon-72x72.png differ diff --git a/public/images/riso-android-icon-96x96.png b/public/images/riso-android-icon-96x96.png new file mode 100644 index 00000000..98dbf9d9 Binary files /dev/null and b/public/images/riso-android-icon-96x96.png differ diff --git a/public/images/riso-apple-icon-114x114.png b/public/images/riso-apple-icon-114x114.png new file mode 100644 index 00000000..882dd21c Binary files /dev/null and b/public/images/riso-apple-icon-114x114.png differ diff --git a/public/images/riso-apple-icon-120x120.png b/public/images/riso-apple-icon-120x120.png new file mode 100644 index 00000000..734b0503 Binary files /dev/null and b/public/images/riso-apple-icon-120x120.png differ diff --git a/public/images/riso-apple-icon-144x144.png b/public/images/riso-apple-icon-144x144.png new file mode 100644 index 00000000..923da7be Binary files /dev/null and b/public/images/riso-apple-icon-144x144.png differ diff --git a/public/images/riso-apple-icon-152x152.png b/public/images/riso-apple-icon-152x152.png new file mode 100644 index 00000000..84fd455d Binary files /dev/null and b/public/images/riso-apple-icon-152x152.png differ diff --git a/public/images/riso-apple-icon-180x180.png b/public/images/riso-apple-icon-180x180.png new file mode 100644 index 00000000..e457d906 Binary files /dev/null and b/public/images/riso-apple-icon-180x180.png differ diff --git a/public/images/riso-apple-icon-57x57.png b/public/images/riso-apple-icon-57x57.png new file mode 100644 index 00000000..f5f538db Binary files /dev/null and b/public/images/riso-apple-icon-57x57.png differ diff --git a/public/images/riso-apple-icon-60x60.png b/public/images/riso-apple-icon-60x60.png new file mode 100644 index 00000000..4121f834 Binary files /dev/null and b/public/images/riso-apple-icon-60x60.png differ diff --git a/public/images/riso-apple-icon-72x72.png b/public/images/riso-apple-icon-72x72.png new file mode 100644 index 00000000..5efd872d Binary files /dev/null and b/public/images/riso-apple-icon-72x72.png differ diff --git a/public/images/riso-apple-icon-76x76.png b/public/images/riso-apple-icon-76x76.png new file mode 100644 index 00000000..6db4b76f Binary files /dev/null and b/public/images/riso-apple-icon-76x76.png differ diff --git a/public/images/riso-apple-icon.png b/public/images/riso-apple-icon.png new file mode 100644 index 00000000..cfaeb3c0 Binary files /dev/null and b/public/images/riso-apple-icon.png differ diff --git a/public/images/riso-logo-full.png b/public/images/riso-logo-full.png new file mode 100644 index 00000000..38a9695f Binary files /dev/null and b/public/images/riso-logo-full.png differ diff --git a/public/images/riso_home.png b/public/images/riso_home.png new file mode 100644 index 00000000..3d065405 Binary files /dev/null and b/public/images/riso_home.png differ diff --git a/public/images/riso_home_dark.png b/public/images/riso_home_dark.png new file mode 100644 index 00000000..fe6b8225 Binary files /dev/null and b/public/images/riso_home_dark.png differ diff --git a/public/images/riso_services.png b/public/images/riso_services.png new file mode 100644 index 00000000..85a940bc Binary files /dev/null and b/public/images/riso_services.png differ diff --git a/quasar.conf.js b/quasar.conf.js index fd8a2ec3..239d042e 100755 --- a/quasar.conf.js +++ b/quasar.conf.js @@ -149,7 +149,7 @@ module.exports = configure((ctx) => ({ }, devServer: { https: false, - port: 8089, + port: 8084, open: false, // opens browser window automatically hot: false, // Disable hot module replacement headers: { @@ -308,9 +308,9 @@ module.exports = configure((ctx) => ({ }, manifest: { - name: 'Gruppo Macro', - short_name: 'GruppoMacro', - description: '', + name: 'Riso', + short_name: 'Riso', + description: 'Siamo la Rete Italiana di Scambio Orizzontale, abbiamo creato questa piattaforma per metterla al servizio di chi vuole riscoprire il valore della condivisione e della cooperazione. Valori semplici e profondi che ci aiutano a ritrovare il Senso della Vita, perduto in questa società consumista, e riporti quei Sani Pricìpi Naturali ed Umani di Fratellanza che intere popolazioni antiche conoscevano bene.', display: 'standalone', orientation: 'portrait', background_color: '#fff', @@ -320,24 +320,54 @@ module.exports = configure((ctx) => ({ start_url: "/?homescreen=1", icons: [ { - src: 'images/gm-android-icon-512x512.png', + src: 'images/riso-android-icon-512x512.png', sizes: '512x512', type: 'image/png', }, { - src: 'images/gm-android-icon-192x192.png', + src: 'images/riso-android-icon-384x384.png', + sizes: '384x384', + type: 'image/png', + }, + { + src: 'images/riso-android-icon-192x192.png', sizes: '192x192', type: 'image/png', }, { - src: 'images/gm-apple-touch-icon.png', + src: 'images/riso-android-icon-144x144.png', + sizes: '144x144', + type: 'image/png', + }, + { + src: 'images/riso-android-icon-96x96.png', + sizes: '96x96', + type: 'image/png', + }, + { + src: 'images/riso-apple-icon-120x120.png', + sizes: '120x120', + type: 'image/png', + }, + { + src: 'images/riso-apple-icon-144x144.png', + sizes: '144x144', + type: 'image/png', + }, + { + src: 'images/riso-apple-icon-152x152.png', + sizes: '152x152', + type: 'image/png', + }, + { + src: 'images/riso-apple-icon-180x180.png', sizes: '180x180', type: 'image/png', }, ], related_applications: [{ "platform": "webapp", - "url": "https://www.gruppomacro.app/manifest.json" + "url": "https://www.riso.app/manifest.json" }] }, }, @@ -372,7 +402,7 @@ module.exports = configure((ctx) => ({ builder: { // https://www.electron.build/configuration/configuration - appId: 'GruppoMacro', + appId: 'Riso', }, // "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain diff --git a/src/common/shared_vuejs.ts b/src/common/shared_vuejs.ts index fd9f1ba0..c1fb321e 100755 --- a/src/common/shared_vuejs.ts +++ b/src/common/shared_vuejs.ts @@ -269,7 +269,7 @@ export const shared_consts = { KEY_TO_CRYPTED: ['PWD_FROM'], - TablePickup: ['countries', 'phones', 'cities'], + TablePickup: ['countries', 'phones'], PARAM_SHOW_PROVINCE: 1, diff --git a/src/components/CCatalogoCard/CCatalogoCard.scss b/src/components/CCatalogoCard/CCatalogoCard.scss index 478e73df..a8a371b8 100755 --- a/src/components/CCatalogoCard/CCatalogoCard.scss +++ b/src/components/CCatalogoCard/CCatalogoCard.scss @@ -107,7 +107,7 @@ height: 70px; } -.book-image-fixed{ +.book-image-fixed { max-width: 300px; max-height: 600px; } @@ -124,6 +124,11 @@ .book-details { margin: 20px; + + @media (max-width: 718px) { + margin: 4px; + } + } .book-card { @@ -173,38 +178,57 @@ } .book-author { - color: grey; /* Colore scuro per garantire una buona leggibilità */ + color: grey; + /* Colore scuro per garantire una buona leggibilità */ } -.author{ - color: darkblue; /* Colore scuro per garantire una buona leggibilità */ - text-transform: capitalize; /* Capitalizzazione delle iniziali per ogni parola del nome */ - background-color: #f9f9f9; /* Sfondo leggermente diverso per evidenziare il nome */ - border-radius: 2px; /* Bordi arrotondati per un aspetto più soft-edged */ - display: inline-block; /* Tratta il blocco come elementi inline-block per adattarlo al contenuto */ - font-style: italic; /* Stile del testo in corsivo per evidenziare l'autore */ +.author { + color: darkblue; + /* Colore scuro per garantire una buona leggibilità */ + text-transform: capitalize; + /* Capitalizzazione delle iniziali per ogni parola del nome */ + background-color: #f9f9f9; + /* Sfondo leggermente diverso per evidenziare il nome */ + border-radius: 2px; + /* Bordi arrotondati per un aspetto più soft-edged */ + display: inline-block; + /* Tratta il blocco come elementi inline-block per adattarlo al contenuto */ + font-style: italic; + /* Stile del testo in corsivo per evidenziare l'autore */ } -.author[data-col=c1]{ - font-size: 1.1em; /* Dimensione del font leggermente più grande per enfatizzare l'importanza del nome dell'autore */ +.author[data-col=c1] { + font-size: 1.1em; + /* Dimensione del font leggermente più grande per enfatizzare l'importanza del nome dell'autore */ } -.author[data-col=c2]{ - font-size: 1em; /* Dimensione del font leggermente più grande per enfatizzare l'importanza del nome dell'autore */ + +.author[data-col=c2] { + font-size: 1em; + /* Dimensione del font leggermente più grande per enfatizzare l'importanza del nome dell'autore */ } .book-category { - font-size: 1em; /* Dimensione del font leggermente più grande per enfatizzare l'importanza del nome dell'autore */ - color: grey; /* Colore scuro per garantire una buona leggibilità */ + font-size: 1em; + /* Dimensione del font leggermente più grande per enfatizzare l'importanza del nome dell'autore */ + color: grey; + /* Colore scuro per garantire una buona leggibilità */ } -.category{ - font-size: 1.0em; /* Dimensione del font leggermente più grande per enfatizzare l'importanza del nome dell'autore */ - color: green; /* Colore scuro per garantire una buona leggibilità */ - text-transform: capitalize; /* Capitalizzazione delle iniziali per ogni parola del nome */ - background-color: #f9f9f9; /* Sfondo leggermente diverso per evidenziare il nome */ - border-radius: 2px; /* Bordi arrotondati per un aspetto più soft-edged */ - display: inline-block; /* Tratta il blocco come elementi inline-block per adattarlo al contenuto */ - font-style: italic; /* Stile del testo in corsivo per evidenziare l'autore */ +.category { + font-size: 1.0em; + /* Dimensione del font leggermente più grande per enfatizzare l'importanza del nome dell'autore */ + color: green; + /* Colore scuro per garantire una buona leggibilità */ + text-transform: capitalize; + /* Capitalizzazione delle iniziali per ogni parola del nome */ + background-color: #f9f9f9; + /* Sfondo leggermente diverso per evidenziare il nome */ + border-radius: 2px; + /* Bordi arrotondati per un aspetto più soft-edged */ + display: inline-block; + /* Tratta il blocco come elementi inline-block per adattarlo al contenuto */ + font-style: italic; + /* Stile del testo in corsivo per evidenziare l'autore */ box-shadow: 0 0 5px gray; } @@ -222,6 +246,7 @@ border-radius: 5px; padding: 4px; cursor: pointer; + .q-badge { font-size: 1rem; padding: 4px 6px; @@ -229,10 +254,11 @@ } .colfix_prodotti_1 { - width: 350px; + width: 100%; } + .colfix_prodotti_2 { - width: 175px; + width: 170px; } .block-variazione-selected { @@ -247,20 +273,30 @@ /* Stilizzazione per descrizione breve del libro */ .book-short-descr { - font-size: 1.1em; /* Leggermente più grande per enfatizzare l'importanza */ - color: #666; /* Colore del testo in tono grigio scuro per un look sobrio */ - padding: 8px; /* Padding per dare spazio intorno al testo */ - border-left: 4px solid #007BFF; /* Linea verticale a sinistra come decorazione tradizionale delle citazioni */ - margin: 10px 0; /* Margine sopra e sotto per distanziare dalla restante contenuto */ - font-style: italic; /* Stile del font in corsivo per indicare che si tratta di un estratto o citazione */ - background-color: #f4f4f4; /* Sfondo leggermente diverso per evidenziare la sezione */ - display: block; /* Assicura che l'elemento sia trattato come blocco, occupando l'intera larghezza */ - text-align: center; /* Giustifica il testo per una lettura più fluida */ + font-size: 1.1em; + /* Leggermente più grande per enfatizzare l'importanza */ + color: #666; + /* Colore del testo in tono grigio scuro per un look sobrio */ + padding: 8px; + /* Padding per dare spazio intorno al testo */ + border-left: 4px solid #007BFF; + /* Linea verticale a sinistra come decorazione tradizionale delle citazioni */ + margin: 10px 0; + /* Margine sopra e sotto per distanziare dalla restante contenuto */ + font-style: italic; + /* Stile del font in corsivo per indicare che si tratta di un estratto o citazione */ + background-color: #f4f4f4; + /* Sfondo leggermente diverso per evidenziare la sezione */ + display: block; + /* Assicura che l'elemento sia trattato come blocco, occupando l'intera larghezza */ + text-align: center; + /* Giustifica il testo per una lettura più fluida */ } /* Opzionale: Transizione per l'hover su descrizione */ .book-short-descr:hover { - background-color: #e9e9e9; /* Cambio di sfondo al passaggio del mouse per un effetto interattivo */ + background-color: #e9e9e9; + /* Cambio di sfondo al passaggio del mouse per un effetto interattivo */ } .ingrandisci:hover { @@ -268,7 +304,7 @@ transform: scale(1.1); } -.title-descr{ +.title-descr { font-weight: bold; font-size: 1.1rem; text-align: center; @@ -277,14 +313,16 @@ .scheda-book { text-align: center; margin-left: 20px; + @media (max-width: 718px) { margin-left: 5px; - } + } } .book-3d:hover img { - transform: translateZ(50px) rotateY(-20deg); /* Applica la trasformazione 3D quando si passa con il mouse sopra */ + transform: translateZ(50px) rotateY(-20deg); + /* Applica la trasformazione 3D quando si passa con il mouse sopra */ } // Contenitore del libro, con effetto 3d, ed animazione 3D @@ -299,4 +337,4 @@ transform-origin: center center; transition: transform 0.5s ease-in-out; } -} +} \ No newline at end of file diff --git a/src/components/CCatalogoCard/CCatalogoCard.ts b/src/components/CCatalogoCard/CCatalogoCard.ts index 035b27c6..461ddee1 100755 --- a/src/components/CCatalogoCard/CCatalogoCard.ts +++ b/src/components/CCatalogoCard/CCatalogoCard.ts @@ -28,6 +28,7 @@ import 'vue3-pdf-app/dist/icons/main.css' export default defineComponent({ name: 'CCatalogoCard', + emits: ['selauthor'], props: { product: { type: Object as PropType, @@ -472,6 +473,10 @@ export default defineComponent({ } } + function click_author(id: any, autore: any) { + emit('selauthor', id, autore) + } + onMounted(mounted) onBeforeUnmount(beforeDestroy) @@ -525,6 +530,7 @@ export default defineComponent({ setvariazioneSelected, indvariazSel, checkifCartEnable, + click_author, } } }) diff --git a/src/components/CCatalogoCard/CCatalogoCard.vue b/src/components/CCatalogoCard/CCatalogoCard.vue index c0a19aac..95515283 100755 --- a/src/components/CCatalogoCard/CCatalogoCard.vue +++ b/src/components/CCatalogoCard/CCatalogoCard.vue @@ -77,10 +77,11 @@ v-for="(author, index) in myproduct.productInfo.authors" :key="author._id" > - , + {{ author.name }} {{ author.surname }} - ,
@@ -265,7 +264,7 @@ }}
@@ -283,7 +282,7 @@
@@ -504,7 +504,7 @@ {{ tools.isEntrataByRecMov(row) ? t('movement.movin') - : t('movement.movout') + : (tools.isUscitaByRecMov(row) ? t('movement.movout') : '') }} diff --git a/src/components/CGridTableUser/CGridTableUser.vue b/src/components/CGridTableUser/CGridTableUser.vue index 1342e1b8..d50f83dc 100755 --- a/src/components/CGridTableUser/CGridTableUser.vue +++ b/src/components/CGridTableUser/CGridTableUser.vue @@ -154,7 +154,7 @@ color="green" > @@ -162,7 +162,7 @@ {{ tools.isEntrataByRecMov(row) ? t('movement.movin') - : t('movement.movout') + : (tools.isUscitaByRecMov(row) ? t('movement.movout') : '') }} diff --git a/src/components/CMySelect/CMySelect.ts b/src/components/CMySelect/CMySelect.ts index bfc2598f..fb8ef4e8 100755 --- a/src/components/CMySelect/CMySelect.ts +++ b/src/components/CMySelect/CMySelect.ts @@ -329,8 +329,8 @@ export default defineComponent({ if (props.addall) { let myobj: any = {} if (typeof props.optlab === 'string') { - myobj[props.optlab] = '(Tutti)' - myobj[props.optval] = costanti.FILTER_TUTTI + myobj = tools.setRecordByField(props.optlab, myobj, '(Tutti)') + myobj = tools.setRecordByField(props.optval, myobj, costanti.FILTER_TUTTI) } arrtempOpt.value.push(myobj) @@ -495,8 +495,8 @@ export default defineComponent({ if (props.addall) { let myobj: any = {} if (typeof props.optlab === 'string') { - myobj[props.optlab] = '(Tutti)' - myobj[props.optval] = costanti.FILTER_TUTTI + myobj = tools.setRecordByField(props.optlab, myobj, '(Tutti)') + myobj = tools.setRecordByField(props.optval, myobj, costanti.FILTER_TUTTI) } if (myarr) @@ -570,7 +570,17 @@ export default defineComponent({ if (val === '') { valori.value = myarr } else { - valori.value = myarr.filter((v: any) => v[`${props.optlab}`].toLowerCase().indexOf(mystr) > -1) + let optlab: any = props.optlab ? '' + props.optlab : '' + if (optlab) { + valori.value = myarr.filter((v: any) => { + let mioval = tools.getRecordByField(optlab, v) + if (mioval) + return mioval.toLowerCase().indexOf(mystr) > -1 + else + return false + + }) + } } } @@ -604,8 +614,6 @@ export default defineComponent({ myarr = await globalStore.loadPickup({ table: props.tablesel, search: mystr.trim(), filter: props.filter_extra }) } - - if (myarr === null) { console.log('@@@ VALORI VALUE XXX', valori.value) valori.value = arrtempOpt.value @@ -619,8 +627,8 @@ export default defineComponent({ if (props.addall) { let myobj: any = {} if (typeof props.optlab === 'string') { - myobj[props.optlab] = '(Tutti)' - myobj[props.optval] = costanti.FILTER_TUTTI + myobj = tools.setRecordByField(props.optlab, myobj, '(Tutti)') + myobj = tools.setRecordByField(props.optval, myobj, costanti.FILTER_TUTTI) } myarr = [myobj, ...myarr] @@ -714,11 +722,11 @@ export default defineComponent({ } else { done(recfound[myid], 'add-unique') } - + /* if (props.multiple || props.multiselect_by_server) { console.log('arrout (2)', arrout) changeval(arrout) - + } }*/ } diff --git a/src/components/CMySelect/CMySelect.vue b/src/components/CMySelect/CMySelect.vue index 665b1fa8..a2ee2709 100755 --- a/src/components/CMySelect/CMySelect.vue +++ b/src/components/CMySelect/CMySelect.vue @@ -50,7 +50,12 @@ :text-color="$q.dark.isActive ? `white` : `black`" class="q-my-none q-ml-xs q-mr-none" > - + {{ scope.opt[fieldsTable.getLabelByTable(tablesel)] }}
@@ -58,18 +63,20 @@ - -
+ @@ -105,7 +120,9 @@ @@ -133,16 +150,15 @@ :options="valori" :option-value="optval" :option-label="optlab" - :dense="dense"> - + :dense="dense" + > - diff --git a/src/components/CNotifAtTop/CNotifAtTop.vue b/src/components/CNotifAtTop/CNotifAtTop.vue index ee6f2a67..43ae0110 100755 --- a/src/components/CNotifAtTop/CNotifAtTop.vue +++ b/src/components/CNotifAtTop/CNotifAtTop.vue @@ -2,11 +2,11 @@
diff --git a/src/css/app.scss b/src/css/app.scss index 3d2aca4d..9b9500aa 100755 --- a/src/css/app.scss +++ b/src/css/app.scss @@ -381,7 +381,7 @@ h3 { @media (max-width: 718px) { // PER VERSIONE MOBILE max-width: 400px; - padding: 1rem 1rem; + padding: 0.5rem 0.5rem; } } diff --git a/src/db/lang/ws_it.js b/src/db/lang/ws_it.js index ab3d8ef2..c7366e95 100755 --- a/src/db/lang/ws_it.js +++ b/src/db/lang/ws_it.js @@ -1,9 +1,9 @@ const msg_website_it = { ws: { - sitename: 'Gruppo Macro', - siteshortname: 'Gruppo Macro', - description: '', - keywords: '', + sitename: 'Riso', + siteshortname: 'RISO', + description: 'Siamo la Rete Italiana di Scambio Orizzontale, abbiamo creato questa piattaforma per metterla al servizio di chi vuole riscoprire il valore della condivisione e della cooperazione. Valori semplici e profondi che ci aiutano a ritrovare il Senso della Vita, perduto in questa società consumista, e riporti quei Sani Pricìpi Naturali ed Umani di Fratellanza che intere popolazioni antiche conoscevano bene.', + keywords: 'riso, piattaforma di scambio, rete italiana scambio orizzontale, riso app, riso piattaforma, scambio e baratto, momenta RIS', }, hours: { descr: 'Descrizione', @@ -16,35 +16,23 @@ const msg_website_it = { pages: { home: 'Home', profile: 'Profilo', - install_site: 'Installa Sito', profile2: 'ProfiloU', mypage2: 'mypage2', myservice2: 'myservice2', myhosps2: 'myhosps2', mygood2: 'mygood2', - catalogo: 'Catalogo', fundraising: 'Sostieni il Progetto', notifs: 'Configura le Notifiche', unsubscribe: 'Disiscriviti', - unsubscribe_user: 'Disiscriviti User', test: 'Test', projects: 'Progetti', report: 'Report Ore', producer: 'Produttore', orderinfo: 'Ordini Effettuati', products: 'Prodotti', - cash: 'Cassa', - productInfos: 'Info Prodotti', - listinoprodotti: 'Listino Prodotti', productslist: 'Lista Prodotti', collabora: 'Collabora', - categories: 'Categorie', storehouses: 'Magazzino', - providers: 'Fornitori', - catprods: 'Categorie', - subcatprods: 'Sotto-Categorie', - gasordine: 'Gas Ordine', - scontisticas: 'Scontistica', departments: 'Uffici', orders: 'Ordini Ricevuti', orders2: 'Ordini Ricevuti', @@ -133,11 +121,9 @@ const msg_website_it = { only_residenti: 'Solo Residenti', only_consiglio: 'Solo Consiglieri', color: 'Colore', - gasordini: 'Gas Ordini', - gestoreordini: 'Gestore Ordini', }, msg: { - myAppName: 'Più che Buono', + myAppName: 'Riso', myAppDescription: 'Il primo Vero Social Libero, Equo e Solidale, dove Vive Consapevolezza e Aiuto Comunitario. Gratuito', underconstruction: 'App in costruzione...', myDescriz: '', diff --git a/src/db/static_data.ts b/src/db/static_data.ts index 91805981..efd77ed1 100755 --- a/src/db/static_data.ts +++ b/src/db/static_data.ts @@ -67,6 +67,28 @@ function getDynamicPages(site: ISites): IListRoutes[] { inmenu: false, infooter: false, }, + { + active: true, + order: 12, + path: '/goods', + materialIcon: 'fas fa-tshirt', + name: 'mypages.goods', + component: () => import('@/root/goods/goods.vue'), + meta: { requiresAuth: true }, + inmenu: true, + infooter: true, + }, + { + active: true, + order: 15, + path: '/services', + materialIcon: 'fas fa-house-user', + name: 'mypages.services', + component: () => import('@/root/services/services.vue'), + meta: { requiresAuth: true }, + inmenu: true, + infooter: true, + }, { active: true, order: 15, @@ -78,6 +100,17 @@ function getDynamicPages(site: ISites): IListRoutes[] { inmenu: false, infooter: false, }, + { + active: true, + order: 15, + path: '/hosps', + materialIcon: 'fas fa-bed', + name: 'mypages.hosp', + component: () => import('@/root/hosp/hosp.vue'), + meta: { requiresAuth: true }, + inmenu: true, + infooter: true, + }, { active: site.confpages && site.confpages.enableCircuits, order: 16, diff --git a/src/layouts/toolbar/coinsPopover/coinsPopover.ts b/src/layouts/toolbar/coinsPopover/coinsPopover.ts index bb0aeef4..1d457187 100755 --- a/src/layouts/toolbar/coinsPopover/coinsPopover.ts +++ b/src/layouts/toolbar/coinsPopover/coinsPopover.ts @@ -109,17 +109,17 @@ export default defineComponent({ } } - function getlastnotif(username: string): any { + function getlastnotifcoins(username: string): any { // Get msg for this chat - if (notifStore.last_notifs) - return notifStore.last_notifs.find((rec: INotif) => rec.dest === username) + if (notifStore.last_notifcoins) + return notifStore.last_notifcoins.find((rec: INotif) => rec.dest === username) // return users_msg_saved[username] } function getlastdataread(username: string): any { // Get msg for this - let myrec = getlastnotif(username) + let myrec = getlastnotifcoins(username) const lastdata: any = (myrec && myrec.lastdataread) ? myrec.lastdataread : tools.getLastDateReadReset() let mydate = '' @@ -143,7 +143,8 @@ export default defineComponent({ return notifStore.updateNotifDataFromServer({ username, - lastdataread: getlastdataread(username) + lastdataread: getlastdataread(username), + qualinotif: shared_consts.QualiNotifs.CIRCUITS }).then((ris) => { notifStore.updateNotification = false diff --git a/src/layouts/toolbar/coinsPopover/coinsPopover.vue b/src/layouts/toolbar/coinsPopover/coinsPopover.vue index cab967b3..8f0a5238 100755 --- a/src/layouts/toolbar/coinsPopover/coinsPopover.vue +++ b/src/layouts/toolbar/coinsPopover/coinsPopover.vue @@ -55,6 +55,8 @@ + +
-
+
@@ -163,13 +165,13 @@ - + {{ $t('notifs.read') }} - + diff --git a/src/layouts/toolbar/notifPopover/notifPopover.ts b/src/layouts/toolbar/notifPopover/notifPopover.ts index 5796b827..cda344b5 100755 --- a/src/layouts/toolbar/notifPopover/notifPopover.ts +++ b/src/layouts/toolbar/notifPopover/notifPopover.ts @@ -179,7 +179,8 @@ export default defineComponent({ return notifStore.updateNotifDataFromServer({ username: myusername, - lastdataread: getlastdataread(myusername) + lastdataread: getlastdataread(myusername), + qualinotif: shared_consts.QualiNotifs.OTHERS }).then((ris) => { notifStore.updateNotification = false diff --git a/src/layouts/toolbar/notifPopover/notifPopover.vue b/src/layouts/toolbar/notifPopover/notifPopover.vue index dfe94abd..f0ca33e1 100755 --- a/src/layouts/toolbar/notifPopover/notifPopover.vue +++ b/src/layouts/toolbar/notifPopover/notifPopover.vue @@ -251,7 +251,7 @@ @@ -261,7 +261,7 @@ diff --git a/src/model/MessageStore.ts b/src/model/MessageStore.ts index bb0cdde4..aad73000 100755 --- a/src/model/MessageStore.ts +++ b/src/model/MessageStore.ts @@ -114,6 +114,7 @@ export interface IMessageState { export interface INotifState { last_notifs: INotif[] + last_notifcoins: INotif[] show_all: boolean updateNotification: boolean countNotif: number diff --git a/src/model/Products.ts b/src/model/Products.ts index 8f4d46b5..e24d06fe 100755 --- a/src/model/Products.ts +++ b/src/model/Products.ts @@ -58,6 +58,14 @@ export interface IVariazione { eta?: string } +export interface IAuthor { + _id?: any + name?: string + surname?: string + bio?: string + img?: string +} + export interface IProduct { _id?: any active?: boolean @@ -133,6 +141,7 @@ export interface IOrder { export interface IProductsState { products: IProduct[] + authors: IAuthor[] cart: ICart orders: IOrderCart[] catprods: ICatProd[] diff --git a/src/statics/lang/it.js b/src/statics/lang/it.js index c3e410ce..c948e6cc 100755 --- a/src/statics/lang/it.js +++ b/src/statics/lang/it.js @@ -1427,7 +1427,8 @@ const msg_it = { refuse_coins_qty: 'Rifiuta', refuse_coins: 'Rifiuta RIS', movements: 'Movimenti', - ris_in_arrivo: '👉🏻 Ci sono RIS in Arrivo !', + ris_in_arrivo: '👉🏻 Apri, hai RIS da ricevere !', + mov_in_arrivo: '👉🏻 Apri {mov} transazioni in RIS!', transaz: 'mov', movements_made: 'Movimenti effettuati', contocomunitario: 'Conto Comunitario', diff --git a/src/store/Modules/fieldsTable.ts b/src/store/Modules/fieldsTable.ts index c3f51a8a..ab765e79 100755 --- a/src/store/Modules/fieldsTable.ts +++ b/src/store/Modules/fieldsTable.ts @@ -2098,6 +2098,7 @@ export const colTableOrdersCart = [ export const colTableProducts = [ AddCol({ name: 'active', label_trans: 'products.active', fieldtype: costanti.FieldType.boolean }), AddCol({ name: 'isbn', label_trans: 'products.isbn' }), + AddCol({ name: 'name', label_trans: 'products.name' }), AddCol({ name: 'idProductInfo', label_trans: 'products.productInfo', @@ -3703,6 +3704,7 @@ export const fieldsTable = { 'countries', 'phones', 'cities', + 'products', ], tableWithUsername: [ @@ -3767,7 +3769,7 @@ export const fieldsTable = { label: 'Prodotti', columns: colTableProducts, colkey: '_id', - collabel: '_id', + collabel: 'name', }, { value: 'orderscarts', diff --git a/src/store/Modules/tools.ts b/src/store/Modules/tools.ts index 44e42e14..20760953 100644 --- a/src/store/Modules/tools.ts +++ b/src/store/Modules/tools.ts @@ -5806,6 +5806,9 @@ export const tools = { if (res && res.arrrecnotif) { notifStore.updateArrRecNotifFromServer(res.arrrecnotif) } + if (res && res.arrrecnotifcoins) { + notifStore.updateArrRecNotifCoinsFromServer(res.arrrecnotifcoins) + } if (res && res.userprofile) { // console.log('updateMyData', res.userprofile) @@ -7000,10 +7003,14 @@ export const tools = { }, getValueByFunzOrVal(value: any, keyfunz: any) { - if (typeof keyfunz === 'function') { - return keyfunz(value) - } else { - return value[keyfunz] + try { + if (typeof keyfunz === 'function') { + return keyfunz(value) + } else { + return value[keyfunz] + } + } catch (e) { + return '' } }, @@ -7712,7 +7719,7 @@ export const tools = { isTypeByRecMov(rec: IMovVisu) { let type = costanti.TypeMov.Nessuno - if (rec && rec.userfrom) { + if (rec && (rec.userfrom || rec.userto || rec.groupfrom || rec.groupto)) { const userStore = useUserStore() if (rec.userfrom && userStore.my.username === rec.userfrom.username) { type = costanti.TypeMov.Uscita @@ -7732,6 +7739,11 @@ export const tools = { return this.isTypeByRecMov(rec) === costanti.TypeMov.Entrata }, + isUscitaByRecMov(rec: IMovVisu) { + + return this.isTypeByRecMov(rec) === costanti.TypeMov.Uscita + }, + getSymbolByCircuit(circuit: any) { try { if (circuit.symbol) { @@ -8584,7 +8596,7 @@ export const tools = { return color }, - getIconByVersione (versione: number ) { + getIconByVersione(versione: number) { let str = '' if (versione === shared_consts.VERSIONE.NUOVO) str = 'fas fa-book' @@ -8615,8 +8627,42 @@ export const tools = { // get the last 2 digit fraction part, of a decimal number getDecPart2Digit(number: number) { - return Math.round(number * 100) % 100 - } + return Math.round(number * 100) % 100 + }, + + getRecordByField(field: any, record: any) { + let mioval = '' + if (field) { + const arrfields = field.split('.') + if (arrfields && arrfields.length > 0) { + try { + mioval = record[arrfields[0]][arrfields[1]] + } catch (e) { + return '' + } + } else { + mioval = record[field] + } + } + return mioval + }, + + 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 + } + } else { + record[field] = value + } + } + return record + }, // FINE ! diff --git a/src/store/NotifStore.ts b/src/store/NotifStore.ts index 0860bfec..05f869cf 100755 --- a/src/store/NotifStore.ts +++ b/src/store/NotifStore.ts @@ -12,6 +12,7 @@ import { useUserStore } from '@store/UserStore' export const useNotifStore = defineStore('NotifStore', { state: (): INotifState => ({ last_notifs: [], + last_notifcoins: [], show_all: true, updateNotification: false, countNotif: 0, @@ -26,14 +27,14 @@ export const useNotifStore = defineStore('NotifStore', { }, getlasts_coins: (mystate: INotifState) => (): INotif[] => { - const ctrec = (mystate.last_notifs) ? mystate.last_notifs.slice(0, 20).filter((rec) => (mystate.show_all ? true : !rec.read) && (rec.typedir === shared_consts.TypeNotifs.TYPEDIR_CIRCUITS)) : [] + const ctrec = (mystate.last_notifcoins) ? mystate.last_notifcoins.filter((rec) => (mystate.show_all ? true : !rec.read) && (rec.typedir === shared_consts.TypeNotifs.TYPEDIR_CIRCUITS)) : [] return (ctrec) }, getnotifs_coinsreq: (mystate: INotifState) => (): INotif[] => { - const ctrec = (mystate.last_notifs) ? mystate.last_notifs.slice(0, 20).filter((rec) => rec.typedir === shared_consts.TypeNotifs.TYPEDIR_CIRCUITS && rec.typeid === shared_consts.TypeNotifs.ID_CIRCUIT_SENDCOINSREQ && rec.status === shared_consts.CircuitsNotif.STATUS_NONE) : [] + const ctrec = (mystate.last_notifcoins) ? mystate.last_notifcoins.filter((rec) => rec.typedir === shared_consts.TypeNotifs.TYPEDIR_CIRCUITS && rec.typeid === shared_consts.TypeNotifs.ID_CIRCUIT_SENDCOINSREQ && rec.status === shared_consts.CircuitsNotif.STATUS_NONE) : [] return (ctrec) }, @@ -44,7 +45,7 @@ export const useNotifStore = defineStore('NotifStore', { }, getnumCoinsUnread: (mystate: INotifState) => () => { - const myarr = mystate.last_notifs.filter((notif) => !notif.read && (notif.typedir === shared_consts.TypeNotifs.TYPEDIR_CIRCUITS)) + const myarr = mystate.last_notifcoins.filter((notif) => !notif.read && (notif.typedir === shared_consts.TypeNotifs.TYPEDIR_CIRCUITS)) return (tools.isArray(myarr) ? myarr.length : 0) }, @@ -85,6 +86,18 @@ export const useNotifStore = defineStore('NotifStore', { } } }, + updateRecNotifCoins(recnotif: INotif) { + if (recnotif) { + const myrec = this.last_notifcoins.find((rec: any) => rec._id === recnotif._id) + if (myrec) { + myrec.status = recnotif.status + myrec.read = recnotif.read + myrec.descr = recnotif.descr + + this.updateArrNotif() + } + } + }, updateArrRecNotifFromServer(arrrecnotif: INotif[]) { // console.log('arrrecnotif', arrrecnotif) if (arrrecnotif && arrrecnotif.length > 0) { @@ -93,6 +106,14 @@ export const useNotifStore = defineStore('NotifStore', { this.updateArrNotif() } }, + updateArrRecNotifCoinsFromServer(arrrecnotifcoins: INotif[]) { + // console.log('arrrecnotif', arrrecnotif) + if (arrrecnotifcoins && arrrecnotifcoins.length > 0) { + this.last_notifcoins = arrrecnotifcoins + + this.updateArrNotif() + } + }, async setBadgeIconApp() { // Get our dummy count and update it, @@ -129,12 +150,17 @@ export const useNotifStore = defineStore('NotifStore', { }) }, - setRead(_id: string) { + setRead(_id: string, notifcoins: boolean) { return Api.SendReq(`/sendnotif/set/${_id}/${process.env.APP_ID}`, 'GET', null) .then((res) => { // console.log('res', res) if (res) { - const rec = this.last_notifs.find((rec: any) => rec._id === _id) + let rec = null + if (!notifcoins) + rec = this.last_notifs.find((rec: any) => rec._id === _id) + else + rec = this.last_notifcoins.find((rec: any) => rec._id === _id) + if (rec) { rec.read = true } @@ -148,12 +174,15 @@ export const useNotifStore = defineStore('NotifStore', { }) }, - deleteRec(username: string, id: string) { + deleteRec(username: string, id: string, notifcoins: boolean) { return Api.SendReq(`/sendnotif/del/${username}/${id}/${process.env.APP_ID}`, 'GET', null) .then((res) => { // console.log('res', res) if (res) { - this.last_notifs = this.last_notifs.filter((rec) => rec._id !== id) + if (!notifcoins) + this.last_notifs = this.last_notifs.filter((rec) => rec._id !== id) + else + this.last_notifcoins = this.last_notifcoins.filter((rec) => rec._id !== id) } this.updateArrNotif() @@ -171,9 +200,9 @@ export const useNotifStore = defineStore('NotifStore', { // console.log('res', res) if (res) { if (qualinotif === shared_consts.QualiNotifs.CIRCUITS) - this.last_notifs = this.last_notifs.filter((rec: INotif) => rec.typedir !== shared_consts.TypeNotifs.TYPEDIR_CIRCUITS) + this.last_notifcoins = [] else if (qualinotif === shared_consts.QualiNotifs.OTHERS) - this.last_notifs = this.last_notifs.filter((rec: INotif) => rec.typedir === shared_consts.TypeNotifs.TYPEDIR_CIRCUITS) + this.last_notifs = [] this.updateArrNotif() } @@ -189,16 +218,22 @@ export const useNotifStore = defineStore('NotifStore', { return '' }, - async updateNotifDataFromServer({ username, lastdataread }: { username: string, lastdataread: Date }) { + async updateNotifDataFromServer({ username, lastdataread, qualinotif }: { username: string, lastdataread: Date, qualinotif: number }) { // console.log('updateNotifDataFromServer', username, lastdataread) - return Api.SendReq(`/sendnotif/${username}/${lastdataread}/${process.env.APP_ID}`, 'GET', null) + return Api.SendReq(`/sendnotif/${username}/${lastdataread}/${process.env.APP_ID}/${qualinotif}`, 'GET', null) .then((res) => { // console.log('res', res) if (!!res.data && !!res.data.arrnotif) { - this.last_notifs = res.data.arrnotif + if (qualinotif === shared_consts.QualiNotifs.CIRCUITS) + this.last_notifcoins = res.data.arrnotif + else + this.last_notifs = res.data.arrnotif } else { - this.last_notifs = [] + if (qualinotif === shared_consts.QualiNotifs.CIRCUITS) + this.last_notifcoins = [] + else + this.last_notifs = [] } this.updateArrNotif() tools.updateMyData(res.data.ris) diff --git a/src/store/Products.ts b/src/store/Products.ts index ea462c8d..1e558b0d 100755 --- a/src/store/Products.ts +++ b/src/store/Products.ts @@ -1,4 +1,4 @@ -import { IBaseOrder, ICart, IOrder, IOrderCart, IProduct, IProductsState, IProductInfo, ICatProd, IUserShort, IGasordine } from 'model' +import { IBaseOrder, ICart, IOrder, IOrderCart, IProduct, IProductsState, IProductInfo, ICatProd, IUserShort, IGasordine, IAuthor } from 'model' import { Api } from '@api' import { serv_constants } from '@src/store/Modules/serv_constants' @@ -107,6 +107,7 @@ export const useProducts = defineStore('Products', { orders: [], catprods: [], catprods_gas: [], + authors: [], subcatprods: [], productInfos: [], userActive: { username: '', name: '', surname: '', _id: '' }, @@ -123,6 +124,24 @@ export const useProducts = defineStore('Products', { }, + getAuthors: (state: IProductsState) => (): any[] => { + // Get the list of authors, for the q-select component using state.authors array + // [{name: xxx, value: _id }] + + // add default value for q-select + const options = [ + { + label: '[Tutti]', + value: '', + }, + ...state.authors.map((rec: IAuthor) => { + return { label: rec.name + (rec.surname ? ' ' + rec.surname : ''), value: rec._id } + }), + ] + return options + }, + + getNumProdTot: (state: IProductsState) => (): number => { return state.products.length }, diff --git a/src/store/UserStore.ts b/src/store/UserStore.ts index 98e48e2a..f7722661 100755 --- a/src/store/UserStore.ts +++ b/src/store/UserStore.ts @@ -1647,6 +1647,9 @@ export const useUserStore = defineStore('UserStore', { if (res && res.data.arrrecnotif) { notifStore.updateArrRecNotifFromServer(res.data.arrrecnotif) } + if (res && res.data.arrrecnotifcoins) { + notifStore.updateArrRecNotifCoinsFromServer(res.data.arrrecnotifcoins) + } if (res.data.useraccounts && res.data.useraccounts.length > 0) { this.my.profile.useraccounts = res.data.useraccounts } @@ -1782,12 +1785,15 @@ export const useUserStore = defineStore('UserStore', { return await Api.SendReq('/users/circuits/cmd', 'POST', { usernameOrig, circuitname, cmd, value, extrarec }) .then((res) => { this.updateTables = true + const notifStore = useNotifStore() if (res.data.recnotif) { - const notifStore = useNotifStore() - - notifStore.updateRecNotif(res.data.recnotif) - - notifStore.updateArrRecNotifFromServer(res.data.arrrecnotif) + if (res.data.recnotif.typedir === shared_consts.TypeNotifs.TYPEDIR_CIRCUITS) { + notifStore.updateRecNotifCoins(res.data.recnotif) + notifStore.updateArrRecNotifCoinsFromServer(res.data.arrrecnotifcoins) + } else { + notifStore.updateRecNotif(res.data.recnotif) + notifStore.updateArrRecNotifFromServer(res.data.arrrecnotif) + } } return res.data }).catch((error) => { diff --git a/src/store/globalStore.ts b/src/store/globalStore.ts index ee588068..692aaeec 100644 --- a/src/store/globalStore.ts +++ b/src/store/globalStore.ts @@ -329,7 +329,7 @@ export const useGlobalStore = defineStore('GlobalStore', { else if (table === 'storehouses') ris = state.storehouses else if (table === 'providers') ris = state.providers else if (table === 'productinfos') ris = Products.productInfos - else if (table === 'product') ris = Products.products + // else if (table === 'products') ris = Products.products else if (table === 'gasordines') ris = state.gasordines else if (table === 'scontisticas') ris = state.scontisticas else if (table === 'groups') ris = state.groups @@ -339,6 +339,7 @@ export const useGlobalStore = defineStore('GlobalStore', { else if (table === 'categorys') ris = state.categories else if (table === 'catprods') ris = Products.catprods else if (table === 'catprods_gas') ris = Products.catprods_gas + else if (table === 'authors') ris = Products.authors else if (table === 'catais') ris = state.catAI else if (table === 'queryais') ris = state.queryAIList else if (table === 'sharewithus') ris = state.sharewithus @@ -1573,6 +1574,7 @@ export const useGlobalStore = defineStore('GlobalStore', { Products.catprods = (res.data.catprods) ? [...res.data.catprods] : [] Products.catprods_gas = (res.data.catprods_gas) ? [...res.data.catprods_gas] : [] + Products.authors = (res.data.authors) ? [...res.data.authors] : [] this.gasordines = (res.data.gasordines) ? [...res.data.gasordines] : [] this.scontisticas = (res.data.scontisticas) ? [...res.data.scontisticas] : [] diff --git a/src/views/ecommerce/catalogo/catalogo.ts b/src/views/ecommerce/catalogo/catalogo.ts index 5301f1ac..547c469c 100755 --- a/src/views/ecommerce/catalogo/catalogo.ts +++ b/src/views/ecommerce/catalogo/catalogo.ts @@ -11,13 +11,16 @@ import { costanti } from '@costanti' import { shared_consts } from '@/common/shared_vuejs' import { CProductCard } from '@src/components/CProductCard' +import { CMySelect } from '@src/components/CMySelect' import { CCatalogoCard } from '@src/components/CCatalogoCard' import { CSelectUserActive } from '@src/components/CSelectUserActive' -import { IProduct } from '@src/model' +import { IProduct, ISearchList } from 'model' + +import { fieldsTable } from '@store/Modules/fieldsTable' export default defineComponent({ name: 'Catalogo', - components: { CCatalogoCard, CProductCard, CSelectUserActive }, + components: { CCatalogoCard, CProductCard, CSelectUserActive, CMySelect }, props: {}, setup() { const userStore = useUserStore() @@ -28,6 +31,7 @@ export default defineComponent({ const { t } = useI18n() const search = ref('') + const optauthors = ref([]) const filter = ref({ author: '', @@ -43,16 +47,27 @@ export default defineComponent({ const refreshpage = ref(false) const show_hide = ref(false) + const mycolumns = ref([]) + + const searchList = ref([] as ISearchList[]) + const arrProducts = ref([]) const numRecLoaded = ref(0) - // Create a ref for the component to fix const componentToFixRef = ref(null); const isFixed = ref(false); + const labelcombo = computed(() => (item: any) => { + let lab = item.label + if (item.showcount) + lab += ' (' + valoriopt.value(item, false, false).length + ')' + return lab + }) + + const arrLoaded = computed(() => { if (arrProducts.value && numRecLoaded.value) return arrProducts.value.slice(0, numRecLoaded.value) @@ -86,6 +101,13 @@ export default defineComponent({ tools.scrollToTopValue(300) } }) + watch(() => filter.value.author, (newval, oldval) => { + + calcArrProducts() + if (tools.scrollTop() > 300) { + tools.scrollToTopValue(300) + } + }) watch(() => cosa.value, (newval, oldval) => { tools.setCookie(tools.COOK_COSA_PRODOTTI, cosa.value.toString()) @@ -98,21 +120,24 @@ export default defineComponent({ // console.log('calcArrProducts') refreshpage.value = true - let arrprod = productStore.getProducts(cosa.value) - let catstr = cat.value; + let arrprod = productStore.getProducts(cosa.value) || []; + let catstr = cat.value || ''; + let filtroAuthor = filter.value.author || ''; let gasselstr = '' if (cosa.value === shared_consts.PROD.GAS) { - gasselstr = idGasSel.value + gasselstr = idGasSel.value || ''; } - let lowerSearchText = search.value.toLowerCase().trim(); - if ((!lowerSearchText || (lowerSearchText && lowerSearchText.length < 2)) && !catstr && (!gasselstr && (cosa.value !== shared_consts.PROD.GAS))) { + let lowerSearchText = (search.value || '').toLowerCase().trim(); + lowerSearchText = lowerSearchText.replace(/[-@:=]/g, ''); + if ((!lowerSearchText || (lowerSearchText && lowerSearchText.length < 2)) && !catstr && !filtroAuthor && (!gasselstr && (cosa.value !== shared_consts.PROD.GAS))) { } else { arrprod = arrprod.filter((product: IProduct) => { if (product && product.productInfo) { - let lowerName = product.productInfo.name!.toLowerCase(); - let hasCategoria = !catstr || (catstr && product.productInfo.idCatProds?.includes(catstr)); + let lowerName = (product.productInfo.name || '').toLowerCase(); + let hasCategoria = !catstr || (catstr && (product.productInfo.idCatProds || []).includes(catstr)); + let hasAuthor = !filtroAuthor || (filtroAuthor && (product.productInfo.idAuthors || []).includes(filtroAuthor)); let productgassel = true if (gasselstr || (cosa.value === shared_consts.PROD.GAS)) { @@ -121,12 +146,15 @@ export default defineComponent({ // Use a regular expression to match whole words let codeMatch = new RegExp(`\\b${lowerSearchText}\\b`, 'i'); - let nameMatch = new RegExp(`\\b(?=.*\\b${lowerSearchText.split(/\s+/).map(word => `(${word})\\b`).join('.*\\b')}\\b)`, 'i'); + // let nameMatch = new RegExp(`\\b(?=.*\\b${lowerSearchText.split(/\s+/).map(word => `(${word})\\b`).join('.*\\b')}\\b)`, 'i'); // 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 && productgassel; + return (codeMatch.test(product.productInfo.code || '') || allWordsPresent) && hasCategoria && hasAuthor && productgassel; + } else { + console.error('product or product.productInfo is null'); + return false; } }); } @@ -136,6 +164,7 @@ export default defineComponent({ refreshpage.value = false } + /*function getProducts() { let arrprod = productStore.getProducts(cosa.value) if (!search.value) { @@ -155,6 +184,26 @@ export default defineComponent({ async function mounted() { loadpage.value = false await productStore.loadProducts() + + mycolumns.value = fieldsTable.getArrColsByTable('products') + + searchList.value = [ + { + label: 'Ricerca', + table: 'products', + key: 'titolo', + type: costanti.FieldType.select_by_server, + value: '', + addall: true, + arrvalue: [], + useinput: true, + filter: null, + tablesel: 'products', + }, + ] + + optauthors.value = productStore.getAuthors() + cosa.value = tools.getCookie(tools.COOK_COSA_PRODOTTI, shared_consts.PROD.GAS, true) if (cosa.value === shared_consts.PROD.TUTTI) cosa.value = shared_consts.PROD.GAS @@ -207,6 +256,42 @@ export default defineComponent({ } } + function filterFn(val: any, update: any, abort: any) { + update(() => { + const needle = val.toLowerCase(); + optauthors.value = productStore.getAuthors().filter(v => { + const authorName = v.label.toLowerCase(); + const wordsToSearch = needle.split(' '); + return wordsToSearch.every((word: any) => { + if (word.length > 1) { + return authorName.includes(word); + } else { + return authorName.split(' ').some((namePart: any) => namePart.startsWith(word)); + } + }); + }); + }); + } + + function selauthor(id: string, value: string) { + filter.value.author = id + } + + function searchval(newval: any, table: any, tablesel: any) { + console.log('REFRR searchval', newval, table, 'tablesel', tablesel) + if (newval === '') { + search.value = '' + } else { + search.value = newval.name + } + } + + const valoriopt = computed(() => (item: any, addall: boolean, addnone: boolean) => { + // console.log('valoriopt', item.table) + return globalStore.getTableJoinByName(item.table, addall, addnone, item.filter) + }) + + onMounted(mounted) return { @@ -232,6 +317,15 @@ export default defineComponent({ numRecLoaded, arrLoaded, filter, + optauthors, + filterFn, + selauthor, + searchList, + fieldsTable, + searchval, + valoriopt, + labelcombo, + mycolumns, } } }) diff --git a/src/views/ecommerce/catalogo/catalogo.vue b/src/views/ecommerce/catalogo/catalogo.vue index 553d4371..ac1fd69a 100755 --- a/src/views/ecommerce/catalogo/catalogo.vue +++ b/src/views/ecommerce/catalogo/catalogo.vue @@ -167,21 +167,73 @@ >
+
+ + + +
+ - - + +
@@ -237,6 +289,7 @@ quante_col: 'c2', in_3d: false, }" + @selauthor="selauthor" />