- fix RIS in pendenti, se troppi msg, non compariva piu

- cataloghi, ricerca pickup
This commit is contained in:
Surya Paolo
2024-05-09 23:36:58 +02:00
parent 58f53f8c52
commit faf0fabfb0
68 changed files with 1776 additions and 188 deletions

View File

@@ -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=""

View File

@@ -1 +1 @@
TERMINA DI LAVORARE SU riso.app: (Sovrascrivo !)
TERMINA DI LAVORARE SU gruppomacro.app: (Sovrascrivo !)

View File

@@ -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": [],

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

BIN
public/images/ferrara.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 634 KiB

BIN
public/images/riso_home.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

View File

@@ -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

View File

@@ -269,7 +269,7 @@ export const shared_consts = {
KEY_TO_CRYPTED: ['PWD_FROM'],
TablePickup: ['countries', 'phones', 'cities'],
TablePickup: ['countries', 'phones'],
PARAM_SHOW_PROVINCE: 1,

View File

@@ -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,6 +313,7 @@
.scheda-book {
text-align: center;
margin-left: 20px;
@media (max-width: 718px) {
margin-left: 5px;
}
@@ -284,7 +321,8 @@
.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

View File

@@ -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<IProduct | null>,
@@ -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,
}
}
})

View File

@@ -77,10 +77,11 @@
v-for="(author, index) in myproduct.productInfo.authors"
:key="author._id"
>
<span class="author"
<span v-if="index > 0">, </span>
<span class="author cursor-pointer text-primary"
@click="click_author(author._id, author.name + ' ' + author.surname)"
>{{ author.name }} {{ author.surname }}</span
>
<span v-if="index > 0">, </span>
</span>
</q-card-subtitle>
<q-card-subtitle
@@ -232,7 +233,6 @@
<div v-show="indvariazSel == index">
<div
v-show="
indvariazSel >= 0 &&
tools.disponibStr(variazione.quantita)
"
class="row justify-center q-mt-sm vertical-middle"
@@ -250,7 +250,6 @@
>
</div>
<div
v-show="indvariazSel >= 0"
class="row justify-center vertical-middle"
style="align-items: center"
>
@@ -265,7 +264,7 @@
}}</span>
</div>
<div
v-show="indvariazSel >= 0 && !!variazione.formato"
v-show="!!variazione.formato"
class="row justify-center q-ma-sm vertical-middle"
style="align-items: center"
>
@@ -283,7 +282,7 @@
<div class="row justify-center q-mt-sm">
<q-btn
v-if="
indVariazSel >= 0 && variazione.addtocart_link && true
variazione.addtocart_link && true
"
:href="variazione.addtocart_link"
target="_blank"

View File

@@ -496,7 +496,7 @@
color="green"
></q-icon>
<q-icon
v-else
v-else-if="tools.isUscitaByRecMov(row)"
name="fas fa-share-square"
color="red"
></q-icon>
@@ -504,7 +504,7 @@
{{
tools.isEntrataByRecMov(row)
? t('movement.movin')
: t('movement.movout')
: (tools.isUscitaByRecMov(row) ? t('movement.movout') : '')
}}
</q-toolbar-title>
</q-toolbar>

View File

@@ -154,7 +154,7 @@
color="green"
></q-icon>
<q-icon
v-else
v-else-if="tools.isUscitaByRecMov(row)"
name="fas fa-share-square"
color="red"
></q-icon>
@@ -162,7 +162,7 @@
{{
tools.isEntrataByRecMov(row)
? t('movement.movin')
: t('movement.movout')
: (tools.isUscitaByRecMov(row) ? t('movement.movout') : '')
}}
</q-toolbar-title>
</q-toolbar>

View File

@@ -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]

View File

