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,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user