2025-10-11 18:36:04 +02:00
|
|
|
import { CGridTableRec } from '@src/components/CGridTableRec';
|
|
|
|
|
import { CMyFriends } from '@src/components/CMyFriends';
|
|
|
|
|
import { CMyUser } from '@src/components/CMyUser';
|
|
|
|
|
import { CTitleBanner } from '@src/components/CTitleBanner';
|
|
|
|
|
import { CProfile } from '@src/components/CProfile';
|
|
|
|
|
import { CCheckIfIsLogged } from '@src/components/CCheckIfIsLogged';
|
|
|
|
|
import { CMyFieldRec } from '@src/components/CMyFieldRec';
|
|
|
|
|
import { CCurrencyValue } from '@src/components/CCurrencyValue';
|
|
|
|
|
import { CSaldo } from '@src/components/CSaldo';
|
|
|
|
|
import { CSendCoins } from '@src/components/CSendCoins';
|
|
|
|
|
import { CUserNonVerif } from '@src/components/CUserNonVerif';
|
|
|
|
|
import { CTitleSec } from '@src/components/CTitleSec';
|
|
|
|
|
import { CSkill } from '@src/components/CSkill';
|
|
|
|
|
import { CFinder } from '@src/components/CFinder';
|
|
|
|
|
import { CDateTime } from '@src/components/CDateTime';
|
|
|
|
|
import { tools } from '@tools';
|
|
|
|
|
import { computed, defineComponent, onMounted, ref, watch } from 'vue';
|
|
|
|
|
import { useUserStore } from '@store/UserStore';
|
|
|
|
|
import { useRoute, useRouter } from 'vue-router';
|
|
|
|
|
import { useGlobalStore } from '@store/globalStore';
|
|
|
|
|
import { useI18n } from 'vue-i18n';
|
|
|
|
|
import { toolsext } from '@store/Modules/toolsext';
|
|
|
|
|
import { useQuasar } from 'quasar';
|
|
|
|
|
import { CNotifAtTop } from '@src/components/CNotifAtTop';
|
|
|
|
|
import { costanti } from '@costanti';
|
2025-03-01 14:14:43 +01:00
|
|
|
import type { ICity, IFriends, ICircuit, ISearchList, IAccount, IMyGroup } from 'model';
|
2025-10-11 18:36:04 +02:00
|
|
|
import { IUserFields } from 'model';
|
|
|
|
|
import { shared_consts } from '@src/common/shared_vuejs';
|
|
|
|
|
import {
|
|
|
|
|
colmyUserPeople,
|
|
|
|
|
colmyUserPeopleSaldi,
|
|
|
|
|
colmyUserCircuit,
|
|
|
|
|
colmyMovement,
|
|
|
|
|
colmyMovementTable,
|
|
|
|
|
colmyUserGroup,
|
|
|
|
|
} from '@store/Modules/fieldsTable';
|
|
|
|
|
import { useNotifStore } from '@store/NotifStore';
|
|
|
|
|
import { useCircuitStore } from '@store/CircuitStore';
|
2022-08-26 03:32:50 +02:00
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
|
name: 'mycircuit',
|
2022-09-18 19:45:26 +02:00
|
|
|
components: {
|
2025-10-11 18:36:04 +02:00
|
|
|
CProfile,
|
|
|
|
|
CTitleBanner,
|
|
|
|
|
CMyFieldRec,
|
|
|
|
|
CSkill,
|
|
|
|
|
CTitleSec,
|
|
|
|
|
CDateTime,
|
|
|
|
|
CMyFriends,
|
|
|
|
|
CGridTableRec,
|
|
|
|
|
CMyUser,
|
|
|
|
|
CCheckIfIsLogged,
|
|
|
|
|
CCurrencyValue,
|
|
|
|
|
CSaldo,
|
|
|
|
|
CNotifAtTop,
|
|
|
|
|
CSendCoins,
|
|
|
|
|
CUserNonVerif,
|
|
|
|
|
CFinder,
|
2022-09-18 19:45:26 +02:00
|
|
|
},
|
2022-08-26 03:32:50 +02:00
|
|
|
props: {},
|
|
|
|
|
setup() {
|
2025-10-11 18:36:04 +02:00
|
|
|
const userStore = useUserStore();
|
|
|
|
|
const globalStore = useGlobalStore();
|
|
|
|
|
const notifStore = useNotifStore();
|
|
|
|
|
const circuitStore = useCircuitStore();
|
|
|
|
|
const $route = useRoute();
|
|
|
|
|
const $q = useQuasar();
|
|
|
|
|
const { t } = useI18n();
|
|
|
|
|
|
|
|
|
|
const showwhommov = ref(1);
|
2023-11-30 01:48:29 +01:00
|
|
|
const optionsmov = [
|
|
|
|
|
{ label: t('movement.onlymymov'), value: 1 },
|
|
|
|
|
{ label: t('movement.allmov'), value: 2 },
|
2025-10-11 18:36:04 +02:00
|
|
|
];
|
|
|
|
|
const tabellare = ref(false);
|
|
|
|
|
const groupsListAdmin = ref(<IMyGroup[]>[]);
|
|
|
|
|
const groupnameSel = ref(<any>null);
|
2022-09-16 19:38:57 +02:00
|
|
|
|
2025-10-11 18:36:04 +02:00
|
|
|
const showsendCoinTo = ref(false);
|
|
|
|
|
const showrules = ref(false);
|
|
|
|
|
const showMov = ref(false);
|
2023-02-01 01:19:58 +01:00
|
|
|
|
2025-10-11 18:36:04 +02:00
|
|
|
const animation = ref('fade');
|
2022-08-26 03:32:50 +02:00
|
|
|
|
2025-10-11 18:36:04 +02:00
|
|
|
const path = computed(() =>
|
|
|
|
|
$route.params.path ? $route.params.path.toString() : ''
|
|
|
|
|
);
|
|
|
|
|
const idnotif = computed(() =>
|
|
|
|
|
$route.query.idnotif ? $route.query.idnotif.toString() : ''
|
|
|
|
|
);
|
2022-08-26 03:32:50 +02:00
|
|
|
|
2025-10-11 18:36:04 +02:00
|
|
|
const circuitpath_loaded = ref('');
|
2023-10-01 01:24:55 +02:00
|
|
|
|
2025-10-11 18:36:04 +02:00
|
|
|
const filtroutente = ref([] as any[]);
|
|
|
|
|
const showPic = ref(false);
|
|
|
|
|
const loadSaldo = ref(false);
|
2022-08-26 03:32:50 +02:00
|
|
|
|
2025-10-11 18:36:04 +02:00
|
|
|
const card = ref(<any>{});
|
2025-01-15 15:39:58 +01:00
|
|
|
|
2025-10-11 18:36:04 +02:00
|
|
|
const circuit = ref(<ICircuit | undefined>undefined);
|
|
|
|
|
const account = ref(<IAccount | null>null);
|
|
|
|
|
const mystatus = ref(0 as number);
|
|
|
|
|
const users_in_circuit = ref([] as IFriends[]);
|
2022-08-26 03:32:50 +02:00
|
|
|
|
2025-10-11 18:36:04 +02:00
|
|
|
const qtarem = ref(0);
|
|
|
|
|
const saldo = ref(0);
|
|
|
|
|
const saldo_pend = ref(0);
|
2022-09-14 11:31:48 +02:00
|
|
|
|
2025-10-11 18:36:04 +02:00
|
|
|
const loading = ref(false);
|
|
|
|
|
const requestToEnterCircuit = ref(false);
|
2022-08-26 03:32:50 +02:00
|
|
|
|
2025-10-11 18:36:04 +02:00
|
|
|
const tabcircuit = ref('info');
|
|
|
|
|
const tabmembers = ref('all');
|
|
|
|
|
const showsaldi = ref(false);
|
|
|
|
|
const tab = ref('membri');
|
2022-08-26 03:32:50 +02:00
|
|
|
|
2025-10-11 18:36:04 +02:00
|
|
|
const arrfilterand: any = ref([]);
|
|
|
|
|
const filterextra: any = ref([]);
|
|
|
|
|
const filterextra_group: any = ref([]);
|
|
|
|
|
const filterextra2: any = ref([]);
|
|
|
|
|
const filtercustom: any = ref([]);
|
|
|
|
|
const filtercustom_rich: any = ref([]);
|
|
|
|
|
const searchList = ref([] as ISearchList[]);
|
2022-08-26 03:32:50 +02:00
|
|
|
|
2025-10-11 18:36:04 +02:00
|
|
|
const cities = ref([] as ICity[]);
|
2022-08-26 03:32:50 +02:00
|
|
|
|
2025-10-11 18:36:04 +02:00
|
|
|
const fidoConcesso = ref(<any>0);
|
|
|
|
|
const qtaMax = ref(<any>0);
|
2023-03-21 18:12:06 +01:00
|
|
|
|
2025-01-15 15:39:58 +01:00
|
|
|
const mycards_annunci = computed(() => {
|
2025-10-11 18:36:04 +02:00
|
|
|
return costanti.MAINCARDS.filter((rec: any) => rec.table && rec.annuncio);
|
|
|
|
|
});
|
2025-01-15 15:39:58 +01:00
|
|
|
|
2025-10-11 18:36:04 +02:00
|
|
|
watch(
|
|
|
|
|
() => path.value,
|
|
|
|
|
(to: any, from: any) => {
|
|
|
|
|
if (circuitpath_loaded.value !== path.value) loadCircuit();
|
|
|
|
|
}
|
|
|
|
|
);
|
2022-08-30 17:00:32 +02:00
|
|
|
|
2025-10-11 18:36:04 +02:00
|
|
|
watch(
|
|
|
|
|
() => tabcircuit.value,
|
|
|
|
|
(to: any, from: any) => {
|
|
|
|
|
tools.setCookie(tools.COOK_TAB_CIRCUIT + path.value, tabcircuit.value);
|
|
|
|
|
}
|
|
|
|
|
);
|
2022-08-30 17:00:32 +02:00
|
|
|
|
2025-10-11 18:36:04 +02:00
|
|
|
watch(
|
|
|
|
|
() => circuit.value,
|
|
|
|
|
(to: any, from: any) => {
|
|
|
|
|
if (to) {
|
|
|
|
|
loadAccount();
|
|
|
|
|
}
|
2023-10-01 01:24:55 +02:00
|
|
|
}
|
2025-10-11 18:36:04 +02:00
|
|
|
);
|
2022-12-10 02:01:26 +01:00
|
|
|
|
2025-01-07 17:17:08 +01:00
|
|
|
function getParamCircuitsToView() {
|
|
|
|
|
return {
|
|
|
|
|
'circuit.name': 1,
|
|
|
|
|
'circuit._id': 1,
|
2025-10-11 18:36:04 +02:00
|
|
|
};
|
2025-01-07 17:17:08 +01:00
|
|
|
}
|
|
|
|
|
|
2023-10-01 01:24:55 +02:00
|
|
|
function loadAccount() {
|
|
|
|
|
// console.log('loadAccount')
|
2025-10-11 18:36:04 +02:00
|
|
|
account.value = circuit.value
|
|
|
|
|
? userStore.getAccountByCircuitId(circuit.value._id)
|
|
|
|
|
: null;
|
2023-10-01 01:24:55 +02:00
|
|
|
// console.log('saldo', account.value!.saldo)
|
2022-08-26 03:32:50 +02:00
|
|
|
|
2025-10-11 18:36:04 +02:00
|
|
|
fidoConcesso.value = account.value
|
|
|
|
|
? account.value.fidoConcesso
|
|
|
|
|
: circuit.value
|
|
|
|
|
? circuit.value.fido_scoperto_default
|
|
|
|
|
: 0;
|
|
|
|
|
qtaMax.value = account.value
|
|
|
|
|
? account.value.qta_maxConcessa
|
|
|
|
|
: circuit.value
|
|
|
|
|
? circuit.value.qta_max_default
|
|
|
|
|
: 0;
|
|
|
|
|
qtarem.value = account.value
|
|
|
|
|
? circuitStore.getRemainingCoinsToSend(account.value)
|
|
|
|
|
: 0;
|
|
|
|
|
saldo.value = account.value ? account.value.saldo : 0;
|
|
|
|
|
saldo_pend.value = account.value ? account.value.saldo_pend : 0;
|
2023-10-01 01:24:55 +02:00
|
|
|
}
|
2022-08-26 03:32:50 +02:00
|
|
|
|
2023-10-01 01:24:55 +02:00
|
|
|
function profile() {
|
2025-10-11 18:36:04 +02:00
|
|
|
return userStore.my.profile;
|
2023-10-01 01:24:55 +02:00
|
|
|
}
|
2022-11-30 21:26:17 +01:00
|
|
|
|
2023-10-01 01:24:55 +02:00
|
|
|
async function loadCircuit() {
|
2025-10-11 18:36:04 +02:00
|
|
|
console.log(' *** INIZIO loadCircuit');
|
2023-10-01 01:24:55 +02:00
|
|
|
|
|
|
|
|
if (!loading.value) {
|
2025-10-11 18:36:04 +02:00
|
|
|
loading.value = true;
|
2023-10-01 01:24:55 +02:00
|
|
|
// Carica il profilo di quest'utente
|
|
|
|
|
if (path.value) {
|
2025-10-11 18:36:04 +02:00
|
|
|
circuitpath_loaded.value = path.value;
|
|
|
|
|
circuit.value = null;
|
|
|
|
|
users_in_circuit.value = [];
|
|
|
|
|
await userStore
|
|
|
|
|
.loadCircuit(path.value, idnotif.value)
|
|
|
|
|
.then(({ data, status }: { data: any; status: number }) => {
|
|
|
|
|
// console.log('data', data)
|
|
|
|
|
if (data) {
|
|
|
|
|
notifStore.setAsRead(idnotif.value);
|
|
|
|
|
users_in_circuit.value = data.users_in_circuit;
|
|
|
|
|
circuit.value = data.circuit;
|
|
|
|
|
|
|
|
|
|
if (circuit.value!.circuitoIndipendente) {
|
|
|
|
|
showrules.value = true;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
circuit.value = null;
|
|
|
|
|
users_in_circuit.value = [];
|
2025-01-07 17:17:08 +01:00
|
|
|
}
|
2023-10-01 01:24:55 +02:00
|
|
|
|
2025-10-11 18:36:04 +02:00
|
|
|
loadAccount();
|
2023-10-01 01:24:55 +02:00
|
|
|
|
2025-10-11 18:36:04 +02:00
|
|
|
mystatus.value = status;
|
2023-10-01 01:24:55 +02:00
|
|
|
|
2025-10-11 18:36:04 +02:00
|
|
|
searchList.value = [];
|
|
|
|
|
if (circuit.value) {
|
|
|
|
|
const addquerysingle = [];
|
2023-10-01 01:24:55 +02:00
|
|
|
|
2025-10-11 18:36:04 +02:00
|
|
|
filterextra.value = [
|
|
|
|
|
{
|
|
|
|
|
$match: {
|
|
|
|
|
idapp: tools.getEnv('VITE_APP_ID'),
|
|
|
|
|
'profile.mycircuits': {
|
|
|
|
|
$elemMatch: { circuitname: { $eq: circuit.value.name } },
|
|
|
|
|
},
|
|
|
|
|
},
|
2023-10-01 01:24:55 +02:00
|
|
|
},
|
|
|
|
|
|
2025-10-11 18:36:04 +02:00
|
|
|
{
|
|
|
|
|
$lookup: {
|
|
|
|
|
from: 'circuits',
|
|
|
|
|
as: 'circuit',
|
|
|
|
|
let: { circuitname: circuit.value.name, idapp: '$idapp' },
|
|
|
|
|
pipeline: [
|
|
|
|
|
{
|
|
|
|
|
$match: {
|
|
|
|
|
$expr: {
|
|
|
|
|
$and: [
|
|
|
|
|
{ $eq: ['$name', '$$circuitname'] },
|
|
|
|
|
{ $eq: ['$idapp', '$$idapp'] },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
},
|
2023-10-01 01:24:55 +02:00
|
|
|
},
|
2025-10-11 18:36:04 +02:00
|
|
|
],
|
2022-11-06 13:38:38 +01:00
|
|
|
},
|
2025-10-11 18:36:04 +02:00
|
|
|
},
|
|
|
|
|
{ $unwind: '$circuit' },
|
|
|
|
|
{
|
|
|
|
|
$project: {
|
|
|
|
|
username: 1,
|
|
|
|
|
verified_by_aportador: 1,
|
|
|
|
|
name: 1,
|
|
|
|
|
surname: 1,
|
|
|
|
|
date_reg: 1,
|
|
|
|
|
profile: 1,
|
|
|
|
|
idapp: 1,
|
|
|
|
|
...getParamCircuitsToView(),
|
|
|
|
|
},
|
|
|
|
|
},
|
2023-10-01 01:24:55 +02:00
|
|
|
|
2025-10-11 18:36:04 +02:00
|
|
|
{
|
|
|
|
|
$lookup: {
|
|
|
|
|
from: 'accounts',
|
|
|
|
|
as: 'account',
|
|
|
|
|
let: {
|
|
|
|
|
username: '$username',
|
|
|
|
|
idapp: '$idapp',
|
|
|
|
|
circuitId: '$circuit._id',
|
|
|
|
|
},
|
|
|
|
|
pipeline: [
|
2023-10-01 01:24:55 +02:00
|
|
|
{
|
2025-10-11 18:36:04 +02:00
|
|
|
$match: {
|
|
|
|
|
$expr: {
|
|
|
|
|
$and: [
|
|
|
|
|
{ $eq: ['$$username', '$username'] },
|
|
|
|
|
{ $eq: ['$$idapp', '$idapp'] },
|
|
|
|
|
{ $eq: ['$$circuitId', '$circuitId'] },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
},
|
2023-10-01 01:24:55 +02:00
|
|
|
},
|
2025-10-11 18:36:04 +02:00
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{ $unwind: '$account' },
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
filterextra_group.value = [
|
|
|
|
|
{
|
|
|
|
|
$match: {
|
|
|
|
|
idapp: tools.getEnv('VITE_APP_ID'),
|
|
|
|
|
mycircuits: {
|
|
|
|
|
$elemMatch: { circuitname: { $eq: circuit.value.name } },
|
2022-12-15 21:57:44 +01:00
|
|
|
},
|
2022-11-06 13:38:38 +01:00
|
|
|
},
|
2023-10-01 01:24:55 +02:00
|
|
|
},
|
|
|
|
|
|
2025-10-11 18:36:04 +02:00
|
|
|
{
|
|
|
|
|
$lookup: {
|
|
|
|
|
from: 'circuits',
|
|
|
|
|
as: 'circuit',
|
|
|
|
|
let: { circuitname: circuit.value.name, idapp: '$idapp' },
|
|
|
|
|
pipeline: [
|
|
|
|
|
{
|
|
|
|
|
$match: {
|
|
|
|
|
$expr: {
|
|
|
|
|
$and: [
|
|
|
|
|
{ $eq: ['$name', '$$circuitname'] },
|
|
|
|
|
{ $eq: ['$idapp', '$$idapp'] },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
},
|
2023-10-01 01:24:55 +02:00
|
|
|
},
|
2025-10-11 18:36:04 +02:00
|
|
|
],
|
2023-01-03 16:51:45 +01:00
|
|
|
},
|
2025-10-11 18:36:04 +02:00
|
|
|
},
|
|
|
|
|
{ $unwind: '$circuit' },
|
|
|
|
|
{
|
|
|
|
|
$project: {
|
|
|
|
|
groupname: 1,
|
|
|
|
|
title: 1,
|
|
|
|
|
descr: 1,
|
|
|
|
|
photos: 1,
|
|
|
|
|
surname: 1,
|
|
|
|
|
verified_by_aportador: 1,
|
|
|
|
|
admins: 1,
|
|
|
|
|
idapp: 1,
|
|
|
|
|
...getParamCircuitsToView(),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
$lookup: {
|
|
|
|
|
from: 'accounts',
|
|
|
|
|
as: 'account',
|
|
|
|
|
let: {
|
|
|
|
|
groupname: '$groupname',
|
|
|
|
|
idapp: '$idapp',
|
|
|
|
|
circuitId: '$circuit._id',
|
|
|
|
|
},
|
|
|
|
|
pipeline: [
|
2023-10-01 01:24:55 +02:00
|
|
|
{
|
2025-10-11 18:36:04 +02:00
|
|
|
$match: {
|
|
|
|
|
$expr: {
|
|
|
|
|
$and: [
|
|
|
|
|
{ $eq: ['$groupname', '$$groupname'] },
|
|
|
|
|
{ $eq: ['$idapp', '$$idapp'] },
|
|
|
|
|
{ $eq: ['$circuitId', '$$circuitId'] },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
},
|
2023-10-01 01:24:55 +02:00
|
|
|
},
|
2025-10-11 18:36:04 +02:00
|
|
|
],
|
2023-01-13 12:29:34 +01:00
|
|
|
},
|
2025-10-11 18:36:04 +02:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
$unwind: '$account',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
$match: { 'account.groupname': { $exists: true, $ne: '' } },
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
arrfilterand.value = [];
|
|
|
|
|
filtercustom_rich.value = [];
|
|
|
|
|
|
|
|
|
|
if (userStore.my.username && circuit.value)
|
|
|
|
|
groupsListAdmin.value = userStore.GroupsListWhereIAmAdmin();
|
2022-08-26 03:32:50 +02:00
|
|
|
|
2025-10-11 18:36:04 +02:00
|
|
|
// filtroutente.value = [{ userId: userStore.my._id }]
|
|
|
|
|
});
|
2023-10-01 01:24:55 +02:00
|
|
|
}
|
2025-10-11 18:36:04 +02:00
|
|
|
loading.value = false;
|
|
|
|
|
console.log(' ___ FINE loadCircuit');
|
2022-08-26 03:32:50 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-10-01 01:24:55 +02:00
|
|
|
function mounted() {
|
2025-10-11 18:36:04 +02:00
|
|
|
tabcircuit.value = tools.getCookie(tools.COOK_TAB_CIRCUIT + path.value, 'info');
|
2023-02-02 02:31:09 +01:00
|
|
|
|
2025-10-11 18:36:04 +02:00
|
|
|
loadCircuit();
|
2025-01-15 15:39:58 +01:00
|
|
|
|
2025-10-11 18:36:04 +02:00
|
|
|
if (mycards_annunci.value) card.value = mycards_annunci.value[0];
|
2022-08-26 03:32:50 +02:00
|
|
|
}
|
|
|
|
|
|
2022-08-30 17:00:32 +02:00
|
|
|
function getImgCircuit() {
|
2025-10-11 18:36:04 +02:00
|
|
|
if (circuit.value) return userStore.getImgByCircuit(circuit.value);
|
|
|
|
|
else return '';
|
2022-08-26 03:32:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function checkifShow(col: string) {
|
2022-11-06 13:38:38 +01:00
|
|
|
// ++Todo: checkifShow Permessi !
|
2025-10-11 18:36:04 +02:00
|
|
|
return true;
|
2022-08-26 03:32:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function extraparams() {
|
2025-10-11 18:36:04 +02:00
|
|
|
const lk_tab = 'users';
|
|
|
|
|
const lk_LF = 'userId';
|
|
|
|
|
const lk_FF = '_id';
|
|
|
|
|
const lk_as = 'user';
|
|
|
|
|
const af_objId_tab = 'myId';
|
2022-08-26 03:32:50 +02:00
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
lookup1: {
|
|
|
|
|
lk_tab,
|
|
|
|
|
lk_LF,
|
|
|
|
|
lk_FF,
|
|
|
|
|
lk_as,
|
|
|
|
|
af_objId_tab,
|
|
|
|
|
lk_proj: {
|
2022-12-15 21:57:44 +01:00
|
|
|
username: 1,
|
|
|
|
|
name: 1,
|
|
|
|
|
surname: 1,
|
2023-11-30 01:48:29 +01:00
|
|
|
verified_by_aportador: 1,
|
2023-10-01 01:24:55 +02:00
|
|
|
lang: 1,
|
2022-08-26 03:32:50 +02:00
|
|
|
'profile.img': 1,
|
|
|
|
|
'profile.mycircuits': 1,
|
|
|
|
|
'profile.qualifica': 1,
|
2023-04-04 15:27:03 +02:00
|
|
|
'profile.resid_province': 1,
|
2023-11-26 01:38:09 +01:00
|
|
|
'profile.resid_card': 1,
|
2023-02-23 17:20:54 +01:00
|
|
|
'account._id': 1,
|
2022-09-18 19:45:26 +02:00
|
|
|
'account.saldo': 1,
|
2023-10-21 15:28:01 +02:00
|
|
|
'account.saldo_pend': 1,
|
2023-02-23 17:20:54 +01:00
|
|
|
'account.fidoConcesso': 1,
|
|
|
|
|
'account.qta_maxConcessa': 1,
|
|
|
|
|
'account.totTransato': 1,
|
2023-10-21 15:28:01 +02:00
|
|
|
'account.totTransato_pend': 1,
|
2022-08-26 03:32:50 +02:00
|
|
|
reported: 1,
|
|
|
|
|
date_report: 1,
|
|
|
|
|
username_who_report: 1,
|
2023-04-12 15:37:47 +02:00
|
|
|
namecomplete: 1,
|
|
|
|
|
date_reg: 1,
|
2025-10-11 18:36:04 +02:00
|
|
|
},
|
2022-08-26 03:32:50 +02:00
|
|
|
},
|
2025-10-11 18:36:04 +02:00
|
|
|
};
|
2022-08-26 03:32:50 +02:00
|
|
|
}
|
|
|
|
|
|
2023-01-03 16:51:45 +01:00
|
|
|
function extraparams_groups() {
|
2025-10-11 18:36:04 +02:00
|
|
|
const lk_tab = 'mygroups';
|
|
|
|
|
const lk_LF = 'userId';
|
|
|
|
|
const lk_FF = '_id';
|
|
|
|
|
const lk_as = 'group';
|
|
|
|
|
const af_objId_tab = 'myId';
|
2023-01-03 16:51:45 +01:00
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
lookup1: {
|
|
|
|
|
lk_tab,
|
|
|
|
|
lk_LF,
|
|
|
|
|
lk_FF,
|
|
|
|
|
lk_as,
|
|
|
|
|
af_objId_tab,
|
|
|
|
|
lk_proj: {
|
|
|
|
|
groupname: 1,
|
|
|
|
|
title: 1,
|
|
|
|
|
descr: 1,
|
|
|
|
|
photos: 1,
|
2025-10-11 18:36:04 +02:00
|
|
|
},
|
2023-01-03 16:51:45 +01:00
|
|
|
},
|
2025-10-11 18:36:04 +02:00
|
|
|
};
|
2023-01-03 16:51:45 +01:00
|
|
|
}
|
|
|
|
|
|
2022-08-26 03:32:50 +02:00
|
|
|
function extraparams_rich() {
|
|
|
|
|
return {
|
|
|
|
|
querytype: shared_consts.QUERYTYPE_CIRCUIT,
|
2022-09-11 11:45:13 +02:00
|
|
|
myid: circuit.value ? circuit.value._id : '',
|
2025-10-11 18:36:04 +02:00
|
|
|
};
|
2022-09-11 11:45:13 +02:00
|
|
|
}
|
|
|
|
|
|
2023-02-16 20:13:55 +01:00
|
|
|
function extraparams_rich_groups() {
|
|
|
|
|
return {
|
|
|
|
|
querytype: shared_consts.QUERYTYPE_GROUP_CIRCUIT,
|
|
|
|
|
myid: circuit.value ? circuit.value._id : '',
|
2025-10-11 18:36:04 +02:00
|
|
|
};
|
2023-02-16 20:13:55 +01:00
|
|
|
}
|
|
|
|
|
|
2025-10-11 18:36:04 +02:00
|
|
|
const extraparams_movs = () => {
|
2023-11-30 01:48:29 +01:00
|
|
|
if (showwhommov.value === 1) {
|
2022-09-16 19:38:57 +02:00
|
|
|
return {
|
|
|
|
|
querytype: shared_consts.QUERYTYPE_LIST_MOVEMENTS,
|
|
|
|
|
myid: circuit.value ? circuit.value._id : '',
|
|
|
|
|
username: userStore.my.username,
|
2025-10-11 18:36:04 +02:00
|
|
|
};
|
2022-09-16 19:38:57 +02:00
|
|
|
} else {
|
|
|
|
|
return {
|
|
|
|
|
querytype: shared_consts.QUERYTYPE_LIST_ALLMOVEMENTS,
|
|
|
|
|
myid: circuit.value ? circuit.value._id : '',
|
2025-10-11 18:36:04 +02:00
|
|
|
};
|
2022-08-26 03:32:50 +02:00
|
|
|
}
|
2025-10-11 18:36:04 +02:00
|
|
|
};
|
2022-08-26 03:32:50 +02:00
|
|
|
|
|
|
|
|
function extraparams_refused() {
|
|
|
|
|
return {
|
2022-08-30 17:00:32 +02:00
|
|
|
querytype: shared_consts.QUERYTYPE_REFUSED_USER_CIRCUIT,
|
2022-09-11 11:45:13 +02:00
|
|
|
myid: circuit.value ? circuit.value._id : '',
|
2025-10-11 18:36:04 +02:00
|
|
|
};
|
2022-08-26 03:32:50 +02:00
|
|
|
}
|
2023-03-21 18:12:06 +01:00
|
|
|
function extraparams_refused_groups() {
|
2023-02-16 20:13:55 +01:00
|
|
|
return {
|
|
|
|
|
querytype: shared_consts.QUERYTYPE_REFUSED_GROUP_CIRCUIT,
|
|
|
|
|
myid: circuit.value ? circuit.value._id : '',
|
2025-10-11 18:36:04 +02:00
|
|
|
};
|
2023-02-16 20:13:55 +01:00
|
|
|
}
|
2022-08-26 03:32:50 +02:00
|
|
|
|
|
|
|
|
function numUsers() {
|
2025-10-11 18:36:04 +02:00
|
|
|
return users_in_circuit.value ? users_in_circuit.value.length : 0;
|
2022-08-26 03:32:50 +02:00
|
|
|
}
|
2022-09-18 19:45:26 +02:00
|
|
|
|
2022-08-26 03:32:50 +02:00
|
|
|
function numAdmins() {
|
2025-10-11 18:36:04 +02:00
|
|
|
let quanti =
|
|
|
|
|
circuit.value && circuit.value.admins ? circuit.value.admins.length : 0;
|
|
|
|
|
if (quanti === 0) quanti = 1;
|
2025-01-28 23:32:37 +01:00
|
|
|
|
2025-10-11 18:36:04 +02:00
|
|
|
return quanti;
|
2022-08-26 03:32:50 +02:00
|
|
|
}
|
2022-09-18 19:45:26 +02:00
|
|
|
|
2022-08-26 03:32:50 +02:00
|
|
|
function listaAdmins() {
|
2025-10-11 18:36:04 +02:00
|
|
|
return circuit.value && circuit.value.admins
|
|
|
|
|
? circuit.value.admins.map((rec) => rec.username).join(', ')
|
|
|
|
|
: '';
|
2022-08-26 03:32:50 +02:00
|
|
|
}
|
|
|
|
|
|
2023-03-21 18:12:06 +01:00
|
|
|
function getRegulation(reg: string) {
|
2025-10-11 18:36:04 +02:00
|
|
|
const strreg = reg + '';
|
2023-03-21 18:12:06 +01:00
|
|
|
if (!reg) {
|
2025-10-11 18:36:04 +02:00
|
|
|
const mystringa = t('circuit.regolamento', { nomecircuito: circuit.value!.name });
|
|
|
|
|
return mystringa;
|
2023-03-21 18:12:06 +01:00
|
|
|
} else {
|
2025-10-11 18:36:04 +02:00
|
|
|
return reg;
|
2023-03-21 18:12:06 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-10-01 01:24:55 +02:00
|
|
|
async function aggiornaSaldo() {
|
2025-10-11 18:36:04 +02:00
|
|
|
loadSaldo.value = true;
|
2023-10-21 15:28:01 +02:00
|
|
|
await circuitStore.aggiornaSaldo(circuit.value!._id, '');
|
2025-10-11 18:36:04 +02:00
|
|
|
loadAccount();
|
|
|
|
|
loadSaldo.value = false;
|
2023-10-01 01:24:55 +02:00
|
|
|
}
|
|
|
|
|
|
2025-10-11 18:36:04 +02:00
|
|
|
function myusername() {
|
|
|
|
|
return userStore.my.username;
|
|
|
|
|
}
|
2025-03-01 14:14:43 +01:00
|
|
|
|
2025-10-11 18:36:04 +02:00
|
|
|
onMounted(mounted);
|
2022-08-26 03:32:50 +02:00
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
profile,
|
|
|
|
|
tools,
|
|
|
|
|
costanti,
|
|
|
|
|
circuit,
|
2022-09-03 13:06:35 +02:00
|
|
|
account,
|
2022-08-26 03:32:50 +02:00
|
|
|
shared_consts,
|
2022-08-30 17:00:32 +02:00
|
|
|
getImgCircuit,
|
2022-08-26 03:32:50 +02:00
|
|
|
checkifShow,
|
|
|
|
|
|
|
|
|
|
filtroutente,
|
|
|
|
|
showPic,
|
|
|
|
|
userStore,
|
|
|
|
|
t,
|
|
|
|
|
animation,
|
|
|
|
|
arrfilterand,
|
2022-11-06 13:38:38 +01:00
|
|
|
filterextra,
|
2022-11-30 21:26:17 +01:00
|
|
|
filterextra2,
|
2022-08-26 03:32:50 +02:00
|
|
|
filtercustom,
|
|
|
|
|
filtercustom_rich,
|
|
|
|
|
searchList,
|
2022-09-11 11:45:13 +02:00
|
|
|
colmyMovement,
|
2022-09-16 19:38:57 +02:00
|
|
|
colmyMovementTable,
|
2022-08-26 03:32:50 +02:00
|
|
|
colmyUserPeople,
|
2022-09-18 19:45:26 +02:00
|
|
|
colmyUserPeopleSaldi,
|
2022-08-26 03:32:50 +02:00
|
|
|
colmyUserCircuit,
|
2023-02-16 20:13:55 +01:00
|
|
|
colmyUserGroup,
|
2022-08-26 03:32:50 +02:00
|
|
|
extraparams,
|
|
|
|
|
extraparams_rich,
|
|
|
|
|
extraparams_refused,
|
2022-09-11 11:45:13 +02:00
|
|
|
extraparams_movs,
|
2022-08-26 03:32:50 +02:00
|
|
|
tab,
|
2022-12-10 02:01:26 +01:00
|
|
|
tabcircuit,
|
2022-08-26 03:32:50 +02:00
|
|
|
tabmembers,
|
|
|
|
|
numUsers,
|
|
|
|
|
numAdmins,
|
|
|
|
|
listaAdmins,
|
|
|
|
|
users_in_circuit,
|
|
|
|
|
loading,
|
|
|
|
|
mystatus,
|
|
|
|
|
cities,
|
2022-09-11 11:45:13 +02:00
|
|
|
path,
|
2022-09-12 18:36:54 +02:00
|
|
|
requestToEnterCircuit,
|
2022-09-14 11:31:48 +02:00
|
|
|
circuitStore,
|
|
|
|
|
qtarem,
|
|
|
|
|
saldo,
|
2023-11-30 01:48:29 +01:00
|
|
|
showwhommov,
|
2022-09-16 19:38:57 +02:00
|
|
|
tabellare,
|
2022-09-18 19:45:26 +02:00
|
|
|
showsaldi,
|
2023-01-03 16:51:45 +01:00
|
|
|
filterextra_group,
|
|
|
|
|
groupsListAdmin,
|
|
|
|
|
groupnameSel,
|
2023-02-01 01:19:58 +01:00
|
|
|
showsendCoinTo,
|
2023-02-01 16:36:17 +01:00
|
|
|
showrules,
|
2023-02-02 02:31:09 +01:00
|
|
|
loadCircuit,
|
2023-02-16 20:13:55 +01:00
|
|
|
extraparams_rich_groups,
|
|
|
|
|
extraparams_refused_groups,
|
2023-03-21 18:12:06 +01:00
|
|
|
getRegulation,
|
2023-06-05 16:36:06 +02:00
|
|
|
fidoConcesso,
|
|
|
|
|
qtaMax,
|
2023-10-01 01:24:55 +02:00
|
|
|
showMov,
|
|
|
|
|
loadAccount,
|
|
|
|
|
aggiornaSaldo,
|
|
|
|
|
loadSaldo,
|
2023-11-30 01:48:29 +01:00
|
|
|
optionsmov,
|
2024-01-07 16:03:45 +01:00
|
|
|
globalStore,
|
2024-02-17 15:07:29 +01:00
|
|
|
saldo_pend,
|
2025-01-15 15:39:58 +01:00
|
|
|
mycards_annunci,
|
|
|
|
|
card,
|
2025-10-11 18:36:04 +02:00
|
|
|
myusername,
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
});
|