@@ -50,7 +50,12 @@
:text-color="$q.dark.isActive ? `white` : `black`"
class="q-my-none q-ml-xs q-mr-none"
>
<q-avatar color="primary" text-color="white" icon="" size="12px"/>
<q-avatar
color="primary"
text-color="white"
icon=""
size="12px"
/>
{{ scope.opt[fieldsTable.getLabelByTable(tablesel)] }}
</q-chip>
</div>
@@ -58,18 +63,20 @@
<template v-slot:option="{ itemProps, opt, selected, toggleOption }">
<q-item v-bind="itemProps">
<q-item-section>
<q-item-label>{{ opt[fieldsTable.getLabelByTable(tablesel)] }}</q-item-label>
<q-item-label>{{
opt[fieldsTable.getLabelByTable(tablesel)]
}}</q-item-label>
</q-item-section>
<q-item-section side>
<q-toggle :model-value="selected" @update:model-value="toggleOption(opt)"/>
<q-toggle
:model-value="selected"
@update:model-value="toggleOption(opt)"
/>
</q-item-section>
</q-item>
</template>
</q-select>
</div>
<div v-else-if="pickup">
<q-select
@@ -92,6 +99,14 @@
@filter="filterFn"
v-bind="$attrs"
>
<template v-slot:append>
<q-icon
v-if="myvalue !== ''"
class="cursor-pointer"
name="clear"
@click.stop.prevent="myvalue = ''"
/>
</template>
<template v-if="getIcon()" v-slot:prepend>
<q-icon size="xs" :name="getIcon()" />
</template>
@@ -105,7 +120,9 @@
<template v-slot:option="scope">
<q-item v-bind="scope.itemProps">
<q-item-section>
<q-item-label> {{ tools.getValueByFunzOrVal(scope.opt,optlab) }}</q-item-label>
<q-item-label>
{{ tools.getValueByFunzOrVal(scope.opt, optlab) }}</q-item-label
>
</q-item-section>
</q-item>
</template>
@@ -133,16 +150,15 @@
:options="valori"
:option-value="optval"
:option-label="optlab"
:dense="dense">
:dense="dense"
>
<!--options-selected-class="text-deep-blue"-->
<template v-if="getIcon()" v-slot:prepend>
<q-icon :name="getIcon()" />
</template>
<template
v-slot:selected-item="scope">
<div v-if="tools.getValueByFunzOrVal(scope.opt,optlab)">
<template v-slot:selected-item="scope">
<div v-if="tools.getValueByFunzOrVal(scope.opt, optlab)">
<q-chip
removable
dense
@@ -151,27 +167,38 @@
:color="$q.dark.isActive ? `black` : `white`"
class="q-my-none q-ml-xs q-mr-none"
>
<q-avatar color="primary" text-color="white" :icon="scope.opt.icon ? scope.opt.icon : ''" size="12px"/>
<q-avatar
color="primary"
text-color="white"
:icon="scope.opt.icon ? scope.opt.icon : ''"
size="12px"
/>
{{ tools.getValueByFunzOrVal(scope.opt, optlab) }}
</q-chip>
</div>
</template>
<template
v-if="withToggle"
v-slot:option="{ itemProps, opt, selected, toggleOption }">
v-slot:option="{ itemProps, opt, selected, toggleOption }"
>
<q-item v-bind="itemProps">
<q-item-section>
<q-item-label>{{ tools.getValueByFunzOrVal(opt,optlab) }}</q-item-label>
<q-item-label v-if="'hint' in opt" class="hint">{{ opt['hint'] }}</q-item-label>
<q-item-label>{{
tools.getValueByFunzOrVal(opt, optlab)
}}</q-item-label>
<q-item-label v-if="'hint' in opt" class="hint">{{
opt['hint']
}}</q-item-label>
</q-item-section>
<q-item-section side>
<q-toggle :model-value="selected" @update:model-value="toggleOption(opt)"/>
<q-toggle
:model-value="selected"
@update:model-value="toggleOption(opt)"
/>
</q-item-section>
</q-item>
</template>
</q-select>
</div>
<div v-else>
<q-select
@@ -194,24 +221,27 @@
input-debounce="0"
map-options
v-bind="$attrs"
:class="myclass ? myclass : 'combowidth'">
:class="myclass ? myclass : 'combowidth'"
>
<template v-if="getIcon()" v-slot:prepend>
<q-icon :name="getIcon()" />
</template>
<template v-slot:option="scope">
<q-item v-bind="scope.itemProps">
<q-item-section avatar>
<q-icon :name="scope.opt.icon ? scope.opt.icon : ''"/>
<q-icon :name="scope.opt.icon ? scope.opt.icon : ''" />
</q-item-section>
<q-item-section>
<q-item-label>{{ tools.getValueByFunzOrVal(scope.opt,optlab) }}</q-item-label>
<q-item-label v-if="'hint' in scope.opt" class="hint">{{ scope.opt['hint'] }}</q-item-label>
<q-item-label>{{
tools.getValueByFunzOrVal(scope.opt, optlab)
}}</q-item-label>
<q-item-label v-if="'hint' in scope.opt" class="hint">{{
scope.opt['hint']
}}</q-item-label>
</q-item-section>
</q-item>
</template>
</q-select>
</div>
</div>
</template>

View File

@@ -2,11 +2,11 @@
<div class="q-ma-sm text-center">
<q-btn
v-if="num_notifs > 0"
:label="t('circuit.ris_in_arrivo') + (num_notifs > 1 ? (' (' + num_notifs + ' ' + t('circuit.transaz') + ')') : '')"
:label="(num_notifs > 1) ? t('circuit.mov_in_arrivo', {mov: num_notifs}) : t('circuit.ris_in_arrivo')"
@click="shownotif = true"
icon="fas fa-coins"
rounded
color="primary"
color="positive"
></q-btn>
</div>

View File

