- Fare LISTA MOVIMENTI più comprensibile

- Grafica Circuiti
This commit is contained in:
Surya Paolo
2024-10-02 03:46:40 +02:00
parent 1424060813
commit e29de7e0f6
47 changed files with 937 additions and 291 deletions

View File

@@ -41,9 +41,11 @@ export default defineComponent({
function load() {
non_hai_circuito_nazionale.value = !circuitStore.sonoDentroAlCircuitoNazionale()
destin_non_ha_circuito_naz.value = !circuitStore.EDentroAlCircuitoNazionale(props.to_user)
if (userStore.getMyCircuitsInCommonByUser(props.to_user).length > 0) {
destin_non_ha_circuito_naz.value = false
if (props.to_user) {
destin_non_ha_circuito_naz.value = !circuitStore.EDentroAlCircuitoNazionale(props.to_user)
if (userStore.getMyCircuitsInCommonByUser(props.to_user).length > 0) {
destin_non_ha_circuito_naz.value = false
}
}
}

View File

@@ -12,7 +12,7 @@
userStore.hoContiCollettiviDaAmministrare() ||
userStore.hoContiComunitariDaAmministrare())
"
icon="fas fa-coins"
icon-right="img: images/1ris_rosso_100.png"
color="green"
size="md"
rounded

View File

@@ -1,14 +1,11 @@
<template>
<div v-if="small">
<q-chip
dense
class="cltexth4 chipbooked shadow-5 q-pa-sm2"
size="md"
:color="modelValue > 0 ? `green` : modelValue === 0 ? `gray` : `red`"
text-color="white"
icon="fas fa-coins"
>
{{ valueextra }} {{ tools.roundDec2(modelValue) }}
<span class="text-currency"
@@ -18,7 +15,14 @@
>{{ symbol }}</em
></span
>
<div v-if="myrecparam && myrecparam.fidoConcesso > 0 && !paramTypeAccount">
<q-icon
v-if="symbol === 'RIS'"
name="img: images/1ris_rosso_100.png"
:size="small ? `xs` : `sm`"
/>
<div
v-if="myrecparam && myrecparam.fidoConcesso > 0 && !paramTypeAccount"
>
<q-icon
:color="myrecparam.fidoConcesso > 0 ? 'blue' : 'grey'"
name="fas fa-house-user"
@@ -31,7 +35,7 @@
<div
v-if="modelValue !== null"
:class="
`text-h5 ` +
`text-h6 ` +
(small ? `bordo_stondato_small` : `bordo_stondato_stretto`) +
` full-width`
"
@@ -66,7 +70,7 @@
:readonly="readonly"
type="number"
rounded
:class="!small ? `q-px-sm text-h5` : `q-px-xs text-h7`"
:class="!small ? `q-px-sm text-h6` : `q-px-xs text-h7`"
:color="modelValue > 0 ? `green` : `red`"
>
<template v-slot:prepend>
@@ -80,7 +84,23 @@
@click="showingtooltip = !showingtooltip"
>
</q-btn>
<q-icon v-else name="fas fa-coins" :size="small ? `xs` : `sm`" />
<div v-else>
<q-btn
v-if="
myrecparam &&
myrecparam.fidoConcesso >= 0 &&
!paramTypeAccount
"
icon="fas fa-house-user"
class="q-ml-sm"
:color="myrecparam.fidoConcesso > 0 ? 'primary' : 'grey'"
text-color="white"
round
size="sm"
@click="showinghouse = !showinghouse"
>
</q-btn>
</div>
</template>
<template v-slot:control>
<div class="text-h8 text-blue">
@@ -113,17 +133,12 @@
@click="$emit('changedParamValue', true)"
></q-btn>
</div>
<q-btn
v-if="myrecparam && myrecparam.fidoConcesso >= 0 && !paramTypeAccount"
icon="fas fa-house-user"
class="q-ml-sm"
:color="myrecparam.fidoConcesso > 0 ? 'primary' : 'grey'"
text-color="white"
round
size="sm"
@click="showinghouse = !showinghouse"
>
</q-btn>
<q-icon
v-if="symbol === 'RIS'"
name="img: images/1ris_rosso_100.png"
:size="small ? `xs` : `sm`"
/>
<q-icon v-else name="img: images/1ris_rosso_100.png" :size="small ? `xs` : `sm`" />
</template>
</q-field>
</div>

View File

@@ -264,11 +264,15 @@ export default defineComponent({
]
} else if (props.table === shared_consts.TABLES_CIRCUITS) {
myoptions.value = [
{ label: '🌎 Tutti', value: tools.FILTER_ALL },
{ label: '👤 Circuiti che Gestisci', value: tools.FILTER_MYREC },
// {label: 'Seguo', value: tools.FILTER_MYFOLLOW},
]
myoptions.value = []
if (tools.gestiscoAlmeno1Circuito()) {
myoptions.value = [
{ label: '🌎 Tutti', value: tools.FILTER_ALL },
{ label: '👤 Circuiti che Gestisci', value: tools.FILTER_MYREC },
// {label: 'Seguo', value: tools.FILTER_MYFOLLOW},
]
}
} else {
/*

View File

@@ -4,6 +4,7 @@
<div class="q-ma-xs q-gutter-xs">
<div v-if="showFilterPersonal" class="text-center">
<q-btn-toggle
v-if="myoptions.length > 0"
v-model="myrecfiltertoggle"
push
glossy
@@ -11,31 +12,13 @@
:options="myoptions"
/>
</div>
<div v-if="false" class="q-mr-sm">
<q-input
v-model="search"
filled
type="search"
debounce="500"
:hint="t('finder.search_skill')"
v-on:keyup.enter="doSearch"
>
<template v-slot:after>
<q-btn
label=""
color="primary"
@click="doSearch"
icon="search"
></q-btn>
</template>
</q-input>
</div>
<CGridTableRec
ref="myGridRef"
v-if="searchList.length > 0"
:prop_mytable="table"
:options="tools.optionsTable(table)"
:prop_mytitlenew="tools.getTitleAnnuncio(table)"
prop_mytitle=""
:prop_mycolumns="col"
:prop_colkey="prop_colkey"

View File

@@ -41,6 +41,7 @@ import translate from '@/globalroutines/util'
import { toolsext } from '@store/Modules/toolsext'
import { CMyCardPopup } from '@/components/CMyCardPopup'
import { CMyCardService } from '@/components/CMyCardService'
import { CSingleMovement } from '@/components/CSingleMovement'
import { CMyCardGrpPopup } from '@/components/CMyCardGrpPopup'
import { CMyCardCircuitPopup } from '@/components/CMyCardCircuitPopup'
import { onBeforeRouteLeave, onBeforeRouteUpdate, useRouter } from 'vue-router'
@@ -60,6 +61,10 @@ export default defineComponent({
type: String,
required: true,
},
prop_mytitlenew: {
type: String,
required: true,
},
subtitle: {
type: String,
required: false,
@@ -315,7 +320,7 @@ export default defineComponent({
components: {
CMyPopupEdit, CTitleBanner, CMyFieldDb, CMySelect, CMyFriends, CMyGroups,
CMyUser, CMyRecCard, CMyCardPopup, CMyRecGrpCard, CMyCardGrpPopup, CMyCardCircuitPopup,
CMyRecCircuitCard, CMyCardService, CNotifSettings, CMapByTable,
CMyRecCircuitCard, CMyCardService, CNotifSettings, CMapByTable, CSingleMovement,
},
setup(props, { emit }) {
const $q = useQuasar()
@@ -348,6 +353,7 @@ export default defineComponent({
const mytable = ref('')
const mytitle = ref('')
const mytitlenew = ref('')
const mycolumns = ref([] as any[])
const colkey = ref('')
const search = ref('')
@@ -366,7 +372,7 @@ export default defineComponent({
const editOn = computed({
get: () => globalStore.editOn,
set: val => {
tools.updateEditOn(val)
tools.updateEditOn(val!)
},
})
@@ -1627,6 +1633,7 @@ export default defineComponent({
try {
mytable.value = props.prop_mytable
mytitle.value = props.prop_mytitle
mytitlenew.value = props.prop_mytitlenew
mycolumns.value = props.prop_mycolumns
colkey.value = props.prop_colkey
pagination.value = props.prop_pagination
@@ -2585,6 +2592,7 @@ export default defineComponent({
visButtRow,
mytable,
mytitle,
mytitlenew,
mycolumns,
colkey,
search,

View File

@@ -485,7 +485,8 @@
showType === costanti.SHOW_MOVEMENTS && tablesel === 'movements'
"
>
<div class="q-pa-xs row items-start q-gutter-xs">
<CSingleMovement :mov="row" />
<!--<div v-if="false" class="q-pa-xs row items-start q-gutter-xs">
<q-card class="my-card text-black">
<q-toolbar
class="bg-primary text-white"
@@ -557,7 +558,7 @@
</div>
</q-card-section>
</q-card>
</div>
</div>-->
</div>
</div>
<template v-slot:loading>
@@ -1312,18 +1313,19 @@
<q-dialog
v-model="newRecordBool"
@hide="hidewindow"
:maximized="$q.screen.lt.sm"
class="dialog_class"
permanent
:maximized="false"
>
<q-card class="dialog_card">
<q-bar dense class="bg-primary text-white">
Aggiungi {{ mytitle }}:
{{t('dialog.insert')}} {{ mytitlenew }}:
<q-space />
<q-btn flat round color="white" icon="close" v-close-popup></q-btn>
</q-bar>
<q-card-section class="inset-shadow">
<div
:class="$q.screen.lt.sm ? `` : `row` + ` text-blue `"
:class="$q.screen.lt.sm ? `` : `` + ` text-blue `"
v-for="col in mycolumns"
:key="col.name"
>

View File

@@ -1,9 +1,9 @@
.myfrom {
.userfrom {
color: red;
font-weight: bold;
}
.myto {
.userto {
color: green;
font-weight: bold;
}

View File

@@ -5,22 +5,29 @@ import { useGlobalStore } from '@store/globalStore'
import { useI18n } from '@/boot/i18n'
import { CMyImgUser } from '@/components/CMyImgUser'
import { CSingleMovement } from '@/components/CSingleMovement'
import { CCurrencyValue } from '@/components/CCurrencyValue'
import { tools } from '@store/Modules/tools'
import { IMovQuery, IMovement } from '@src/model'
import { IMovQuery, IMovVisu, IMovement } from '@src/model'
import { shared_consts } from '@src/common/shared_vuejs'
export default defineComponent({
name: 'CMovements',
components: { CMyImgUser, CCurrencyValue },
components: { CMyImgUser, CCurrencyValue, CSingleMovement },
props: {
numcol: {
type: Number,
required: false,
default: 3
},
username: {
type: String,
required: false,
default: ''
},
},
emits: ['loaded'],
setup(props, { emit }) {
const userStore = useUserStore()
@@ -28,16 +35,60 @@ export default defineComponent({
const globalStore = useGlobalStore()
const { t } = useI18n();
const datastat = ref(<any>{})
const numtransaz = ref(0)
const prectransaz = ref(0)
const tab = ref('tutti')
const mylist = computed(() => {
if (globalStore.datastat)
return globalStore.datastat.last_transactions
else
if (globalStore.datastat || userStore.my.profile) {
let arrtransaz: any = []
if (props.username) {
numtransaz.value = userStore.my.profile.last_my_transactions!.length
arrtransaz = userStore.my.profile.last_my_transactions
} else {
if (globalStore.datastat) {
numtransaz.value = globalStore.datastat.last_transactions!.length
arrtransaz = globalStore.datastat.last_transactions
}
}
if (prectransaz.value !== numtransaz.value) {
emit('loaded', { numtransaz: numtransaz.value })
prectransaz.value = numtransaz.value
}
return arrtransaz
} else
return []
})
const getInviati = computed(() => {
if (props.username && mylist.value) {
const list = mylist.value.filter((rec: IMovVisu) => {
return (props.username && (rec.userfrom && (rec.userfrom.username === props.username)))
})
return list
}
})
const getRicevuti = computed(() => {
if (props.username && mylist.value) {
const list = mylist.value.filter((rec: IMovVisu) => {
return (props.username && (rec.userto && (rec.userto.username === props.username)))
})
return list
}
return []
})
async function mounted() {
numtransaz.value = 0
prectransaz.value = 0
emit('loaded', { numtransaz: 0 })
}
@@ -77,13 +128,18 @@ export default defineComponent({
mounted()
})
return {
userStore,
getInviati,
getRicevuti,
tools,
mylist,
getFromToStr,
t,
navigabyMov,
numtransaz,
tab,
}
}
})

View File

@@ -1,63 +1,74 @@
<template>
<q-list bordered>
<q-item
v-for="(mov, index) in mylist"
:key="mov._id"
:class="[
'm-mb-sm',
{
'background-even': index % 2 === 0,
'background-odd': index % 2 !== 0,
},
]"
clickable
v-ripple
<div v-if="username">
<q-tabs
v-model="tab"
dense
inline-label
class="bg-primary text-white shadow-2"
>
<q-item-section avatar @click="navigabyMov(mov, true)">
<CMyImgUser :mov="mov" :from="true"> </CMyImgUser>
</q-item-section>
<q-tab name="tutti" label="Tutti" />
<q-tab
name="inviati"
:label="t('circuit.inviati') + ' (' + getInviati.length + ')'"
/>
<q-tab
name="ricevuti"
:label="t('circuit.ricevuti') + ' (' + getRicevuti.length + ')'"
/>
</q-tabs>
<q-item-section>
<q-item-label class="causale" v-if="mov.causal">{{
mov.causal
}}</q-item-label>
<q-item-label lines="1">
{{ t('movement.from') }} <span class="myfrom">{{ mov.myfrom }}</span>
</q-item-label>
<q-item-label lines="1">
{{ t('movement.to') }}
<span class="myto">{{ mov.myto }}</span></q-item-label
<q-tab-panels v-model="tab" animated>
<q-tab-panel name="tutti">
<div v-if="mylist.length === 0">
{{ t('circuit.nessun_movimento_inviato') }}
</div>
<c-single-movement
v-for="(mov, index) in mylist"
:key="index"
:index="index"
:mov="mov"
:visu="0"
>
<q-item-label
caption
lines="1"
v-if="mov.circuitfrom"
class="circuit"
>{{ mov.circuitfrom.name }}</q-item-label
</c-single-movement>
</q-tab-panel>
<q-tab-panel name="inviati">
<div v-if="getInviati.length === 0">
{{ t('circuit.nessun_movimento_inviato') }}
</div>
<c-single-movement
v-for="(mov2, index2) in getInviati"
:key="index2"
:index="index2"
:mov="mov2"
:visu="1"
>
<q-item-label
caption
lines="1"
v-if="mov.transactionDate"
class="date"
>{{ tools.getstrDateTime(mov.transactionDate) }}</q-item-label
</c-single-movement>
</q-tab-panel>
<q-tab-panel name="ricevuti">
<div v-if="getRicevuti.length === 0">
{{ t('circuit.nessun_movimento_ricevuto') }}
</div>
<c-single-movement
v-for="(mov3, index3) in getRicevuti"
:key="index3"
:index="index3"
:mov="mov3"
:visu="2"
>
<q-item-label caption lines="1" style="text-align: center">
<CCurrencyValue
:symbol="mov.circuitfrom.symbol"
color="red"
v-model="mov.amount"
:small="true"
label=""
>
</CCurrencyValue
></q-item-label>
</q-item-section>
<q-item-section side @click="navigabyMov(mov, false)">
<CMyImgUser :mov="mov" :from="false"> </CMyImgUser>
</q-item-section>
</q-item>
</c-single-movement>
</q-tab-panel>
</q-tab-panels>
<slot></slot>
<div style="margin-bottom: 50px"></div>
</div>
<q-list v-else bordered>
<c-single-movement
v-for="(mov, index) in mylist"
:key="index"
:index="index"
:mov="mov"
>
</c-single-movement>
</q-list>
</template>

View File

@@ -1,6 +1,7 @@
import { CMyCircuit } from '@/components/CMyCircuit'
import { computed, defineComponent, onMounted, PropType, ref, toRef } from 'vue'
import { computed, defineComponent, onMounted, PropType, ref, toRef, watch } from 'vue'
import { useUserStore } from '@store/UserStore'
import { useGlobalStore } from '@store/globalStore'
import { useCircuitStore } from '@store/CircuitStore'
import { useI18n } from '@/boot/i18n'
import { useQuasar } from 'quasar'
@@ -9,12 +10,14 @@ import { ICircuit, ISearchList, IUserFields } from 'model'
import { shared_consts } from '@/common/shared_vuejs'
import { tools } from '@store/Modules/tools'
import { CUserNonVerif } from '@/components/CUserNonVerif'
import { CMyCircuits } from '@/components/CMyCircuits'
import { CTitleBanner } from '@/components/CTitleBanner'
import { CMovements } from '@/components/CMovements'
import { CSendRISTo } from '@/components/CSendRISTo'
export default defineComponent({
name: 'CMyCircuits',
components: { CMyCircuit, CUserNonVerif },
components: { CMyCircuit, CUserNonVerif, CTitleBanner, CMovements, CSendRISTo },
emits: ['update:modelValue'],
props: {
modelValue: {
@@ -59,12 +62,32 @@ export default defineComponent({
const { t } = useI18n()
const username = ref('')
const visu = ref(0)
const numtransaz = ref(0)
const finishloading = ref(false)
const loadingvalues = ref(false)
const init = ref(false)
const globalStore = useGlobalStore()
const isfinishLoadingSite = computed(() => globalStore.finishLoading)
const filtroutente = ref(<any[]>[])
const nummovTodownload = ref(5)
const listcircuitsfind = computed(() => {
// console.log('list modif')
return updateListCircuit(costanti.FIND_CIRCUIT)
})
const listcircuitsmy = computed(() => {
// console.log('list modif')
return updateListCircuit(costanti.MY_CIRCUITS)
})
const listcircuitsfiltered = computed(() => {
// console.log('list modif')
return updateListCircuit()
return updateListCircuit(visu.value)
})
const myoptions = computed(() => {
@@ -73,7 +96,7 @@ export default defineComponent({
mybutt.push({ label: t('mypages.find_circuit'), value: costanti.FIND_CIRCUIT })
if (numAskSentCircuits.value > 0 || props.modelValue === costanti.ASK_SENT_CIRCUIT)
if (numAskSentCircuits.value > 0 || visu.value === costanti.ASK_SENT_CIRCUIT)
mybutt.push({
label: t('mypages.request_sent') + ' (' + numAskSentCircuits.value + ')',
value: costanti.ASK_SENT_CIRCUIT
@@ -94,28 +117,32 @@ export default defineComponent({
return (arr) ? arr.length : 0
})
async function loadCircuits() {
watch(() => globalStore.finishLoading, async (to: any, from: any) => {
load()
})
async function loadCircuits(nummovTodownload: number) {
// Carica il profilo di quest'utente
if (username.value) {
filtroutente.value = await tools.loadCircuits()
filtroutente.value = await tools.loadCircuits(nummovTodownload)
}
}
function updateListCircuit() {
function updateListCircuit(visu: number) {
let arr: any[] = []
try {
if (props.modelValue === costanti.CIRCUITS) {
if (visu === costanti.CIRCUITS) {
arr = circuitStore.listcircuits
} else if (props.modelValue === costanti.MY_CIRCUITS) {
} else if (visu === costanti.MY_CIRCUITS) {
arr = circuitStore.listcircuits.filter((circ: any) => userStore.my.profile.mycircuits.findIndex((rec: any) => circ.name === rec.circuitname) >= 0)
} else if (props.modelValue === costanti.ASK_SENT_CIRCUIT) {
} else if (visu === costanti.ASK_SENT_CIRCUIT) {
arr = userStore.my.profile.asked_circuits
}
} catch (e) {
arr = []
}
if (props.modelValue === costanti.MY_CIRCUITS) {
if (visu === costanti.MY_CIRCUITS) {
const arrtoinsert: any = circuitStore.listcircuits.filter((circ: any) => circ.showAlways)
for (const rec of arrtoinsert) {
if (arr.findIndex(myrec => myrec._id === rec._id) < 0) {
@@ -129,10 +156,18 @@ export default defineComponent({
}
async function mounted() {
async function load() {
if (init.value)
return // Gia inizializzato
// console.log(' ## INIZIO MOUNT ')
username.value = userStore.my.username
await loadCircuits()
visu.value = props.modelValue
await loadCircuits(nummovTodownload.value)
finishloading.value = true
init.value = true
// console.log(' -- FINE MOUNT ')
}
@@ -140,6 +175,35 @@ export default defineComponent({
emit('update:modelValue', val)
}
function togglevisu() {
if (visu.value !== costanti.FIND_CIRCUIT) {
visu.value = costanti.FIND_CIRCUIT
} else {
visu.value = costanti.MY_CIRCUITS
}
}
function movcaricati(params: any) {
if (params.numtransaz) {
numtransaz.value = params.numtransaz
}
}
function mounted() {
if (globalStore.finishLoading) {
load()
}
}
async function addlastmov() {
nummovTodownload.value += 5
loadingvalues.value = true
await loadCircuits(nummovTodownload.value)
loadingvalues.value = false
}
onMounted(mounted)
return {
@@ -153,6 +217,16 @@ export default defineComponent({
userStore,
circuitStore,
username,
t,
visu,
listcircuitsfind,
listcircuitsmy,
togglevisu,
movcaricati,
numtransaz,
finishloading,
addlastmov,
loadingvalues,
}
}
})

View File

@@ -1,54 +1,116 @@
<template>
<div v-if="tools.isUserOk()">
<q-inner-loading id="spinner" :showing="!finishloading">
<q-spinner-tail size="3em" color="primary" />
</q-inner-loading>
<div v-if="tools.isUserOk() && finishloading">
<div v-if="finder && showfinder" class="q-gutter-sm q-pa-sm q-pb-sm">
<q-btn-toggle
:model-value="modelValue"
@update:model-value="updateValue"
class="my-custom-toggle"
no-caps
rounded
unelevated
push
toggle-color="primary"
color="white"
text-color="primary"
:options="myoptions"
/>
</div>
<div v-if="finder" class="">
<div
v-if="
modelValue === costanti.FIND_CIRCUIT ||
listcircuitsfiltered.length === 0
"
>
<slot></slot>
</div>
<div v-else>
<!--
mycircuits: {{userStore.my.profile.mycircuits}}<br><br>
listcircuitsfiltered: {{listcircuitsfiltered}}
<div class="q-mt-md">
<CSendRISTo></CSendRISTo>
<q-btn label="test" @click="userStore.my.profile.mycircuits = [...userStore.my.profile.mycircuits, {circuitname: 'prova'}]; circuitStore.listcircuits = [...circuitStore.listcircuits, {name: 'prova', path: 'prova'}]"></q-btn>
-->
<q-list>
<CTitleBanner
:class="`q-pa-xs `"
:title="myoptions[0].label"
bgcolor="white"
bgcolor2="lightblue"
:clcolor="`text-indigo`"
:canopen="true"
:small="true"
>
<div v-if="listcircuitsmy.length === 0" class="q-ma-sm q-pa-sm">
{{ t('circuit.nessun_circuito_attivo') }}
</div>
<div v-else style="max-height: 250px; overflow-y: auto">
<span
v-for="(circuit, index) in listcircuitsfiltered"
v-for="(circuit, index) in listcircuitsmy"
:key="index"
class="q-my-sm"
clickable
>
<CMyCircuit :mycircuit="circuit" :visu="modelValue"
:username="username"> </CMyCircuit>
<CMyCircuit
:mycircuit="circuit"
:visu="visu"
:username="username"
>
</CMyCircuit>
</span>
</q-list>
</div>
</CTitleBanner>
<CTitleBanner
:class="`q-pa-xs `"
:title="t('circuit.tuoi_ultimi_movimenti', { num: numtransaz })"
bgcolor="white"
bgcolor2="lightblue"
:clcolor="`text-indigo`"
:canopen="true"
:small="true"
:open="false"
>
<CMovements @loaded="movcaricati" :username="username">
<div class="row justify-center"><q-btn
rounded
dense
class="text-center"
color="primary"
:label="t('circuit.show_next_mov')"
@click="addlastmov()"
/>
</div>
</CMovements>
<q-inner-loading id="spinner" :showing="loadingvalues">
<q-spinner-tail size="3em" color="primary" />
</q-inner-loading>
<br />
</CTitleBanner>
<div class="row justify-center">
<q-btn
rounded
toggle-color="primary"
:label="
visu === costanti.MY_CIRCUITS
? t('circuit.find_others_circuit')
: t('circuit.hide_others_circuit')
"
@click="togglevisu()"
/>
</div>
<CTitleBanner
v-if="visu === costanti.FIND_CIRCUIT"
:class="`q-pa-xs `"
:title="t('circuit.circuiti_territoriali')"
bgcolor="bg-primary"
:clcolor="`text-white`"
:canopen="true"
:small="true"
>
<div>
<span
v-for="(circuit, index) in listcircuitsfind"
:key="index"
class="q-my-sm"
clickable
>
<CMyCircuit
:mycircuit="circuit"
:visu="visu"
:username="username"
>
</CMyCircuit>
</span>
</div>
</CTitleBanner>
</div>
<div v-if="visu === costanti.FIND_CIRCUIT">
<slot></slot>
</div>
</div>
<div v-else>
<q-list class="width-container">
<span class="q-my-sm" clickable>
<CMyCircuit :mycircuit="mycircuit" :visu="visu" :username="username"> </CMyCircuit>
<CMyCircuit :mycircuit="mycircuit" :visu="visu" :username="username">
</CMyCircuit>
</span>
</q-list>
</div>
@@ -56,6 +118,17 @@
<div v-else>
<CUserNonVerif></CUserNonVerif>
</div>
<CTitleBanner
v-if="visu === costanti.FIND_CIRCUIT"
:class="`q-pa-xs `"
:title="myoptions[0].label"
bgcolor="bg-primary"
:clcolor="`text-white`"
:canopen="true"
:small="true"
>
</CTitleBanner>
</template>
<script lang="ts" src="./CMyCircuits.ts">

View File

@@ -35,7 +35,7 @@
<q-item-label>
<q-btn
v-if="circuitname"
icon="fas fa-coins"
icon-right="img: images/1ris_rosso_100.png"
color="green"
size="md"
dense
@@ -125,7 +125,7 @@
@click="showsendCoinTo = true"
>
<q-item-section avatar>
<q-icon color="positive" name="fas fa-coins" />
<q-icon color="positive" name="img: images/1ris_rosso_100.png" />
</q-item-section>
<q-item-section>{{
$t('circuit.sendcoins')
@@ -378,7 +378,7 @@
@click="showsendCoinTo = true"
>
<q-item-section avatar>
<q-icon color="positive" name="fas fa-coins" />
<q-icon color="positive" name="img: images/1ris_rosso_100.png" />
</q-item-section>
<q-item-section>{{
$t('circuit.sendcoins')
@@ -552,7 +552,7 @@
"
>
<q-item-section avatar>
<q-icon color="positive" name="fas fa-coins" />
<q-icon color="positive" name="img: images/1ris_rosso_100.png" />
</q-item-section>
<q-item-section>
{{ $t('circuit.enablefido') }}

View File

@@ -203,7 +203,7 @@ export default defineComponent({
watch(() => indstep.value, (newval: number, oldval: number) => {
if (indstep.value >= 0)
if (indstep.value >= 0 && arrStep.value.length >indstep.value && arrStep.value[indstep.value])
step.value = arrStep.value[indstep.value].step
else
step.value = 0

View File

@@ -12,11 +12,6 @@
}
.actualdate{
}
.cardrec {
/* Aggiungi un bordo sottile */

View File

@@ -44,7 +44,7 @@ export default defineComponent({
const userStore = useUserStore()
const calendarStore = useCalendarStore()
const globalStore = useGlobalStore()
// const $q = useQuasar()
const $q = useQuasar()
const { t } = useI18n()
const $router = useRouter()
@@ -109,6 +109,11 @@ export default defineComponent({
return (props.table === shared_consts.TABLES_MYBACHECAS && calendarStore.isPartecipero(myrec.value._id, props.table))
}
function computedWidth() {
const width = tools.getwidth($q) - 20;
return `${Math.min(width, 600)}px`; // Limita la larghezza massima a 600px
}
onMounted(mounted)
return {
@@ -132,6 +137,7 @@ export default defineComponent({
calendarStore,
disabilita,
globalStore,
computedWidth,
}
},
})

View File

@@ -1,15 +1,9 @@
<!--suppress ALL -->
<template>
<div
class="q-py-xs centermydiv cardrec"
:style="
`max-width: ` +
(tools.getwidth($q) - 20) +
`px; ` +
($q.screen.lt.sm
? `min-width: ` + (tools.getwidth($q) - (20 + margin_right)) + `px;`
: ``)
"
:style="{ maxWidth: computedWidth }"
>
<div v-if="myrec && table === shared_consts.TABLES_MYBACHECAS">
<div class="row">

View File

@@ -425,7 +425,7 @@
@click="naviga(`/my/` + contact.username + '?sendris=0')"
>
<q-item-section avatar>
<q-icon color="positive" name="fas fa-coins" />
<q-icon color="positive" name="img: images/1ris_rosso_100.png" />
</q-item-section>
<q-item-section>{{ $t('circuit.sendcoins') }}</q-item-section>
</q-item>
@@ -454,7 +454,7 @@
"
>
<q-item-section avatar>
<q-icon color="positive" name="fas fa-coins" />
<q-icon color="positive" name="img: images/1ris_rosso_100.png" />
</q-item-section>
<q-item-section>
{{ $t('circuit.enablefido') }}
@@ -814,7 +814,7 @@
@click="naviga(`/my/` + contact.username + '?sendris=0')"
>
<q-item-section avatar>
<q-icon color="positive" name="fas fa-coins" />
<q-icon color="positive" name="img: images/1ris_rosso_100.png" />
</q-item-section>
<q-item-section>{{ $t('circuit.sendcoins') }}</q-item-section>
</q-item>

View File

@@ -38,6 +38,8 @@ export default defineComponent({
const lasts_notifs_req = computed(() => notifStore.getnotifs_coinsreq())
const num_notifs = computed(() => lasts_notifs_req.value.length)
const hide = ref(false)
watch(() => num_notifs.value, (newval, oldval) => {
if (num_notifs.value === 1)
shownotif.value = true
@@ -81,6 +83,7 @@ export default defineComponent({
clickNotif,
userStore,
shownotif,
hide,
}
},
})

View File

@@ -1,17 +1,17 @@
<template>
<div class="q-ma-sm text-center">
<div v-if="!hide && num_notifs > 0" class="q-ma-sm text-center">
<q-btn
v-if="num_notifs > 0"
:label="
num_notifs > 1
? t('circuit.mov_in_arrivo', { mov: num_notifs })
: t('circuit.ris_in_arrivo')
"
@click="shownotif = true"
icon="fas fa-coins"
icon-right="img: images/1ris_rosso_100.png"
rounded
color="positive"
></q-btn>
<q-btn flat round icon="close" @click="hide = true"></q-btn>
</div>
<q-dialog v-model="shownotif" :maximized="$q.screen.lt.sm">
@@ -64,7 +64,7 @@
<div class="row no-wrap justify-evenly q-pa-sm">
<q-btn
size="md"
icon="fas fa-coins"
icon-right="img: images/1ris_rosso_100.png"
:disable="notif.disablecoinclick"
color="positive"
:label="

View File

@@ -16,10 +16,10 @@
"
>
</CCurrencyValue>
<!--:tips="t('account.saldo_tips', { fido: qtarem, symbol })"-->
<CCurrencyValue
v-else
:symbol="symbol"
:tips="t('account.saldo_tips', { fido: qtarem, symbol })"
:strfido="t('account.fido_casa', { fido: account ? account.fidoConcesso : '', symbol })"
:color="color"
v-model="saldo"

View File

@@ -329,6 +329,7 @@ export default defineComponent({
function hide() {
emit('close', true)
showpage.value = false
}
function sendCoin() {
@@ -455,6 +456,7 @@ export default defineComponent({
function clickIndietro(actualstep: number) {
if (actualstep === 1) {
step.value = 0
hide()
} else if (actualstep === 2) {
step.value = 1
} else if (actualstep === 0) {

View File

@@ -223,7 +223,7 @@
</div>
</template>
</q-input>
<div v-if="$q.platform.is.mobile" class="q-mt-md">
<div class="q-mt-md">
<CNumericKeyboard v-model="qty" :showInput="false" />
</div>
</div>
@@ -265,6 +265,8 @@
v-model="causal"
type="textarea"
filled
maxlength="500"
counter
:label="$t('circuit.note')"
class="q-my-sm full-width"
>
@@ -313,7 +315,7 @@
})
"
color="positive"
:icon="
:icon-right="
step === 2 ? 'img: images/1ris_rosso_100.png' : 'navigate_next'
"
@click="clickAvanti(step)"

View File

@@ -0,0 +1,6 @@
.my-custom-border {
border: 1px solid #ccc; /* Imposta il colore del bordo (puoi personalizzare) */
background-color: #fff; /* Colore sfondo per il contenitore (puoi personalizzare) */
border-radius: 10px;
}

View File

@@ -11,7 +11,10 @@ import { shared_consts } from '@src/common/shared_vuejs'
import { costanti, IMainCard } from '@store/Modules/costanti'
import { CMyUser } from '../CMyUser'
import { CTitleBanner } from '../CTitleBanner'
import { CMyGroup } from '../CMyGroup'
import { CCopyBtn } from '../CCopyBtn'
import { CContactUser } from '../CContactUser'
import { CUserInfoAccount } from '../CUserInfoAccount'
import { tools } from '@store/Modules/tools'
import { useQuasar } from 'quasar'
@@ -19,7 +22,10 @@ import { useQuasar } from 'quasar'
export default defineComponent({
name: 'CSendRISTo',
props: {},
components: { CMyUser, CMyGroup, CUserInfoAccount },
components: {
CMyUser, CMyGroup, CUserInfoAccount, CCopyBtn,
CTitleBanner, CContactUser
},
setup(props) {
const userStore = useUserStore()
@@ -36,6 +42,9 @@ export default defineComponent({
const tipoConto = ref(shared_consts.AccountType.USER)
const loading = ref(false)
const miolink = ref('')
const sendRIS = ref(false)
const riceviRIS = ref(false)
const circuitpath = computed(() => {
const circ = circuitStore.getCircuitByProvinceAndCard(userStore.my.profile.resid_province, userStore.my.profile.resid_card)
return circ && circ.path ? circ.path : ''
@@ -80,6 +89,12 @@ export default defineComponent({
loading.value = false
}
function clickRiceviRIS() {
miolink.value = 'my/'
riceviRIS.value = true
}
return {
userStore,
tools,
@@ -95,6 +110,10 @@ export default defineComponent({
loading,
contact,
circuitpath,
sendRIS,
riceviRIS,
miolink,
clickRiceviRIS,
}
},
})

View File

@@ -4,16 +4,6 @@
class="row text-center justify-evenly items-center"
>
<div class="q-mb-sm">
<q-btn
icon="fas fa-download"
color="accent"
size="md"
rounded
:label="$t('circuit.receive_coins')"
@click="tools.receiveRis($q, $t)"
>
</q-btn>
&nbsp;
<q-btn
icon="fas fa-upload"
color="positive"
@@ -23,14 +13,40 @@
@click="sendCoinsToClick"
>
</q-btn>
<div class="q-mb-sm"></div>
&nbsp;
<q-btn
icon="fas fa-download"
color="accent"
size="md"
rounded
:label="$t('circuit.receive_coins')"
@click="clickRiceviRIS"
>
</q-btn>
<CTitleBanner
v-if="riceviRIS"
:class="`q-pa-xs `"
:title="$t('circuit.receive_coins')"
bgcolor="white"
bgcolor2="lightblue"
:clcolor="`text-indigo`"
:canopen="true"
:small="true"
:open="true"
>
<CCopyBtn :title="$t('reg.click_per_copiare')" :texttocopy="miolink">
</CCopyBtn>
</CTitleBanner>
<!--<div class="q-mb-sm"></div>
<CUserInfoAccount
:user="contact"
:circuitpath="circuitpath"
:admin="false"
:onlysaldo="true"
/>
/>-->
</div>
</div>
<q-dialog v-model="usersList.show">
@@ -77,12 +93,19 @@
<div v-if="tipoConto === shared_consts.AccountType.USER">
<div v-for="(rec, i) in usersList.list" :key="i">
<CMyUser
:mycontact="rec"
:visu="costanti.FIND_PEOPLE"
@setCmd="tools.setCmd"
>
</CMyUser>
<div class="q-pa-xs q-ma-xs q-border q-rounded my-custom-border">
<CMyUser
:mycontact="rec"
:visu="costanti.FIND_PEOPLE"
@setCmd="tools.setCmd"
>
</CMyUser>
<CContactUser
:myuser="rec"
:showBtnActivities="false"
:sendRIS="tools.isUserOk() ? sendRIS : false"
/>
</div>
</div>
</div>
<div

View File

@@ -0,0 +1,53 @@
.userfrom {
color: red;
}
.userto {
color: green;
}
.circuit {
color: blue;
}
.date {
color: gray;
}
.rigamov {
background-color: lightgray;
}
.causale {
margin-bottom: 8px;
}
.userto,
.userfrom {
white-space: pre-wrap;
/* Impedisce il wrapping del testo */
}
.q-item-section.d-flex {
display: flex;
align-items: center;
/* Allinea gli elementi al centro verticalmente */
}
.q-item__section--main ~ .q-item__section--side{
padding-left: 2px !important;
}
.q-item__section--side{
padding-right: 4px !important;
}
.schede-mov{
margin-top: 2px;
margin-bottom: 2px;
padding-top: 2px;
padding-bottom: 2px;
border: solid 1px blue;
border-radius: 20px;
}

View File

@@ -0,0 +1,92 @@
import { defineComponent, ref, computed, PropType, toRef, onMounted } from 'vue'
import { useUserStore } from '@store/UserStore'
import { useRouter } from 'vue-router'
import { useGlobalStore } from '@store/globalStore'
import { useI18n } from '@/boot/i18n'
import { CMyImgUser } from '@/components/CMyImgUser'
import { CCurrencyValue } from '@/components/CCurrencyValue'
import { tools } from '@store/Modules/tools'
import { IMovQuery, IMovement } from '@src/model'
import { shared_consts } from '@src/common/shared_vuejs'
export default defineComponent({
name: 'CSingleMovement',
components: { CMyImgUser, CCurrencyValue },
props: {
mov: {
type: Object as PropType<IMovement>,
required: true,
},
index: {
type: Number,
required: true,
},
visu: {
type: Number,
required: false,
default: 0,
}
},
setup(props, { emit }) {
const userStore = useUserStore()
const $router = useRouter()
const globalStore = useGlobalStore()
const { t } = useI18n();
function getFromToStr(mov: any) {
let mystr = ''
if (mov) {
mystr += mov.str
}
return mystr
}
function navigabyMov(mov: IMovQuery, from: boolean) {
let link = ''
if (from) {
if (mov.tipocontofrom === shared_consts.AccountType.USER) {
link = `/my/` + mov.userfrom.username
} else if (mov.tipocontofrom === shared_consts.AccountType.COLLECTIVE_ACCOUNT) {
link = tools.getPathByGroup(mov.groupfrom)
} else if (mov.tipocontofrom === shared_consts.AccountType.COMMUNITY_ACCOUNT) {
link = '' // mov.contocomfrom.name
}
} else {
if (mov.tipocontoto === shared_consts.AccountType.USER) {
link = `/my/` + mov.userto.username
} else if (mov.tipocontoto === shared_consts.AccountType.COLLECTIVE_ACCOUNT) {
link = tools.getPathByGroup(mov.groupto)
} else if (mov.tipocontoto === shared_consts.AccountType.COMMUNITY_ACCOUNT) {
link = ''
}
}
$router.push(link)
}
function getUsername(user: any) {
if (user && user.username) {
return user.username
}
return user
}
onMounted(() => {
})
return {
userStore,
tools,
getFromToStr,
t,
navigabyMov,
getUsername,
}
}
})

View File

@@ -0,0 +1,73 @@
<template>
<q-item
v-if="mov"
:class="[
'm-mb-sm',
'schede-mov',
{
'background-even': index % 2 === 0,
'background-odd': index % 2 !== 0,
},
]"
clickable
v-ripple
>
<q-item-section v-if="visu !== 1" avatar @click="navigabyMov(mov, true)">
<CMyImgUser :mov="mov" :from="true"> </CMyImgUser>
</q-item-section>
<q-item-section v-else side @click="navigabyMov(mov, false)">
<CMyImgUser :mov="mov" :from="false"> </CMyImgUser>
<CCurrencyValue
:symbol="mov.circuitfrom.symbol"
color="red"
v-model="mov.amount"
:small="true"
label=""
>
</CCurrencyValue>
</q-item-section>
<q-item-section>
<q-item-label class="causale" v-if="mov.causal">{{
mov.causal
}}</q-item-label>
<q-item-label v-if="visu !== 1" lines="3">
{{ t('movement.from') }}
<span class="userfrom">{{
tools.getUsernameOrGroupOrContoComByMov(mov, true)
}}</span>
</q-item-label>
<q-item-label v-if="visu !== 2" lines="3">
{{ t('movement.to') }}
<span class="userto">{{
tools.getUsernameOrGroupOrContoComByMov(mov, false)
}}</span></q-item-label
>
<q-item-label caption lines="1" v-if="mov.circuitfrom" class="circuit">{{
mov.circuitfrom.name
}}</q-item-label>
<q-item-label caption lines="1" v-if="mov.transactionDate" class="date">{{
tools.getstrDateTime(mov.transactionDate)
}}</q-item-label>
</q-item-section>
<q-item-section v-if="visu === 0" side @click="navigabyMov(mov, false)">
<CMyImgUser :mov="mov" :from="false"> </CMyImgUser>
<CCurrencyValue
:symbol="mov.circuitfrom.symbol"
color="red"
v-model="mov.amount"
:small="true"
label=""
>
</CCurrencyValue>
</q-item-section>
</q-item>
</template>
<script lang="ts" src="./CSingleMovement.ts">
</script>
<style lang="scss" scoped>
@import './CSingleMovement.scss';
</style>

View File

@@ -0,0 +1 @@
export { default as CSingleMovement } from './CSingleMovement.vue'

View File

@@ -5,5 +5,10 @@
.nonvisibile{
border-radius: 16px;
border: red solid 3px;
border: rgba(0, 0, 255, 0.432);
padding: 4px;
}
.q-banner--dense {
padding: 4px;
}

View File

@@ -1,4 +1,5 @@
import { defineComponent, ref } from 'vue'
import { defineComponent, onMounted, ref } from 'vue'
import { tools } from '@src/store/Modules/tools'
export default defineComponent({
name: 'CTitleBanner',
@@ -12,6 +13,16 @@ export default defineComponent({
required: false,
default: 'bg-primary',
},
bgcolor2: {
type: String,
required: false,
default: '',
},
bgcolor3: {
type: String,
required: false,
default: '',
},
clcolor: {
type: String,
required: false,
@@ -56,12 +67,18 @@ export default defineComponent({
type: Boolean,
required: false,
default: false,
}
},
small: {
type: Boolean,
required: false,
default: false,
},
},
components: {},
emits: ['apri'],
setup(props, { emit }) {
const myvisible = ref(false)
const gradient = ref('')
function created() {
myvisible.value = props.visible
@@ -89,13 +106,21 @@ export default defineComponent({
return 'nonvisibile glossy'
}
function mounted() {
gradient.value = tools.getGradientByColors(props.bgcolor, props.bgcolor2, props.bgcolor3)
}
created()
onMounted(mounted)
return {
myvisible,
iconopen,
apri,
getclass,
gradient,
}
},
})

View File

@@ -14,7 +14,7 @@
' ' +
getclass()
"
style="text-align: center"
:style="`text-align: center; `"
@click="apri()"
>
<template v-slot:avatar>
@@ -25,7 +25,7 @@
<q-icon v-if="canopen" :name="iconopen()" color="white" />
</div>
</template>
<span :class="`mybanner ` + myclasstext" :style="mystyle">{{
<span :class="{'mybanner': !small, 'mybanner-small': small, myclasstext: true}" :style="mystyle">{{
title
}}</span>
</q-banner>
@@ -44,7 +44,7 @@
' ' +
getclass()
"
style="text-align: center"
:style="`text-align: center ; ${gradient}`"
@click="apri()"
>
<template v-slot:avatar>
@@ -55,7 +55,7 @@
<q-icon v-if="canopen" :name="iconopen()" color="white" />
</div>
</template>
<span :class="`mybanner ` + myclasstext" :style="mystyle">{{
<span :class="{'mybanner': !small, 'mybanner-small': small, myclasstext: true}" :style="mystyle">{{
title
}}</span>
</q-banner>

View File

@@ -12,9 +12,7 @@
<span v-if="!table" class="mybanner">{{ mytitle }}</span>
</q-banner>
</div>
<div
v-else
>
<div v-else>
<CBarSelection
v-if="showBarSelection"
:myicon="myicon"
@@ -27,6 +25,9 @@
>
<slot />
</CBarSelection>
<div v-else>
<slot />
</div>
</div>
</template>

View File

@@ -33,4 +33,16 @@
/* Centra il testo sotto l'immagine */
font-size: 0.9rem;
/* Dimensione del testo */
}
.iconbig {
font-size: 1.4em !important;
}
.img_in_tab{
width: 52px;
height: 52px;
margin: 4px !important;
}

View File

@@ -7,7 +7,7 @@ import { tools } from '@store/Modules/tools'
import { shared_consts } from '@src/common/shared_vuejs'
import { useI18n } from '@src/boot/i18n'
import { useRouter } from 'vue-router'
import { useRouter, useRoute } from 'vue-router'
import { static_data } from '@/db/static_data'
import { useGlobalStore } from '@store/globalStore'
import { useUserStore } from '@store/UserStore'
@@ -23,6 +23,7 @@ export default defineComponent({
const $q = useQuasar()
const { t } = useI18n()
const $router = useRouter()
const $route = useRoute()
const userStore = useUserStore()
const globalStore = useGlobalStore()
@@ -32,10 +33,16 @@ export default defineComponent({
const { getMyUsername, Username, getMyImg } = MixinUsers()
const currentPath = computed(() => $route.path); // Uso di computed per la reattività
function mounted() {
// mounted
}
function naviga(path: string) {
$router.push(path)
}
onMounted(mounted)
return {
@@ -47,6 +54,8 @@ export default defineComponent({
tools,
site,
getMyImg,
naviga,
currentPath,
}
},

View File

@@ -15,7 +15,8 @@
"
style="padding: 0px !important"
content-class="mysmalltabs"
:active-color="$q.dark.isActive ? `primary` : `primary`"
active-color="white"
active-bg-color="blue"
no-caps
indicator-color="transparent"
>
@@ -40,13 +41,15 @@
to="/events"
icon="fas fa-calendar-week"
/>
<q-route-tab
<q-img
v-if="site.confpages.showViewCircuits"
class="mylabfooter"
:label="$t('tabdown.circuits')"
:to="tools.updateLink('/circuits')"
icon="img: images/1ris_rosso_100.png"
/>
src="images/1ris_rosso_100.png"
round
flat
:style="currentPath === '/circuits' ? `background-color: lightblue`: ''"
class="img_in_tab"
@click="naviga(tools.updateLink('/circuits'))"
></q-img>
<q-route-tab
v-if="site.confpages.showViewUsers"
class="mylabfooter"