ver 0.5.51
This commit is contained in:
@@ -7,6 +7,7 @@ import { CCheckIfIsLogged } from '@/components/CCheckIfIsLogged'
|
||||
import { CMyFieldRec } from '@/components/CMyFieldRec'
|
||||
import { CSkill } from '@/components/CSkill'
|
||||
import { CDateTime } from '@/components/CDateTime'
|
||||
import { CSaldo } from '@/components/CSaldo'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { computed, defineComponent, onMounted, ref, watch } from 'vue'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
@@ -16,19 +17,22 @@ import { useI18n } from '@/boot/i18n'
|
||||
import { toolsext } from '@store/Modules/toolsext'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { costanti } from '@costanti'
|
||||
import { ICity, IFriends, IMyGroup, ISearchList, IUserFields } from 'model'
|
||||
import { ICircuit, ICity, IFriends, IMyCircuit, IMyGroup, ISearchList, IUserFields } from 'model'
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
import { colmyUserPeople, colmyUserGroup } from '@store/Modules/fieldsTable'
|
||||
import { useNotifStore } from '@store/NotifStore'
|
||||
import { useCircuitStore } from '@src/store/CircuitStore'
|
||||
|
||||
|
||||
export default defineComponent({
|
||||
name: 'mygroup',
|
||||
components: { CProfile, CTitleBanner, CMyFieldRec, CSkill, CDateTime, CMyFriends, CGridTableRec, CMyUser, CCheckIfIsLogged },
|
||||
components: { CProfile, CTitleBanner, CMyFieldRec,
|
||||
CSaldo, CSkill, CDateTime, CMyFriends, CGridTableRec, CMyUser, CCheckIfIsLogged },
|
||||
props: {},
|
||||
setup() {
|
||||
const userStore = useUserStore()
|
||||
const notifStore = useNotifStore()
|
||||
const circuitStore = useCircuitStore()
|
||||
const $route = useRoute()
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
@@ -41,7 +45,7 @@ export default defineComponent({
|
||||
const filtroutente = ref(<any[]>[])
|
||||
const showPic = ref(false)
|
||||
|
||||
const mygrp = ref(<IMyGroup|null>{})
|
||||
const mygrp = ref(<IMyGroup | null>{})
|
||||
const mystatus = ref(<number>0)
|
||||
const users_in_group = ref(<IFriends[]>[])
|
||||
|
||||
@@ -58,6 +62,8 @@ export default defineComponent({
|
||||
|
||||
const cities = ref(<ICity[]>[])
|
||||
|
||||
const circuitslist = ref(<ICircuit[] | null | undefined>[])
|
||||
|
||||
function profile() {
|
||||
return userStore.my.profile
|
||||
}
|
||||
@@ -69,13 +75,18 @@ export default defineComponent({
|
||||
async function loadGroup() {
|
||||
// Carica il profilo di quest'utente
|
||||
if (groupname.value) {
|
||||
await userStore.loadGroup(groupname.value, idnotif.value).then(({ data, status }: {data: any, status: number}) => {
|
||||
await userStore.loadGroup(groupname.value, idnotif.value).then(({ data, status }: { data: any, status: number }) => {
|
||||
console.log('data', data)
|
||||
circuitslist.value = []
|
||||
if (data) {
|
||||
mygrp.value = data.mygroup
|
||||
cities.value = data.cities
|
||||
notifStore.setAsRead(idnotif.value)
|
||||
users_in_group.value = data.users_in_group
|
||||
|
||||
if (mygrp.value && tools.iAmAdminGroup(groupname.value)) {
|
||||
circuitslist.value = circuitStore.getCircuitsListByGroup(mygrp.value)
|
||||
}
|
||||
} else {
|
||||
mygrp.value = null
|
||||
users_in_group.value = []
|
||||
@@ -99,7 +110,7 @@ export default defineComponent({
|
||||
await loadGroup()
|
||||
|
||||
searchList.value = []
|
||||
filtercustom.value = [{ 'profile.mygroups': { $elemMatch: {groupname: {$eq: groupname.value }} } } ]
|
||||
filtercustom.value = [{ 'profile.mygroups': { $elemMatch: { groupname: { $eq: groupname.value } } } }]
|
||||
|
||||
arrfilterand.value = []
|
||||
filtercustom_rich.value = []
|
||||
@@ -236,6 +247,7 @@ export default defineComponent({
|
||||
loading,
|
||||
mystatus,
|
||||
cities,
|
||||
circuitslist,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user