ver 0.5.51
This commit is contained in:
@@ -7,6 +7,7 @@ import { CCheckIfIsLogged } from '@/components/CCheckIfIsLogged'
|
||||
import { CMyFieldRec } from '@/components/CMyFieldRec'
|
||||
import { CCurrencyValue } from '@/components/CCurrencyValue'
|
||||
import { CSaldo } from '@/components/CSaldo'
|
||||
import { CTitleSec } from '@/components/CTitleSec'
|
||||
import { CSkill } from '@/components/CSkill'
|
||||
import { CDateTime } from '@/components/CDateTime'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
@@ -29,7 +30,7 @@ import { useCircuitStore } from '@store/CircuitStore'
|
||||
export default defineComponent({
|
||||
name: 'mycircuit',
|
||||
components: {
|
||||
CProfile, CTitleBanner, CMyFieldRec, CSkill, CDateTime, CMyFriends,
|
||||
CProfile, CTitleBanner, CMyFieldRec, CSkill, CTitleSec, CDateTime, CMyFriends,
|
||||
CGridTableRec, CMyUser, CCheckIfIsLogged, CCurrencyValue, CSaldo, CNotifAtTop
|
||||
},
|
||||
props: {},
|
||||
@@ -43,6 +44,8 @@ export default defineComponent({
|
||||
|
||||
const showonlymine = ref(true)
|
||||
const tabellare = ref(false)
|
||||
const groupsListAdmin = ref(<string[]>[])
|
||||
const groupnameSel = ref('')
|
||||
|
||||
const animation = ref('fade')
|
||||
|
||||
@@ -70,11 +73,13 @@ export default defineComponent({
|
||||
|
||||
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[])
|
||||
|
||||
|
||||
const cities = ref([] as ICity[])
|
||||
|
||||
watch(() => path.value, (to: any, from: any) => {
|
||||
@@ -117,20 +122,7 @@ export default defineComponent({
|
||||
|
||||
];
|
||||
|
||||
filterextra.value = [
|
||||
/*{
|
||||
'profile.mycircuits':
|
||||
{
|
||||
$elemMatch: {
|
||||
circuitname:
|
||||
{ $eq: circuit.value.name }
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
*/
|
||||
|
||||
{
|
||||
filterextra.value = [ {
|
||||
$match: {
|
||||
idapp: process.env.APP_ID,
|
||||
'profile.mycircuits': {
|
||||
@@ -199,6 +191,68 @@ export default defineComponent({
|
||||
},
|
||||
{ $unwind: '$account' },
|
||||
]
|
||||
|
||||
filterextra_group.value = [ {
|
||||
$match: {
|
||||
idapp: process.env.APP_ID,
|
||||
'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: {
|
||||
groupname: 1,
|
||||
title: 1,
|
||||
descr: 1,
|
||||
photos: 1,
|
||||
surname: 1,
|
||||
admins: 1,
|
||||
idapp: 1,
|
||||
'circuit.name': 1, 'circuit._id': 1
|
||||
}
|
||||
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: 'accounts',
|
||||
localField: 'circuit._id',
|
||||
foreignField: 'circuitId',
|
||||
as: 'account',
|
||||
},
|
||||
},
|
||||
{
|
||||
$unwind: '$account',
|
||||
},
|
||||
{ $match: { 'account.groupname': { $exists: true, $ne: '' } }
|
||||
},
|
||||
]
|
||||
}
|
||||
arrfilterand.value = []
|
||||
filtercustom_rich.value = []
|
||||
@@ -212,6 +266,9 @@ export default defineComponent({
|
||||
async function mounted() {
|
||||
await loadCircuit()
|
||||
|
||||
if (userStore.my.username)
|
||||
groupsListAdmin.value = userStore.GroupsListWhereIAmAdmin(userStore.my.username)
|
||||
|
||||
}
|
||||
|
||||
function getImgCircuit() {
|
||||
@@ -257,6 +314,30 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
function extraparams_groups() {
|
||||
const lk_tab = 'mygroups'
|
||||
const lk_LF = 'userId'
|
||||
const lk_FF = '_id'
|
||||
const lk_as = 'group'
|
||||
const af_objId_tab = 'myId'
|
||||
|
||||
return {
|
||||
lookup1: {
|
||||
lk_tab,
|
||||
lk_LF,
|
||||
lk_FF,
|
||||
lk_as,
|
||||
af_objId_tab,
|
||||
lk_proj: {
|
||||
groupname: 1,
|
||||
title: 1,
|
||||
descr: 1,
|
||||
photos: 1,
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
function extraparams_rich() {
|
||||
return {
|
||||
querytype: shared_consts.QUERYTYPE_CIRCUIT,
|
||||
@@ -349,6 +430,10 @@ export default defineComponent({
|
||||
showonlymine,
|
||||
tabellare,
|
||||
showsaldi,
|
||||
extraparams_groups,
|
||||
filterextra_group,
|
||||
groupsListAdmin,
|
||||
groupnameSel,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -67,8 +67,10 @@
|
||||
</CSaldo>
|
||||
<div>
|
||||
<q-banner
|
||||
v-if="userStore.my.profile.calc.numGoodsAndServices <= 0 &&
|
||||
userStore.IsMyCircuitByName(circuit.name)"
|
||||
v-if="
|
||||
userStore.my.profile.calc.numGoodsAndServices <= 0 &&
|
||||
userStore.IsMyCircuitByName(circuit.name)
|
||||
"
|
||||
rounded
|
||||
class="bg-orange text-white"
|
||||
style="text-align: center"
|
||||
@@ -107,7 +109,8 @@
|
||||
</q-banner>
|
||||
|
||||
<q-btn
|
||||
v-if="userStore.my.profile.calc.numGoodsAndServices > 0 &&
|
||||
v-if="
|
||||
userStore.my.profile.calc.numGoodsAndServices > 0 &&
|
||||
!userStore.IsMyCircuitByName(circuit.name) &&
|
||||
!userStore.IsAskedCircuitByName(circuit.name) &&
|
||||
!userStore.IsRefusedCircuitByName(circuit.name)
|
||||
@@ -115,7 +118,10 @@
|
||||
icon="fas fa-user-plus"
|
||||
color="primary"
|
||||
:label="$t('circuit.ask')"
|
||||
@click="requestToEnterCircuit = true"
|
||||
@click="
|
||||
requestToEnterCircuit = true;
|
||||
groupnameSel = null;
|
||||
"
|
||||
/>
|
||||
<q-btn
|
||||
v-if="userStore.IsMyCircuitByName(circuit.name)"
|
||||
@@ -222,16 +228,100 @@
|
||||
icon="fas fa-file-word"
|
||||
></q-tab>
|
||||
<q-tab
|
||||
v-if="tools.iAmAdminCircuit(circuit.name)"
|
||||
:label="t('circuit.conticomunitari')"
|
||||
name="accounts"
|
||||
v-if="false && tools.iAmAdminCircuit(circuit.name)"
|
||||
:label="t('circuit.gruppicom')"
|
||||
name="gruppicom"
|
||||
icon="fas fa-coins"
|
||||
></q-tab>
|
||||
</q-tabs>
|
||||
|
||||
<q-tab-panels v-model="tabcircuit" animated>
|
||||
<q-tab-panel name="accounts">
|
||||
<q-tab-panel name="gruppicom">
|
||||
<div
|
||||
v-for="(group, ind) of groupsListAdmin"
|
||||
:key="ind"
|
||||
class="q-pa-sm"
|
||||
>
|
||||
<q-btn
|
||||
v-if="group.groupname &&
|
||||
!circuitStore.IsAskedCircuitByNameAndGroup(
|
||||
circuit.name,
|
||||
group.groupname
|
||||
) &&
|
||||
!userStore.IsMyCircuitByNameAndGroup(
|
||||
circuit.name,
|
||||
group.groupname
|
||||
)
|
||||
"
|
||||
icon="fas fa-user-plus"
|
||||
color="primary"
|
||||
:label="$t('circuit.ask') + ' con ' + group.groupname"
|
||||
@click="
|
||||
requestToEnterCircuit = true;
|
||||
groupnameSel = group;
|
||||
"
|
||||
/>
|
||||
<q-btn
|
||||
v-else-if="group.groupname && circuitStore.IsAskedCircuitByNameAndGroup(
|
||||
circuit.name,
|
||||
group.groupname
|
||||
) &&
|
||||
!userStore.IsMyCircuitByNameAndGroup(
|
||||
circuit.name,
|
||||
group.groupname
|
||||
)"
|
||||
icon="fas fa-user-minus"
|
||||
flat
|
||||
:label="$t('shared.cancel_ask_short')"
|
||||
@click="
|
||||
tools.cancelReqCircuit(
|
||||
$q,
|
||||
userStore.my.username,
|
||||
circuit.name,
|
||||
group.groupname,
|
||||
)
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<CTitleSec title="Lista Gruppi Comunitari" />
|
||||
|
||||
<CGridTableRec
|
||||
v-if="!loading"
|
||||
ref="tabGroups"
|
||||
prop_mytable="mygroups"
|
||||
prop_mytitle=""
|
||||
:prop_mycolumns="
|
||||
showsaldi ? colmyUserPeopleSaldi : colmyUserPeople
|
||||
"
|
||||
prop_colkey="_id"
|
||||
col_title="groupname"
|
||||
:vertical="costanti.VISUTABLE_GROUP_CIRCUIT"
|
||||
nodataLabel="Nessun Gruppo Comunitario"
|
||||
:prop_search="true"
|
||||
hint="gruppo da trovare"
|
||||
:finder="false"
|
||||
:choose_visutype="true"
|
||||
:finder_noNull="false"
|
||||
:options="shared_consts.OPTIONS_SEARCH_USER_ALL_WORDS"
|
||||
:butt_modif_new="false"
|
||||
noresultLabel="gruppo non trovato"
|
||||
:arrfilters="arrfilterand"
|
||||
:filtercustom="filtercustom"
|
||||
:filterextra="filterextra_group"
|
||||
:filterextra2="filterextra2"
|
||||
:prop_searchList="searchList"
|
||||
:showType="costanti.SHOW_GROUPINFO"
|
||||
:showCol="false"
|
||||
:circuitname="circuit.name"
|
||||
extraparams=""
|
||||
:visufind="
|
||||
tools.iAmAdminCircuit(circuit.name)
|
||||
? costanti.REQ_REMOVE_USER_TO_CIRCUIT
|
||||
: costanti.FIND_PEOPLE
|
||||
"
|
||||
>
|
||||
</CGridTableRec>
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="mov">
|
||||
<q-toggle
|
||||
@@ -418,6 +508,36 @@
|
||||
>
|
||||
</CCurrencyValue>
|
||||
</div>
|
||||
<div
|
||||
v-if="circuit.fido_scoperto_default_grp"
|
||||
class="sezioni"
|
||||
>
|
||||
<CCurrencyValue
|
||||
:symbol="tools.getSymbolByCircuit(circuit)"
|
||||
:color="tools.getColorByCircuit(circuit)"
|
||||
color_border="red"
|
||||
:value="circuit.fido_scoperto_default_grp"
|
||||
icon="fas fa-battery-quarter"
|
||||
:label="t('circuit.fido_scoperto_default_grp')"
|
||||
:tips="t('circuit.fido_scoperto_default_tips_grp')"
|
||||
>
|
||||
</CCurrencyValue>
|
||||
</div>
|
||||
<div
|
||||
v-if="circuit.fido_scoperto_default_grp"
|
||||
class="sezioni"
|
||||
>
|
||||
<CCurrencyValue
|
||||
:symbol="tools.getSymbolByCircuit(circuit)"
|
||||
:color="tools.getColorByCircuit(circuit)"
|
||||
color_border="green"
|
||||
:value="circuit.qta_max_default_grp"
|
||||
icon="fas fa-battery-quarter"
|
||||
:label="t('circuit.qta_max_default_grp')"
|
||||
:tips="t('circuit.qta_max_default_tips_grp')"
|
||||
>
|
||||
</CCurrencyValue>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sezioni">
|
||||
<q-icon name="fas fa-stats" class="iconcirc"></q-icon>
|
||||
@@ -701,6 +821,9 @@
|
||||
<!--:style="tools.displayStyles(myevent) + ` min-width: `+ tools.myheight_dialog() + `px;`">-->
|
||||
<q-toolbar-title>
|
||||
{{ circuit.name }}
|
||||
<div v-if="groupnameSel">
|
||||
Gruppo: {{ groupnameSel.groupname }}
|
||||
</div>
|
||||
</q-toolbar-title>
|
||||
<q-btn flat round color="white" icon="close" v-close-popup></q-btn>
|
||||
</q-toolbar>
|
||||
@@ -708,7 +831,9 @@
|
||||
<div v-html="t('circuit.disclaimer')"></div>
|
||||
</q-card-section>
|
||||
<q-card-section class="inset-shadow">
|
||||
<div style="font-weight: bold; font-size: 1.25rem;">Regolamento:</div>
|
||||
<div style="font-weight: bold; font-size: 1.25rem">
|
||||
Regolamento:
|
||||
</div>
|
||||
<div v-html="circuit.regulation"></div>
|
||||
</q-card-section>
|
||||
<q-card-actions align="center">
|
||||
@@ -723,7 +848,8 @@
|
||||
$q,
|
||||
userStore.my.username,
|
||||
circuit.name,
|
||||
true
|
||||
true,
|
||||
groupnameSel ? groupnameSel.groupname : ''
|
||||
);
|
||||
"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user