- Add saldo to member's list

This commit is contained in:
paoloar77
2022-11-06 13:38:38 +01:00
parent 5a3205ebda
commit 3302d9c23e
21 changed files with 270 additions and 66 deletions

View File

@@ -49,13 +49,13 @@ export default defineComponent({
const path = computed(() => $route.params.path ? $route.params.path.toString() : '')
const idnotif = computed(() => $route.query.idnotif ? $route.query.idnotif.toString() : '')
const filtroutente = ref(<any[]>[])
const filtroutente = ref([] as any[])
const showPic = ref(false)
const circuit = ref(<ICircuit | null>{})
const circuit = ref({} as ICircuit | null)
const account = computed(() => circuit.value ? userStore.getAccountByCircuitId(circuit.value._id) : null)
const mystatus = ref(<number>0)
const users_in_circuit = ref(<IFriends[]>[])
const mystatus = ref(0 as number)
const users_in_circuit = ref([] as IFriends[])
const qtarem = computed(() => account.value ? circuitStore.getRemainingCoinsToSend(account.value) : 0)
const saldo = computed(() => account.value ? account.value.saldo : 0)
@@ -69,11 +69,12 @@ export default defineComponent({
const tab = ref('membri')
const arrfilterand: any = ref([])
const filterextra: any = ref([])
const filtercustom: any = ref([])
const filtercustom_rich: any = ref([])
const searchList = ref(<ISearchList[]>[])
const searchList = ref([] as ISearchList[])
const cities = ref(<ICity[]>[])
const cities = ref([] as ICity[])
watch(() => path.value, (to: any, from: any) => {
loadCircuit()
@@ -105,8 +106,8 @@ export default defineComponent({
searchList.value = []
if (circuit.value) {
filtercustom.value = [
{
filterextra.value = [
/*{
'profile.mycircuits':
{
$elemMatch: {
@@ -115,6 +116,71 @@ export default defineComponent({
}
}
},
*/
{
$match: {idapp: process.env.APP_ID,
'profile.mycircuits': {
$elemMatch: {circuitname: {$eq: circuit.value.name}},
},
},
},
{
$lookup: {
from: 'circuits',
as: 'circuit',
let: {circuitname: circuit.value.name, idapp: '$idapp'},
pipeline: [
{
$match:
{
$expr:
{
$and:
[
{$eq: ['$name', '$$circuitname']},
{$eq: ['$idapp', '$$idapp']},
],
},
},
},
],
},
},
{ $unwind: '$circuit'},
{
$project: { username: 1, profile: 1, idapp: 1, 'circuit.name': 1, 'circuit._id': 1 }
},
{
$lookup: {
from: 'accounts',
as: 'account',
let: {username: '$username', idapp: '$idapp', circuitId: '$circuit._id'},
pipeline: [
{
$match:
{
$expr:
{
$and:
[
{$eq: ['$$username', '$username']},
{$eq: ['$$idapp', '$idapp']},
{$eq: ['$$circuitId', '$circuitId']},
],
},
},
},
],
},
},
{ $unwind: '$account'},
]
}
arrfilterand.value = []
@@ -139,17 +205,17 @@ export default defineComponent({
}
function checkifShow(col: string) {
//++Todo: checkifShow Permessi !
// ++Todo: checkifShow Permessi !
return true
}
function extraparams() {
let lk_tab = 'users'
let lk_LF = 'userId'
let lk_FF = '_id'
let lk_as = 'user'
let af_objId_tab = 'myId'
const lk_tab = 'users'
const lk_LF = 'userId'
const lk_FF = '_id'
const lk_as = 'user'
const af_objId_tab = 'myId'
return {
lookup1: {
@@ -232,6 +298,7 @@ export default defineComponent({
t,
animation,
arrfilterand,
filterextra,
filtercustom,
filtercustom_rich,
searchList,

View File

@@ -132,6 +132,7 @@
noresultLabel="movimenti non trovati con questa ricerca"
:arrfilters="arrfilterand"
:filtercustom="filtercustom_rich"
:filterextra="filterextra"
:prop_searchList="searchList"
:prop_pagination="{ sortBy: 'transactionDate', descending: true, page: 1, rowsNumber: 20, rowsPerPage: 20 }"
:showType="costanti.SHOW_MOVEMENTS"
@@ -373,6 +374,7 @@
noresultLabel="Username non trovato"
:arrfilters="arrfilterand"
:filtercustom="filtercustom"
:filterextra="filterextra"
:prop_searchList="searchList"
:showType="costanti.SHOW_USERINFO"
:showCol="false"
@@ -403,6 +405,7 @@
:butt_modif_new="false"
noresultLabel="Username non trovato"
:arrfilters="arrfilterand"
:filterextra="filterextra"
:filtercustom="filtercustom_rich"
:prop_searchList="searchList"
:showType="costanti.SHOW_USERINFO"
@@ -435,6 +438,7 @@
noresultLabel="Username non trovato"
:arrfilters="arrfilterand"
:filtercustom="filtercustom_rich"
:filterextra="filterextra"
:prop_searchList="searchList"
:showType="costanti.SHOW_USERINFO"
keyMain=""