Revert "Aggiornamento a 0.6.1"

This reverts commit 701e1f1968.
This commit is contained in:
Surya Paolo
2023-04-07 18:01:09 +02:00
parent 0365c58326
commit e47772ab34
14 changed files with 812 additions and 1 deletions

View File

@@ -68,7 +68,7 @@ export default defineComponent({
})
function created() {
console.log('created CAccomodation', props.mylist)
// console.log('created CAccomodation', props.mylist)
if (isValid(props.mylist)) {
// @ts-ignore
let myarr: any = props.mylist

View File

@@ -1102,6 +1102,18 @@
:prop_myrec="myrecdialog"
>
</CMyCardCircuitPopup>
<<<<<<< HEAD
=======
<CMyCardService v-else-if="mytable === 'myskills'"
:table="mytable" :prop_myrec="myrecdialog">
</CMyCardService>
<CMyCardService v-else-if="mytable === 'mygoods'"
:table="mytable" :prop_myrec="myrecdialog">
</CMyCardService>
<CMyCardService v-else-if="mytable === 'myhosps'"
:table="mytable" :prop_myrec="myrecdialog">
</CMyCardService>
>>>>>>> parent of 701e1f1 (Aggiornamento a 0.6.1)
<CMyCardPopup v-else :table="mytable" :prop_myrec="myrecdialog">
</CMyCardPopup>
</q-dialog>

View File

@@ -91,6 +91,7 @@
myclass="myshad"
:canopen="true"
>
<<<<<<< HEAD
<div v-for="(card, ind) of mycards" :key="ind" :name="card.table">
<q-card class="q-my-md">
<div v-if="card.table === 'mygroups'">
@@ -104,6 +105,75 @@
<CMyGroup
:mygrp="grp"
:visu="costanti.USER_GROUPS"
=======
<q-tabs
v-model="mytab"
inline-label
dense
class="text-black shadow-2"
>
<q-tab name="my" icon="far fa-user" />
<q-tab name="favorite" icon="far fa-heart" />
<q-tab name="bookmark" icon="far fa-bookmark" />
</q-tabs>
<q-tab-panels
v-model="mytab"
animated
swipeable
vertical
transition-prev="jump-up"
transition-next="jump-up"
>
<q-tab-panel name="my">
<div
v-for="(card, ind) of mycards"
:key="ind"
:name="card.table"
>
<q-card class="q-my-md">
<div v-if="card.table === 'mygroups'">
<q-list>
<span
v-for="(grp, index) in listgroupsfiltered"
:key="index"
class="q-my-sm q-mx-none"
clickable
>
<CMyGroup
:mygrp="grp"
:visu="costanti.USER_GROUPS"
:noaut="true"
>
</CMyGroup>
</span>
</q-list>
</div>
<div v-else-if="card.table === 'circuits'">
<div class="text-h6">{{ card.title }}</div>
<q-list>
<span
v-for="(circuit, index) in listcircuitsfiltered"
:key="index"
class="q-my-sm q-mx-none"
clickable
>
<CMyCircuit
:mycircuit="circuit"
:visu="costanti.USER_CIRCUITS"
:noaut="true"
>
</CMyCircuit>
</span>
</q-list>
</div>
<div v-else>
<CSkill
:table="card.table"
:filtercustom="filtroutente"
:butt_modif_new="isMyRecord(myuser.username)"
:visuinpage="true"
>>>>>>> parent of 701e1f1 (Aggiornamento a 0.6.1)
:noaut="true"
>
</CMyGroup>

View File

@@ -0,0 +1,197 @@
import { computed, defineComponent, onMounted, PropType, ref, watch } from 'vue'
import { CMyFieldDb } from '@/components/CMyFieldDb'
import { CTitleBanner } from '@/components/CTitleBanner'
import { CProfile } from '@/components/CProfile'
import { CDateTime } from '@/components/CDateTime'
import { CMyPage } from '@/components/CMyPage'
import { CMyChipList } from '@/components/CMyChipList'
import { CMyFieldRec } from '@/components/CMyFieldRec'
import { CMyUser } from '@/components/CMyUser'
import { CGalleryImages } from '@/components/CGalleryImages'
import { CAccomodation } from '@/components/CAccomodation'
import { tools } from '@store/Modules/tools'
import { useUserStore } from '@store/UserStore'
import { useCalendarStore } from '@store/CalendarStore'
import { useGlobalStore } from '@store/globalStore'
import { useI18n } from '@/boot/i18n'
import { toolsext } from '@store/Modules/toolsext'
import { useQuasar } from 'quasar'
import { costanti } from '@costanti'
import { IColGridTable, IImgGallery, IUserFields } from 'model'
import { shared_consts } from '@/common/shared_vuejs'
import { colCitys, fieldsTable } from '@store/Modules/fieldsTable'
import { useRoute, useRouter } from 'vue-router'
import { useNotifStore } from '@store/NotifStore'
export default defineComponent({
name: 'CMyCardService',
components: {
CProfile, CTitleBanner,
CMyFieldDb, CDateTime, CMyPage, CMyFieldRec, CAccomodation,
CMyUser, CGalleryImages, CMyChipList
},
props: {
table: {
type: String,
required: true,
},
prop_myrec: {
type: Object as PropType<any>,
required: false,
default: null,
},
idRec: {
type: Number,
required: false,
default: 0
},
nopopup: {
type: Boolean,
required: false,
default: false
},
},
setup(props) {
const userStore = useUserStore()
const calendarStore = useCalendarStore()
const notifStore = useNotifStore()
const globalStore = useGlobalStore()
const $q = useQuasar()
const $route = useRoute()
const { t } = useI18n()
const showPic = ref(false)
const $router = useRouter()
const usersList = ref({ show: false, title: '', list: [] })
const myrec = ref(<any>{})
const col = ref(<IColGridTable>{})
const idnotif = computed(() => $route.query.idnotif ? $route.query.idnotif.toString() : '')
function profile() {
return userStore.my.profile
}
function load() {
// Carica il profilo di quest'utente
if (props.idRec) {
userStore.loadGeneric(props.table, props.idRec, idnotif.value).then((ris) => {
myrec.value = ris
notifStore.setAsRead(idnotif.value)
})
} else {
myrec.value = props.prop_myrec
}
col.value = fieldsTable.getArrColsByTable(props.table)
}
watch(() => props.idRec, (to: any, from: any) => {
load()
})
function mounted() {
load()
}
function getlinkpage() {
return self.location.host + tools.getPathByTable(props.table, myrec.value._id)
}
function condividipag() {
const mystr = getlinkpage()
tools.copyStringToClipboard($q, mystr, true)
tools.sendMsgTelegramCmd($q, t, shared_consts.MsgTeleg.SHARE_TEXT, false, mystr)
return true
}
function showBadge() {
if (shared_consts.TABLES_SHOW_ADTYPE.includes(props.table)) {
return true
}
return false
}
function getRecGoodSkillByRec(rec: any) {
if (props.table === 'myskills')
return rec.recSkill
else if (props.table === 'mygoods')
return rec.recGood
return null
}
function getSectorByRec(rec: any) {
if (props.table === 'myskills')
return rec.sector
else if (props.table === 'mygoods')
return rec.sectorGood
return null
}
function clicca(tipo: any, set: any, title: string) {
if (set && myrec.value.username !== userStore.my.username && tipo === costanti.TIPOFAVBOOK.FAVORITE) {
userStore.setFavorite($q, t, myrec.value._id, props.table, myrec.value);
}
if (set && myrec.value.username !== userStore.my.username && tipo === costanti.TIPOFAVBOOK.BOOKMARK) {
userStore.setBookmark($q, t, myrec.value._id, props.table, myrec.value);
}
if (!set) {
usersList.value.show = true;
usersList.value.title = title;
usersList.value.list = myrec.value.myfav;
}
}
function naviga(path: string) {
$router.push(path)
}
function getTypeHosps() {
let obj = null
if (myrec.value.typeHosp) {
obj = globalStore.getRecordByTableSingle(toolsext.TABTYPEHOSP, myrec.value.typeHosp)
if (obj)
return obj.label
}
return obj
}
onMounted(mounted)
return {
profile,
tools,
costanti,
myrec,
shared_consts,
globalStore,
showPic,
userStore,
t,
fieldsTable,
colCitys,
toolsext,
col,
condividipag,
showBadge,
getlinkpage,
calendarStore,
getSectorByRec,
getRecGoodSkillByRec,
usersList,
clicca,
naviga,
getTypeHosps,
}
}
})

View File

@@ -0,0 +1,433 @@
<template>
<div v-if="myrec && myrec._id" class="fulldiv">
<div class="q-pa-sm row items-start q-gutter-sm full-height fulldiv">
<q-card class="my-card fulldiv" bordered>
<CGalleryImages
v-if="myrec.photos.length > 0"
:imgGallery="myrec.photos"
:directory="'upload/' + tools.getDirectoryGall(myrec, table, '')"
>
</CGalleryImages>
<q-card-actions align="right">
<div class="">
<q-btn
flat
round
:color="userStore.isFavorite(myrec._id, table) ? 'red' : ''"
icon="favorite"
@click="clicca(costanti.TIPOFAVBOOK.FAVORITE, true)"
>
<q-badge
v-if="myrec.myfav"
color="primary"
:label="myrec.myfav.length"
floating
transparent
/>
</q-btn>
</div>
<div class="">
<q-btn
flat
round
:color="userStore.isBookmarked(myrec._id, table) ? 'teal' : ''"
icon="bookmark"
@click="clicca(costanti.TIPOFAVBOOK.BOOKMARK, true)"
>
<q-badge
v-if="myrec.mybook"
color="primary"
:label="myrec.mybook.length"
floating
transparent
/>
</q-btn>
</div>
<div>
<q-btn
flat
round
color="primary"
icon="share"
@click="tools.copyToClip($q, getlinkpage(), true)"
/>
</div>
<div>
<q-btn flat round icon="fas fa-ellipsis-h">
<q-menu>
<q-list v-if="true" style="min-width: 150px">
<q-item
v-if="!nopopup"
clickable
v-close-popup
@click="naviga(tools.getPathByTableAndRec(table, myrec))"
>
<q-item-section avatar>
<q-icon color="blue" name="fas fa-globe" />
</q-item-section>
<q-item-section>
{{ $t('event.openpage') }}
</q-item-section>
</q-item>
<q-separator />
<q-item
clickable
v-close-popup
@click="
clicca(
costanti.TIPOFAVBOOK.FAVORITE,
false,
$t('cmd.favorite')
)
"
>
<q-item-section avatar>
<q-icon color="red" name="favorite" />
</q-item-section>
<q-item-section>
{{ $t('cmd.favorite') }}
</q-item-section>
</q-item>
<q-item
clickable
v-close-popup
@click="
clicca(
costanti.TIPOFAVBOOK.BOOKMARK,
false,
$t('cmd.bookmark')
)
"
>
<q-item-section avatar>
<q-icon color="teal" name="bookmark" />
</q-item-section>
<q-item-section>
{{ $t('cmd.bookmark') }}
</q-item-section>
</q-item>
</q-list>
</q-menu>
</q-btn>
</div>
</q-card-actions>
<q-separator />
<q-list>
<q-item clickable>
<q-item-section avatar>
<div v-if="showBadge()" class="text-center">
<q-chip
dense
:color="fieldsTable.getColByAdType(myrec.adType)"
text-color="white"
>{{
fieldsTable.getValByTabAndId(table, 'adType', myrec.adType)
}}
</q-chip>
</div>
</q-item-section>
<q-item-section>
<q-item-label v-if="myrec.typeHosp" class="text-bold text-h7">
<q-chip dense color="green" text-color="white"
>{{ getTypeHosps() }}
</q-chip>
</q-item-label>
<q-item-label class="text-bold text-h7">{{
myrec.descr
}}</q-item-label>
</q-item-section>
</q-item>
<q-item v-if="getSectorByRec(myrec)">
<q-item-section avatar>
<q-icon color="blue" name="category" />
</q-item-section>
<q-item-section>
<q-item-label>
<q-chip
v-if="getSectorByRec(myrec) && getSectorByRec(myrec)[0].descr"
class="glossy"
color="blue"
text-color="white"
dense
>
<span class="cal__quota-content">{{
getSectorByRec(myrec)[0].descr
}}</span>
</q-chip>
<q-chip
v-if="
getRecGoodSkillByRec(myrec) &&
getRecGoodSkillByRec(myrec).length > 0 &&
getRecGoodSkillByRec(myrec)[0].descr
"
class="glossy"
dense
color="blue"
text-color="white"
>
<span class="cal__quota-content">{{
getRecGoodSkillByRec(myrec)[0].descr
}}</span>
</q-chip>
</q-item-label>
</q-item-section>
</q-item>
<q-item v-if="myrec.numMaxPeopleHosp" class="q-mt-sm">
<q-item-section avatar>
<q-icon color="blue" name="fas fa-users" />
</q-item-section>
<q-item-section>
<q-item-label class="q-px-xs q-ma-xs">
<span class="accom_maxosp">{{ myrec.numMaxPeopleHosp }}</span
>{{ t('hosps.numMaxPeopleHosp') }}
</q-item-label>
</q-item-section>
</q-item>
<q-item v-if="!!myrec.accomodation && myrec.accomodation.length > 0">
<q-item-section avatar>
<q-icon color="orange" name="fas fa-bed" />
</q-item-section>
<q-item-section>
<q-item-label>
<CAccomodation
v-if="!!myrec.accomodation"
:mylist="myrec.accomodation"
:isInModif="false"
:edit="false"
:canModify="false"
>
</CAccomodation>
</q-item-label>
</q-item-section>
</q-item>
<q-item v-if="!!myrec.preferences && myrec.preferences.length > 0">
<q-item-section avatar>
<q-icon color="red" name="fas fa-asterisk" />
</q-item-section>
<q-item-section>
<q-item-label>
<CMyChipList
:rec="myrec"
:type="costanti.FieldType.multiselect"
:value="myrec.preferences"
:options="
globalStore.getTableJoinByName(
toolsext.TABPREF,
false,
false,
null
)
"
:optval="fieldsTable.getKeyByTable(toolsext.TABPREF)"
:optlab="fieldsTable.getLabelByTable(toolsext.TABPREF)"
:opticon="fieldsTable.getIconByTable(toolsext.TABPREF)"
></CMyChipList>
</q-item-label>
</q-item-section>
</q-item>
<q-separator />
<q-item-label v-if="myrec.note"
><div v-html="myrec.note" class="clBorderService"></div
></q-item-label>
<q-card class="my-card clBorderUser" bordered>
<CMyUser
:mycontact="myrec"
:visu="costanti.FIND_PEOPLE"
@setCmd="tools.setCmd"
>
</CMyUser>
</q-card>
<q-item v-if="myrec.mycities[0].comune">
<q-item-section avatar>
<q-icon color="amber" name="fas fa-map-marker-alt" />
</q-item-section>
<q-item-section>
<q-item-label>
<span v-for="(city, index) in myrec.mycities" :key="index">
<span v-if="city.comune">
{{ city.comune }} ({{ city.prov }})</span
><span v-if="myrec.mycities.length > 1"> - </span>
</span>
</q-item-label>
<q-item-label v-if="myrec.profile.qualifica" caption>{{
myrec.biografia
}}</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-if="myrec.website">
<q-item-section avatar>
<q-icon color="blue" name="fas fa-globe" />
</q-item-section>
<q-item-section>
<q-item-label lines="1">
<span
v-html="
tools.getlinkhref(myrec.website, 'Visita il Sito Web')
"
/></q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-if="myrec.link_maplocation">
<q-item-section avatar>
<q-icon color="blue" name="fas fa-map-marker-alt" />
</q-item-section>
<q-item-section>
<q-item-label lines="1">
<span
v-html="
tools.getlinkhref(myrec.link_maplocation, 'Apri Mappa')
"
/></q-item-label>
</q-item-section>
</q-item>
<q-item v-if="myrec.idContribType && myrec.idContribType.length > 0">
<q-item-section avatar>
<q-icon color="green" name="fas fa-hand-holding" />
</q-item-section>
<q-item-section>
<q-item-label>
<span
v-for="(reccontr, index) in myrec.idContribType"
:key="index"
>
<q-chip
dense
:color="calendarStore.getColByContribType(reccontr)"
text-color="white"
>
{{ calendarStore.getContribtypeById(reccontr) }}
</q-chip>
</span>
</q-item-label>
</q-item-section>
</q-item>
<q-item>
<q-item-section avatar>
<q-icon color="blue" name="far fa-edit" />
</q-item-section>
<q-item-section>
<q-item-label
><span v-if="myrec.date_updated">{{
tools.getstrDateMonthLong(myrec.date_updated)
}}</span
><span v-else>{{
tools.getstrDateMonthLong(myrec.date_created)
}}</span></q-item-label
>
</q-item-section>
</q-item>
<q-item clickable v-if="false">
<q-item-section avatar>
<q-icon color="red" name="local_gas_station" />
</q-item-section>
<q-item-section>
<q-item-label></q-item-label>
<q-item-label caption>Fill your gas tank.</q-item-label>
</q-item-section>
</q-item>
</q-list>
<q-separator />
<div class="q-mb-xl"></div>
<q-card-actions
v-if="$q.screen.gt.sm || nopopup"
class="text-center justify-center"
>
<q-btn
v-if="myrec.profile.username_telegram"
:label="$t('dialog.contact')"
color="primary"
icon="far fa-comment"
target="_blank"
:type="tools.isUserOk() ? 'a' : 'btn'"
size="md"
rounded
:href="
tools.isUserOk()
? tools.getHttpForTelegram(myrec.profile.username_telegram)
: null
"
/>
<q-btn
v-if="!nopopup"
rounded
outline
:label="$t('dialog.close')"
color="primary"
icon="close"
v-close-popup
/>
</q-card-actions>
</q-card>
<div
v-if="!$q.screen.gt.sm || !nopopup"
class="row absolute-bottom text-shadow custom-caption q-px-md buttons_bottom"
>
<q-btn
v-if="myrec.profile.username_telegram"
:label="$t('dialog.contact')"
color="primary"
icon="far fa-comment"
target="_blank"
:type="tools.isUserOk() ? 'a' : 'btn'"
size="md"
rounded
:href="
tools.isUserOk()
? tools.getHttpForTelegram(myrec.profile.username_telegram)
: null
"
/>
<q-btn
v-if="!nopopup"
rounded
outline
:label="$t('dialog.close')"
color="primary"
icon="close"
v-close-popup
/>
</div>
</div>
</div>
<q-dialog v-model="usersList.show">
<q-card class="dialog_card">
<q-toolbar class="bg-primary text-white">
<q-toolbar-title>
{{ usersList.title }}
</q-toolbar-title>
<q-btn flat round color="white" icon="close" v-close-popup></q-btn>
</q-toolbar>
<q-card-section class="inset-shadow">
<div v-for="(rec, i) in usersList.list" :key="i">
<CMyUser
:mycontact="rec"
:visu="costanti.FIND_PEOPLE"
@setCmd="tools.setCmd"
>
</CMyUser>
</div>
</q-card-section>
</q-card>
</q-dialog>
</template>
<script lang="ts" src="./CMyCardService.ts">
</script>
<style lang="scss" scoped>
@import './CMyCardService.scss';
</style>