aktre modifiche sistemando...
This commit is contained in:
@@ -149,7 +149,7 @@ export default defineComponent({
|
||||
else if (props.table === toolsext.TABUSER)
|
||||
return userStore.getMypaginationMembers()
|
||||
else if (shared_consts.TABLES_ORDER_DATE_UPDATED.includes(props.table))
|
||||
return { sortBy: 'date_created', descending: true, page: 1, rowsNumber: 0, rowsPerPage: 10 } // date_updated
|
||||
return { sortBy: 'date_updated', descending: true, page: 1, rowsNumber: 0, rowsPerPage: 10 } // date_updated
|
||||
else if (shared_consts.TABLES_ORDER_DESCR.includes(props.table))
|
||||
return { sortBy: 'desc', descending: false, page: 1, rowsNumber: 0, rowsPerPage: 10 }
|
||||
|
||||
@@ -1159,6 +1159,8 @@ export default defineComponent({
|
||||
idStatusSkill: 1,
|
||||
idContribType: 1,
|
||||
'profile.username_telegram': 1,
|
||||
'profile.favorite': 1,
|
||||
'profile.bookmark': 1,
|
||||
idCity: 1,
|
||||
pub_to_share: 1,
|
||||
numLevel: 1,
|
||||
@@ -1228,6 +1230,8 @@ export default defineComponent({
|
||||
idStatusSkill: 1,
|
||||
idContribType: 1,
|
||||
'profile.username_telegram': 1,
|
||||
'profile.favorite': 1,
|
||||
'profile.bookmark': 1,
|
||||
idCity: 1,
|
||||
pub_to_share: 1,
|
||||
dateTimeStart: 1,
|
||||
@@ -1305,6 +1309,8 @@ export default defineComponent({
|
||||
preferences: 1,
|
||||
idContribType: 1,
|
||||
'profile.username_telegram': 1,
|
||||
'profile.favorite': 1,
|
||||
'profile.bookmark': 1,
|
||||
photos: 1,
|
||||
idCity: 1,
|
||||
pub_to_share: 1,
|
||||
@@ -1352,6 +1358,8 @@ export default defineComponent({
|
||||
idStatusSkill: 1,
|
||||
idContribType: 1,
|
||||
'profile.username_telegram': 1,
|
||||
'profile.favorite': 1,
|
||||
'profile.bookmark': 1,
|
||||
idCity: 1,
|
||||
pub_to_share: 1,
|
||||
numLevel: 1,
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
<CGridTableRec
|
||||
v-if="searchList.length > 0"
|
||||
:prop_mytable="table"
|
||||
:options="tools.optionsTable(table)"
|
||||
prop_mytitle=""
|
||||
:prop_mycolumns="col"
|
||||
:prop_colkey="prop_colkey"
|
||||
|
||||
@@ -24,7 +24,7 @@ import { useI18n } from '@/boot/i18n'
|
||||
import { toolsext } from '@store/Modules/toolsext'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { costanti } from '@costanti'
|
||||
import { ICircuit, IMyCircuit, IMyGroup, IUserFields } from 'model'
|
||||
import { IBookmark, ICircuit, IFavorite, IMyCircuit, IMyGroup, IUserFields } from 'model'
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
import { static_data } from '@/db/static_data'
|
||||
import { fieldsTable } from '@store/Modules/fieldsTable'
|
||||
@@ -53,6 +53,7 @@ export default defineComponent({
|
||||
const { getRefLink } = MixinUsers()
|
||||
|
||||
const animation = ref('fade')
|
||||
const mytab = ref('my')
|
||||
|
||||
const username = computed(() => $route.params.username ? $route.params.username.toString() : userStore.my.username)
|
||||
const idnotif = computed(() => $route.query.idnotif ? $route.query.idnotif.toString() : '')
|
||||
@@ -180,6 +181,25 @@ export default defineComponent({
|
||||
return ''
|
||||
}
|
||||
|
||||
function filtrofavorite(table: string) {
|
||||
const tab = tools.getNumTabByTable(table)
|
||||
if (myuser.value && myuser.value.profile.favorite) {
|
||||
let arrfav = myuser.value.profile.favorite.filter((rec: IBookmark) => rec.tab === tab)
|
||||
if (arrfav)
|
||||
return myuser.value.profile.favorite ? [{ _id: { $in: arrfav.map((rec: any) => rec.id) } }] : []
|
||||
}
|
||||
return []
|
||||
}
|
||||
function filtrobookmark(table: string) {
|
||||
const tab = tools.getNumTabByTable(table)
|
||||
if (myuser.value && myuser.value.profile.bookmark) {
|
||||
let arrfav = myuser.value.profile.bookmark.filter((rec: IBookmark) => rec.tab === tab)
|
||||
if (arrfav)
|
||||
return myuser.value.profile.bookmark ? [{ _id: { $in: arrfav.map((rec: any) => rec.id) } }] : []
|
||||
}
|
||||
return []
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
@@ -194,6 +214,8 @@ export default defineComponent({
|
||||
getLinkUserTelegram,
|
||||
getLinkWebSite,
|
||||
filtroutente,
|
||||
filtrofavorite,
|
||||
filtrobookmark,
|
||||
showPic,
|
||||
myusername,
|
||||
userStore,
|
||||
@@ -212,6 +234,7 @@ export default defineComponent({
|
||||
listcircuitsfiltered,
|
||||
optionsMainCards,
|
||||
getlinkpage,
|
||||
mytab,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -61,7 +61,7 @@ export default defineComponent({
|
||||
|
||||
function load() {
|
||||
// Carica il profilo di quest'utente
|
||||
if (props.idRec && props.idRec > 0) {
|
||||
if (props.idRec) {
|
||||
userStore.loadGeneric(props.table, props.idRec, idnotif.value).then((ris) => {
|
||||
myrec.value = ris
|
||||
notifStore.setAsRead(idnotif.value)
|
||||
|
||||
@@ -61,7 +61,7 @@ export default defineComponent({
|
||||
|
||||
function load() {
|
||||
// Carica il profilo di quest'utente
|
||||
if (props.idRec && props.idRec > 0) {
|
||||
if (props.idRec) {
|
||||
userStore.loadGeneric(props.table, props.idRec, idnotif.value).then((ris) => {
|
||||
myrec.value = ris
|
||||
notifStore.setAsRead(idnotif.value)
|
||||
|
||||
@@ -1,77 +1,177 @@
|
||||
<!--suppress ALL -->
|
||||
<template>
|
||||
<div class="q-py-xs centermydiv cardrec"
|
||||
:style="`max-width: `+ (tools.getwidth($q) - 20) +`px; ` + ($q.screen.lt.sm ? (`min-width: `+ (tools.getwidth($q) - (20 + margin_right)) +`px;`) : ``)">
|
||||
<q-item v-if="myrec" clickable v-ripple :class="`shadow-2 q-btn--rounded ` + ($q.dark.isActive ? `bg-black`: `bg-teal-1`)">
|
||||
|
||||
|
||||
|
||||
<q-item-section v-if="(shared_consts.TABLES_VISU_IMG.includes(table)) && (myrec.photos && myrec.photos.length > 0)" avatar
|
||||
@click="cmdExt(costanti.CMD_SHOW_PAGE, myrec)">
|
||||
<q-badge v-if="showBadge()" class="q-my-xs self-center" :color="fieldsTable.getColByAdType(myrec.adType)">
|
||||
<div
|
||||
class="q-py-xs centermydiv cardrec"
|
||||
:style="
|
||||
`max-width: ` +
|
||||
(tools.getwidth($q) - 20) +
|
||||
`px; ` +
|
||||
($q.screen.lt.sm
|
||||
? `min-width: ` + (tools.getwidth($q) - (20 + margin_right)) + `px;`
|
||||
: ``)
|
||||
"
|
||||
>
|
||||
<q-item v-if="myrec" clickable v-ripple :class="`shadow-2 butt_rounded `">
|
||||
<q-item-section
|
||||
v-if="
|
||||
shared_consts.TABLES_VISU_IMG.includes(table) &&
|
||||
myrec.photos &&
|
||||
myrec.photos.length > 0
|
||||
"
|
||||
avatar
|
||||
@click="cmdExt(costanti.CMD_SHOW_PAGE, myrec)"
|
||||
>
|
||||
<q-badge
|
||||
v-if="showBadge()"
|
||||
class="q-my-xs self-center"
|
||||
:color="fieldsTable.getColByAdType(myrec.adType)"
|
||||
>
|
||||
{{ fieldsTable.getValByTabAndId(table, 'adType', myrec.adType) }}
|
||||
<q-icon :name="fieldsTable.getIconByAdType(myrec.adType)" color="white"
|
||||
class="q-ml-xs"/>
|
||||
<q-icon
|
||||
:name="fieldsTable.getIconByAdType(myrec.adType)"
|
||||
color="white"
|
||||
class="q-ml-xs"
|
||||
/>
|
||||
</q-badge>
|
||||
|
||||
<q-avatar size="60px">
|
||||
<q-img :src="tools.getFullFileName(myrec.photos, table, myrec.username, '')" :alt="myrec.descr"
|
||||
img-class="imgprofile" height="60px"/>
|
||||
<q-img
|
||||
:src="
|
||||
tools.getFullFileName(myrec.photos, table, myrec.username, '')
|
||||
"
|
||||
:alt="myrec.descr"
|
||||
img-class="imgprofile"
|
||||
height="60px"
|
||||
/>
|
||||
</q-avatar>
|
||||
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section v-else avatar @click="naviga(`/my/` + myrec.username)">
|
||||
|
||||
<q-badge v-if="showBadge()" class="q-my-xs self-center" :color="fieldsTable.getColByAdType(myrec.adType)">
|
||||
<q-badge
|
||||
v-if="showBadge()"
|
||||
class="q-my-xs self-center"
|
||||
:color="fieldsTable.getColByAdType(myrec.adType)"
|
||||
>
|
||||
{{ fieldsTable.getValByTabAndId(table, 'adType', myrec.adType) }}
|
||||
<q-icon :name="fieldsTable.getIconByAdType(myrec.adType)" color="white"
|
||||
class="q-ml-xs"/>
|
||||
<q-icon
|
||||
:name="fieldsTable.getIconByAdType(myrec.adType)"
|
||||
color="white"
|
||||
class="q-ml-xs"
|
||||
/>
|
||||
</q-badge>
|
||||
<q-avatar size="60px">
|
||||
<q-img :src="getImgUser(myrec)" :alt="myrec.username" img-class="imgprofile" height="60px"/>
|
||||
<q-img
|
||||
:src="getImgUser(myrec)"
|
||||
:alt="myrec.username"
|
||||
img-class="imgprofile"
|
||||
height="60px"
|
||||
/>
|
||||
</q-avatar>
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section @click="navigaExt(myrec)">
|
||||
<q-item-label lines="2" class="full-width" >
|
||||
<span v-for="(rec, ind) of tools.getArrSubSector(table, myrec)" :key="ind">
|
||||
<q-chip dense class="text-center shadow-5 glossy text-white bg-green">{{ rec.descr }}</q-chip>
|
||||
<q-item-label lines="2" class="full-width">
|
||||
<span
|
||||
v-for="(rec, ind) of tools.getArrSubSector(table, myrec)"
|
||||
:key="ind"
|
||||
>
|
||||
<q-chip
|
||||
dense
|
||||
class="text-center shadow-5 glossy text-white bg-green"
|
||||
>{{ rec.descr }}</q-chip
|
||||
>
|
||||
</span>
|
||||
<span>
|
||||
<span v-for="(rec, ind) of tools.getArrSector(table, myrec)" :key="ind">
|
||||
<q-chip dense class="text-center shadow-5 glossy text-white bg-blue">{{ rec.descr }}</q-chip></span>
|
||||
<span
|
||||
v-for="(rec, ind) of tools.getArrSector(table, myrec)"
|
||||
:key="ind"
|
||||
>
|
||||
<q-chip
|
||||
dense
|
||||
class="text-center shadow-5 glossy text-white bg-blue"
|
||||
>{{ rec.descr }}</q-chip
|
||||
></span
|
||||
>
|
||||
</span>
|
||||
|
||||
|
||||
<!--<span class="dateevent" v-if="myrec.dateTimeStart">dal <span class="datainizio">{{tools.getstrVeryShortDate(myrec.dateStart) }}</span> al <span class="datafine">{{ tools.getstrVeryShortDate(myrec.dateEnd) }}</span>
|
||||
</span>-->
|
||||
</q-item-label>
|
||||
<q-item-label lines="4" v-if="myrec.descr">{{ myrec.descr }}<br>
|
||||
<q-item-label lines="4" v-if="myrec.descr"
|
||||
>{{ myrec.descr }}<br />
|
||||
</q-item-label>
|
||||
<q-item-label lines="2" style="text-align: right" class="text_user_city">
|
||||
<span class="text-weight-bold">{{ tools.getNameToShow(myrec) }}</span> -
|
||||
<span v-for="(rec, ind) of myrec.mycities" :key="ind"><span v-if="ind > 0">, </span>{{ rec.comune }} ({{ rec.prov }})</span>
|
||||
<q-item-label lines="1" style="" class="text_user_city">
|
||||
<div class="row justify-between">
|
||||
<div class="text-weight-bold text-italic">
|
||||
{{ tools.getNameToShow(myrec) }}
|
||||
</div>
|
||||
<div class="q-mx-sm">
|
||||
(<span class="">{{ myrec.myfav.length }}</span>
|
||||
<span class="q-mx-xxs"
|
||||
><q-icon
|
||||
dense
|
||||
color="red"
|
||||
:name="
|
||||
userStore.isFavorite(myrec._id, table)
|
||||
? 'favorite'
|
||||
: 'far fa-heart'
|
||||
"
|
||||
/>
|
||||
</span>
|
||||
<span class="q-mx-xxs"> </span
|
||||
><span class="">{{ myrec.mybook.length }}</span>
|
||||
<span class="q-mx-xxs"
|
||||
><q-icon
|
||||
dense
|
||||
color="teal"
|
||||
:name="
|
||||
userStore.isBookmarked(myrec._id, table)
|
||||
? 'bookmark'
|
||||
: 'far fa-bookmark'
|
||||
"
|
||||
/>
|
||||
</span>
|
||||
)
|
||||
</div>
|
||||
</div>
|
||||
</q-item-label>
|
||||
|
||||
<q-item-label
|
||||
lines="1"
|
||||
style="text-align: right"
|
||||
class="text_user_city"
|
||||
>
|
||||
<span v-for="(rec, ind) of myrec.mycities" :key="ind"
|
||||
><span v-if="ind > 0">, </span>{{ rec.comune }} ({{
|
||||
rec.prov
|
||||
}})</span
|
||||
>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side v-if="tools.canModifyThisRec(myrec) || editOn">
|
||||
<q-item-label>
|
||||
<q-btn rounded dense icon="fas fa-pencil-alt">
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item clickable v-close-popup
|
||||
@click="cmdExt(costanti.CMD_MODIFY, myrec._id)">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="cmdExt(costanti.CMD_MODIFY, myrec._id)"
|
||||
>
|
||||
<q-item-section side>
|
||||
<q-icon name="fas fa-pencil-alt"/>
|
||||
<q-icon name="fas fa-pencil-alt" />
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('reg.edit') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item clickable v-close-popup @click="cmdExt(costanti.CMD_DELETE, myrec._id)">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="cmdExt(costanti.CMD_DELETE, myrec._id)"
|
||||
>
|
||||
<q-item-section side>
|
||||
<q-icon name="fas fa-trash-alt"/>
|
||||
<q-icon name="fas fa-trash-alt" />
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('reg.elimina') }}</q-item-section>
|
||||
</q-item>
|
||||
@@ -80,11 +180,9 @@
|
||||
</q-btn>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
|
||||
</q-item>
|
||||
<q-separator inset="item"/>
|
||||
<q-separator inset="item" />
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CMyRecCard.ts">
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<q-item-label v-if="labelFooter" lines="1"
|
||||
><em>{{ labelFooter }}</em></q-item-label
|
||||
>
|
||||
<span v-if="contact.profile.resid_province" class="show_province_title">Prov: <span class="show_province">{{ contact.profile.resid_province }}</span></span>
|
||||
<span v-if="contact.profile && contact.profile.resid_province" class="show_province_title">Prov: <span class="show_province">{{ contact.profile.resid_province }}</span></span>
|
||||
<q-item-label v-if="contact.account" caption lines="2">
|
||||
<CSaldo
|
||||
:small="true"
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
label="Circuito"
|
||||
>
|
||||
</q-select>
|
||||
<div v-else>Circuito: {{ circuitname }}</div>
|
||||
<div v-else>{{ circuitname }}</div>
|
||||
|
||||
<q-banner
|
||||
rounded
|
||||
|
||||
@@ -115,6 +115,8 @@ export default defineComponent({
|
||||
idStatusSkill: 1,
|
||||
idContribType: 1,
|
||||
'profile.username_telegram': 1,
|
||||
'profile.favorite': 1,
|
||||
'profile.bookmark': 1,
|
||||
idCity: 1,
|
||||
pub_to_share: 1,
|
||||
numLevel: 1,
|
||||
@@ -155,6 +157,8 @@ export default defineComponent({
|
||||
idStatusSkill: 1,
|
||||
idContribType: 1,
|
||||
'profile.username_telegram': 1,
|
||||
'profile.favorite': 1,
|
||||
'profile.bookmark': 1,
|
||||
idCity: 1,
|
||||
pub_to_share: 1,
|
||||
numLevel: 1,
|
||||
@@ -195,6 +199,8 @@ export default defineComponent({
|
||||
idStatusSkill: 1,
|
||||
idContribType: 1,
|
||||
'profile.username_telegram': 1,
|
||||
'profile.favorite': 1,
|
||||
'profile.bookmark': 1,
|
||||
idCity: 1,
|
||||
pub_to_share: 1,
|
||||
numLevel: 1,
|
||||
@@ -259,6 +265,8 @@ export default defineComponent({
|
||||
idStatusSkill: 1,
|
||||
idContribType: 1,
|
||||
'profile.username_telegram': 1,
|
||||
'profile.favorite': 1,
|
||||
'profile.bookmark': 1,
|
||||
idCity: 1,
|
||||
pub_to_share: 1,
|
||||
numLevel: 1,
|
||||
@@ -300,6 +308,8 @@ export default defineComponent({
|
||||
idStatusSkill: 1,
|
||||
idContribType: 1,
|
||||
'profile.username_telegram': 1,
|
||||
'profile.favorite': 1,
|
||||
'profile.bookmark': 1,
|
||||
idCity: 1,
|
||||
pub_to_share: 1,
|
||||
numLevel: 1,
|
||||
@@ -341,6 +351,8 @@ export default defineComponent({
|
||||
idStatusSkill: 1,
|
||||
idContribType: 1,
|
||||
'profile.username_telegram': 1,
|
||||
'profile.favorite': 1,
|
||||
'profile.bookmark': 1,
|
||||
idCity: 1,
|
||||
pub_to_share: 1,
|
||||
numLevel: 1,
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
:prop_mytitle="title"
|
||||
:prop_mycolumns="col"
|
||||
:prop_colkey="prop_colkey"
|
||||
:options="tools.optionsTable(table)"
|
||||
:col_title="col_title"
|
||||
:col_footer="col_footer"
|
||||
:vertical="costanti.VISUTABLE_LISTA"
|
||||
|
||||
Reference in New Issue
Block a user