@@ -381,7 +381,7 @@ h3 {
@media (max-width: 718px) {
// PER VERSIONE MOBILE
max-width: 400px;
padding: 1rem 1rem;
padding: 0.5rem 0.5rem;
}
}

View File

@@ -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: '',

View File

@@ -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,

View File

@@ -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

View File

@@ -55,6 +55,8 @@
</CMyCircuits>
<div class="row justify-center margin_buttons q-gutter-lg">
<q-btn-toggle
v-model="show_all"
@@ -163,13 +165,13 @@
<q-btn dense rounded icon="fas fa-ellipsis-h">
<q-menu>
<q-list style="min-width: 150px">
<q-item clickable v-close-popup @click="notifStore.setRead(notif._id)">
<q-item clickable v-close-popup @click="notifStore.setRead(notif._id, true)">
<q-item-section side>
<q-icon name="fas fa-trash-alt"/>
</q-item-section>
<q-item-section>{{ $t('notifs.read') }}</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="notifStore.deleteRec(username, notif._id)">
<q-item clickable v-close-popup @click="notifStore.deleteRec(username, notif._id, true)">
<q-item-section side>
<q-icon name="fas fa-trash-alt"/>
</q-item-section>

View File

@@ -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

View File

@@ -251,7 +251,7 @@
<q-item
clickable
v-close-popup
@click="notifStore.setRead(notif._id)"
@click="notifStore.setRead(notif._id, false)"
>
<q-item-section side>
<q-icon name="fas fa-trash-alt" />
@@ -261,7 +261,7 @@
<q-item
clickable
v-close-popup
@click="notifStore.deleteRec(username, notif._id)"
@click="notifStore.deleteRec(username, notif._id, false)"
>
<q-item-section side>
<q-icon name="fas fa-trash-alt" />

View File

@@ -114,6 +114,7 @@ export interface IMessageState {
export interface INotifState {
last_notifs: INotif[]
last_notifcoins: INotif[]
show_all: boolean
updateNotification: boolean
countNotif: number

View File

@@ -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[]

View File

@@ -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',

View File

@@ -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',

View File

@@ -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'
@@ -8616,7 +8628,41 @@ export const tools = {
// get the last 2 digit fraction part, of a decimal number
getDecPart2Digit(number: number) {
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 !

View File

@@ -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)

View File

@@ -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
},

View File

@@ -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) => {

View File

@@ -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] : []

View File

@@ -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(<any>[])
const filter = ref(<any>{
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<any>([])
const numRecLoaded = ref(0)
// Create a ref for the component to fix
const componentToFixRef = ref(<any>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,
}
}
})

View File

@@ -167,21 +167,73 @@
></q-toggle>
</div>
<div class="col" v-for="(item, index) in searchList" :key="index">
<CMySelect
:col="fieldsTable.getColByColumns(mycolumns, item.key)"
v-if="
item.type === costanti.FieldType.select ||
item.type === costanti.FieldType.select_by_server
"
:label="
item.value && item.value._id > 0 ? undefined : labelcombo(item)
"
v-model:value="item.value"
@update:value="searchval(item.value, item.table, tablesel)"
:addall="item.addall"
:addnone="item.addnone"
:addlast="true"
:tablesel="
item.type === costanti.FieldType.select_by_server
? item.tablesel
: ''
"
:pickup="item.type === costanti.FieldType.select_by_server"
:label-color="$q.dark.isActive ? 'white' : 'black'"
myclass="comboselector"
color="primary"
:dense="true"
:icon_alternative="item.icon"
:optval="fieldsTable.getKeyByTable(item.table)"
:optlab="fieldsTable.getLabelByTable(item.table)"
:options="valoriopt(item, false)"
:filter="item.filter"
:filter_extra="item.filter_extra"
style="font-size: 0.8rem !important"
:useinput="
item.useinput &&
item.type !== costanti.FieldType.select_by_server
"
>
</CMySelect>
</div>
<q-toolbar>
<q-input
v-model="search"
debounce="300"
placeholder="Cerca libri..."
dense
/>
<q-select
class="full-width"
v-model="filter.author"
:options="authors"
:options="optauthors"
label="Autore"
placeholder="Tutti"
dense
/>
<q-select
emit-value
map-options
use-input
hide-selected
fill-input
stack-label
filled
@filter="filterFn"
>
<template v-slot:append>
<q-icon
v-if="filter.author !== ''"
class="cursor-pointer"
name="clear"
@click.stop.prevent="filter.author = ''"
/> </template
></q-select>
<!--<q-select
v-model="filter.publisher"
:options="publishers"
label="Editore"
@@ -201,7 +253,7 @@
label="Fascia d'età"
placeholder="Tutte"
dense
/>
/>-->
</q-toolbar>
<div class="row justify-around">
@@ -237,6 +289,7 @@
quante_col: 'c2',
in_3d: false,
}"
@selauthor="selauthor"
/>
<CProductCard
v-else-if="product.active || show_hide"