- aggiunto anche nei beni, servizi e ospitalità la possibilità di aggiungerli come "Gruppo"

This commit is contained in:
Surya Paolo
2025-01-14 18:34:58 +01:00
parent 37970c5c91
commit 08a089881c
23 changed files with 484 additions and 94 deletions

View File

@@ -34,11 +34,11 @@ export default defineComponent({
label: 'Filtra per',
table: shared_consts.TABFILTRI_UTENTE,
key: '',
type: costanti.FieldType.select,
value: tools.getCookie(tools.COOK_SEARCH + 'filtroutente', costanti.FILTER_TUTTI),
type: costanti.FieldType.multiselect,
value: 0,
keycookie: '_fu',
addall: false,
arrvalue: [],
arrvalue: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + 'users' + costanti.FILTER_SEP + shared_consts.TABFILTRI_UTENTE + '_fu', []),
filter: null,
useinput: false,
icon: 'fas fa-filter'
@@ -106,6 +106,7 @@ export default defineComponent({
'profile.img': 1,
'profile.mygroups': 1,
'profile.qualifica': 1,
'profile.note': 1,
'profile.resid_province': 1,
'mycities.reg': 1,
}

View File

@@ -30,7 +30,7 @@ export default defineComponent({
name: 'mygroup',
components: {
CProfile, CTitleBanner, CMyFieldRec,
CInfoAccount, CSkill, CDateTime, CMyFriends, CGridTableRec, CMyUser, CCheckIfIsLogged,
CInfoAccount, CSkill, CDateTime, CMyFriends, CGridTableRec, CMyUser, CCheckIfIsLogged,
CNotifAtTop, CSendCoins
},
props: {},
@@ -43,6 +43,11 @@ export default defineComponent({
const { t } = useI18n()
const animation = ref('fade')
const tabevents = ref('new')
const mycards = computed(() => {
return costanti.MAINCARDS.filter((rec: any) => rec.table && rec.showinprofile)
})
const groupname = computed(() => $route.params.groupname ? $route.params.groupname.toString() : '')
const idnotif = computed(() => $route.query.idnotif ? $route.query.idnotif.toString() : '')
@@ -53,6 +58,7 @@ export default defineComponent({
const showsendCoinTo = ref(false)
const tabcircuit = ref('info')
const filtro_eventi = ref(<any[]>[])
const mygrp = ref(<IMyGroup | null>{})
const mystatus = ref(<number>0)
@@ -106,7 +112,7 @@ export default defineComponent({
if (circuitslist.value) {
circuitslistOpt.value = []
for (let i = 0; i < circuitslist.value.length; i++) {
circuitslistOpt.value.push({label: circuitslist.value[i].name, value: i })
circuitslistOpt.value.push({ label: circuitslist.value[i].name, value: i })
let myc = data.mygroup.mycircuits.find((circ: IMyCircuit) => circ.circuitname === circuitslist.value[i].name)
if (myc) {
circuitslist.value[i].account = myc.account
@@ -140,6 +146,7 @@ export default defineComponent({
arrfilterand.value = []
filtercustom_rich.value = []
//++TODO: sistemare la filtercustom ... richieste...
}
@@ -213,11 +220,34 @@ export default defineComponent({
}
}
function filtroeventsgroup() {
function filtrotables(table: string, quale: string) {
let out = []
if (mygrp.value)
return [{ groupname: mygrp.value.groupname }]
else
return null
out.push({ groupname: mygrp.value.groupname })
if (table === shared_consts.TABLES_MYBACHECAS) {
let mydate = tools.addDays(tools.getDateNow(), -1)
let mydateend = tools.addDays(mydate, 180)
mydate = tools.getstrYYMMDDDate(mydate)
mydateend = tools.getstrYYMMDDDate(mydateend)
if (quale === 'new') {
filtro_eventi.value = [{ dateTimeStart: { $gte: mydate, $lte: mydateend } }]
} else {
mydate = tools.addDays(tools.getDateNow(), -365)
mydateend = tools.addDays(tools.getDateNow(), 0)
mydate = tools.getstrYYMMDDDate(mydate)
mydateend = tools.getstrYYMMDDDate(mydateend)
filtro_eventi.value = [{ dateTimeStart: { $gte: mydate, $lte: mydateend } }]
}
filtro_eventi.value.forEach((rec: any) => [
out.push({ ...rec })
])
}
return out
}
function getlinkpage() {
@@ -270,9 +300,11 @@ export default defineComponent({
tabcircuit,
circuitIndex,
circuitslistOpt,
filtroeventsgroup,
filtrotables,
getlinkpage,
showsendCoinTo,
mycards,
tabevents,
}
}
})

View File

@@ -204,6 +204,11 @@
name="members"
icon="fas fa-users"
></q-tab>
<q-tab
:label="t('profile.annunci')"
name="annunci"
icon="fas fa-pencil-alt"
></q-tab>
<q-tab
v-if="
tools.iCanShowGroupsMember(mygrp) ||
@@ -213,11 +218,6 @@
name="circuits"
icon="img: images/1ris_rosso_100.png"
></q-tab>
<q-tab
:label="t('groups.events')"
name="events"
icon="fas fa-bullhorn"
></q-tab>
</q-tabs>
<q-tab-panels v-model="tabgrp" animated keep-alive>
@@ -511,7 +511,7 @@
></q-tab>
</q-tabs>
</q-tab-panel>
<q-tab-panel name="events"></q-tab-panel>
<q-tab-panel name="annunci"></q-tab-panel>
</q-tab-panels>
<div v-if="tabgrp === 'circuits' && tabcircuit === 'info'">
@@ -604,17 +604,59 @@
></CGridTableRec>
</div>
</div>
<div v-if="tabgrp === 'events'">
<CSkill
v-if="filtroeventsgroup()"
:groupname="mygrp.groupname"
:table="shared_consts.TABLES_MYBACHECAS"
:filtercustom="filtroeventsgroup()"
:butt_modif_new="tools.iAmAdminGroup(groupname)"
:visuinpage="true"
:noaut="false"
:title="$t('groups.events')"
/>
<div v-if="tabgrp === 'annunci'">
<div v-for="(card, ind) of mycards" :key="ind" :name="card.table">
<div
v-if="card.table !== 'mygroups' && card.table !== 'circuits'"
>
<div
v-if="card.table !== 'mygroups' && card.table !== 'circuits'"
>
<div v-if="card.table === shared_consts.TABLES_MYBACHECAS">
<q-tabs v-model="tabevents" class="text-teal">
<q-tab label="Eventi Passati" name="past"></q-tab>
<q-tab label="Prossimi Eventi" name="new"></q-tab>
</q-tabs>
<q-tab-panels v-model="tabevents" animated>
<q-tab-panel name="past">
<CSkill
:groupname="mygrp.groupname"
:table="card.table"
:filtercustom="filtrotables(card.table, tabevents)"
:butt_modif_new="tools.iAmAdminGroup(groupname)"
:visuinpage="true"
:noaut="false"
:title="card.title"
/>
</q-tab-panel>
<q-tab-panel name="new">
<CSkill
:groupname="mygrp.groupname"
:table="card.table"
:filtercustom="filtrotables(card.table, tabevents)"
:butt_modif_new="tools.iAmAdminGroup(groupname)"
:visuinpage="true"
:noaut="false"
:title="card.title"
/>
</q-tab-panel>
</q-tab-panels>
</div>
<div v-else>
<CSkill
:groupname="mygrp.groupname"
:table="card.table"
:filtercustom="filtrotables(card.table, '')"
:butt_modif_new="tools.iAmAdminGroup(groupname)"
:visuinpage="true"
:noaut="false"
:title="card.title"
/>
</div>
</div>
</div>
</div>
</div>
<div v-if="tabgrp === 'members' && tabmembers === 'all'">
<CGridTableRec
@@ -687,7 +729,7 @@
</q-dialog>
</div>
</div>
<div v-if="showsendCoinTo">
<div v-if="showsendCoinTo">
<CSendCoins
:showprop="showsendCoinTo"
:to_group="mygrp"
@@ -695,9 +737,7 @@
@close="showsendCoinTo = false"
>
</CSendCoins>
</div>
</div>
</template>
<script lang="ts" src="./mygroup.ts">

View File

@@ -7,6 +7,7 @@ import { CCopyBtn } from '@/components/CCopyBtn'
import { CSkill } from '@/components/CSkill'
import { CDateTime } from '@/components/CDateTime'
import { CMyGroup } from '@/components/CMyGroup'
import { CUserNote } from '@/components/CUserNote'
import { CMyCircuit } from '@/components/CMyCircuit'
import { CNotifAtTop } from '@src/components/CNotifAtTop'
import { CMyActivities } from '@src/components/CMyActivities'
@@ -38,7 +39,7 @@ export default defineComponent({
components: {
CProfile, CTitleBanner, CMyFieldDb, CSkill, CDateTime, CCopyBtn, CUserNonVerif, CMyFieldRec, CMyUser,
CMyGroup, CLabel, CMyCircuit, CSendCoins, CNotifAtTop,
CCheckIfIsLogged, CTimeAgo, CContactUser, CMyActivities,
CCheckIfIsLogged, CTimeAgo, CContactUser, CMyActivities, CUserNote,
},
props: {},
setup() {
@@ -54,6 +55,7 @@ export default defineComponent({
const animation = ref('fade')
const spinner_visible = ref(false)
const shownote = ref(false)
const usersList = ref({ show: false, title: '', list: [] })
const username = computed(() => $route.params.username ? $route.params.username.toString() : userStore.my.username)
@@ -71,6 +73,7 @@ export default defineComponent({
const showinghand = ref(false)
const actualcard = ref('mygoods')
const mostranota = ref(false)
const notifStore = useNotifStore()
@@ -196,6 +199,11 @@ export default defineComponent({
spinner_visible.value = false
}
function salvaUserProv(userprofile: IUserFields) {
if (userprofile)
userStore.userprofile = userprofile
}
return {
username,
getlinkpage,
@@ -238,6 +246,9 @@ export default defineComponent({
spinner_visible,
showed,
tab,
shownote,
mostranota,
salvaUserProv,
}
}
})

View File

@@ -118,6 +118,17 @@
>
{{ userStore.userprofile.profile.biografia }}
</div>
<div
v-if="
userStore.userprofile &&
userStore.userprofile.profile.note &&
(userStore.isFacilitatore || userStore.isAdmin)
"
class="col-12 text-h8 q-mt-sm"
>
Note del Facilitatore:<br />
{{ userStore.userprofile.profile.note }}
</div>
</div>
</div>
<CCheckIfIsLogged></CCheckIfIsLogged>
@@ -210,6 +221,33 @@
</span>
</div>
<div
v-if="
userStore.userprofile &&
userStore.userprofile.profile.note &&
(userStore.isFacilitatore || userStore.isAdmin)
"
class="col-12 text-h8 q-mt-sm"
>
<div v-if="!mostranota" class="text-center">
<q-btn
label="Note del Facilitatore"
@click="mostranota = true"
color="green"
>
<q-badge color="red" floating>1</q-badge>
</q-btn>
</div>
<div v-else>
<strong>Note del Facilitatore</strong>:<br />
<q-banner rounded class="bg-green-8 text-white">
<div class="text-h7 text-center">
{{ userStore.userprofile.profile.note }}
</div>
</q-banner>
</div>
</div>
<CContactUser
:myuser="userStore.userprofile"
:showBtnActivities="false"
@@ -725,17 +763,13 @@
</q-tab-panels>
</div>
</div>
<q-page-sticky
position="top-right"
:offset="[18, 18]"
class="z-top"
>
<q-page-sticky position="top-right" :offset="[18, 18]" class="z-top">
<q-fab
icon="fas fa-ellipsis-v"
color="accent"
external-label
vertical-actions-align="right"
direction="down"
direction="down"
>
<q-fab-action
@click="tools.copyToClip($q, getlinkpage(), true)"
@@ -752,6 +786,14 @@
:label="$t('shared.edit_profile')"
@click.stop="gotoPage('/editprofile')"
/>
<q-fab-action
label-position="right"
v-if="userStore.isFacilitatore || userStore.isAdmin"
color="red"
icon="fas fa-pencil-alt"
:label="$t('profile.aggiungi_note')"
@click="shownote = !shownote"
/>
</q-fab>
</q-page-sticky>
<q-dialog v-model="showPic" full-height full-width>
@@ -828,6 +870,14 @@
</q-card-section>
</q-card>
</q-dialog>
<div v-if="shownote">
<CUserNote
:username="username"
:userprofile_param="userStore.userprofile"
@closenote="shownote = false"
@save="salvaUserProv"
/>
</div>
</template>
<script lang="ts" src="./myprofile.ts">