This commit is contained in:
paoloar77
2022-02-03 00:33:05 +01:00
parent d7480fd489
commit 124cb5cc64
96 changed files with 1944 additions and 2611 deletions

View File

@@ -70,6 +70,19 @@
</CTitleBanner>
<CTitleBanner
class="q-pa-xs" title="Competenze e Talenti" bgcolor="bg-primary" clcolor="text-white"
myclass="myshad" :canopen="true">
<CSkill
:filtercustom="filtroutente">
</CSkill>
</CTitleBanner>
<CTitleBanner
class="q-pa-xs" title="Informazioni su di te" bgcolor="bg-primary" clcolor="text-white"
myclass="myshad" :canopen="true">
@@ -159,76 +172,64 @@
</CTitleBanner>
<CTitleBanner
class="q-pa-xs" title="Competenze e Talenti" bgcolor="bg-primary" clcolor="text-white"
myclass="myshad" :canopen="true">
<CSkill
:filtercustom="filtroutente">
</CSkill>
</CTitleBanner>
<!--
<div class="column">
<div class="myrow">
<CMyFieldDb
title="Motivazioni"
table="users"
mykey="profile"
mysubkey="motivazioni"
:type="costanti.FieldType.string">
</CMyFieldDb>
</div>
<div class="myrow">
<CMyFieldDb
title="Competenze e Professionalità"
table="users"
mykey="profile"
mysubkey="competenze_professionalita"
:type="costanti.FieldType.string">
</CMyFieldDb>
</div>
<div class="myrow">
<CMyFieldDb
title="Cosa potrei offrire?"
table="users"
mykey="profile"
mysubkey="cosa_offrire"
:type="costanti.FieldType.string">
</CMyFieldDb>
</div>
<div class="myrow">
<CMyFieldDb
title="Cosa vorrei ricevere?"
table="users"
mykey="profile"
mysubkey="cosa_ricevere"
:type="costanti.FieldType.string">
</CMyFieldDb>
</div>
<div class="myrow">
<CMyFieldDb
title="Altre Comunicazioni"
table="users"
mykey="profile"
mysubkey="altre_comunicazioni"
:type="costanti.FieldType.string">
</CMyFieldDb>
</div>
<div class="myrow">
<CMyFieldDb
title="Come ci hai conosciuto?"
table="users"
mykey="profile"
mysubkey="come_ci_hai_conosciuto"
:type="costanti.FieldType.string">
</CMyFieldDb>
</div>
<!--
<div class="column">
<div class="myrow">
<CMyFieldDb
title="Motivazioni"
table="users"
mykey="profile"
mysubkey="motivazioni"
:type="costanti.FieldType.string">
</CMyFieldDb>
</div>
-->
<div class="myrow">
<CMyFieldDb
title="Competenze e Professionalità"
table="users"
mykey="profile"
mysubkey="competenze_professionalita"
:type="costanti.FieldType.string">
</CMyFieldDb>
</div>
<div class="myrow">
<CMyFieldDb
title="Cosa potrei offrire?"
table="users"
mykey="profile"
mysubkey="cosa_offrire"
:type="costanti.FieldType.string">
</CMyFieldDb>
</div>
<div class="myrow">
<CMyFieldDb
title="Cosa vorrei ricevere?"
table="users"
mykey="profile"
mysubkey="cosa_ricevere"
:type="costanti.FieldType.string">
</CMyFieldDb>
</div>
<div class="myrow">
<CMyFieldDb
title="Altre Comunicazioni"
table="users"
mykey="profile"
mysubkey="altre_comunicazioni"
:type="costanti.FieldType.string">
</CMyFieldDb>
</div>
<div class="myrow">
<CMyFieldDb
title="Come ci hai conosciuto?"
table="users"
mykey="profile"
mysubkey="come_ci_hai_conosciuto"
:type="costanti.FieldType.string">
</CMyFieldDb>
</div>
</div>
-->
<!--
<CTitleBanner class="q-pa-xs" :title="$t('pages.payment')" bgcolor="bg-primary" clcolor="text-white"

View File

@@ -0,0 +1,18 @@
.profile {
width: 100%;
margin: 0 auto;
max-width: 450px;
}
.myrow{
display: flex;
@media (max-width: 600px) {
flex-flow: column;
}
}
.qualifica{
border: solid 2px #4198ef;
border-radius: 1rem;
padding: 5px;
}

113
src/views/user/mygroup/mygroup.ts Executable file
View File

@@ -0,0 +1,113 @@
import { CMyFieldDb } from '@/components/CMyFieldDb'
import { CTitleBanner } from '@/components/CTitleBanner'
import { CProfile } from '@/components/CProfile'
import { CSkill } from '@/components/CSkill'
import { CDateTime } from '@/components/CDateTime'
import { tools } from '@store/Modules/tools'
import { computed, defineComponent, onMounted, ref, watch } from 'vue'
import { useUserStore } from '@store/UserStore'
import { useRoute, useRouter } from 'vue-router'
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 { IMyGroup, IUserFields } from 'model'
import { shared_consts } from '@/common/shared_vuejs'
export default defineComponent({
name: 'mygroup',
components: { CProfile, CTitleBanner, CMyFieldDb, CSkill, CDateTime },
props: {},
setup() {
const userStore = useUserStore()
const $route = useRoute()
const $q = useQuasar()
const { t } = useI18n()
const animation = ref('fade')
const groupname = computed(() => $route.params.groupname ? $route.params.groupname.toString() : '')
const filtroutente = ref(<any[]>[])
const showPic = ref(false)
const mygrp = ref(<IMyGroup>{})
function profile() {
return userStore.my.profile
}
function mygrpname() {
return userStore.my.username
}
function loadGroup() {
// Carica il profilo di quest'utente
if (groupname.value) {
userStore.loadGroup(groupname.value).then((ris) => {
mygrp.value = ris
// filtroutente.value = [{ userId: userStore.my._id }]
})
}
}
watch(() => groupname.value, (to: any, from: any) => {
loadGroup()
})
function mounted() {
loadGroup()
}
function getImgGrp() {
return userStore.getImgByGroup(mygrp.value)
}
function checkifShow(col: string) {
//++Todo: checkifShow Permessi !
return true
}
function getLinkGrpTelegram() {
if (!!mygrp.value.link_telegram) {
return 'https://t.me/' + mygrp.value.link_telegram
}
}
function getLinkWebSite() {
let site = mygrp.value.website!
if (site) {
if (!site.startsWith('http')) {
site = 'https://' + site
}
}
return site
}
onMounted(mounted)
return {
groupname,
profile,
tools,
costanti,
mygrp,
shared_consts,
getImgGrp,
checkifShow,
getLinkGrpTelegram,
getLinkWebSite,
filtroutente,
showPic,
mygrpname,
userStore,
t,
animation,
}
}
})

View File

@@ -0,0 +1,114 @@
<template>
<div class="q-gutter-sm q-pa-sm q-pb-md">
<div v-if="mygrp.descr" class="fit column no-wrap justify-evenly items-center content-start">
<div class="">
<q-avatar size="140px">
<q-img :src="getImgGrp()" :alt="username" img-class="imgprofile" height="140px" @click="showPic = true"/>
</q-avatar>
</div>
<div class="text-h6">
<span v-if="checkifShow('name')"> {{ mygrp.title }}</span>
</div>
<div class="col-12 text-h7 text-blue text-shadow-2">
{{ mygrp.groupname }}
</div>
<div class="col-12 text-h7">
<span v-if="checkifShow('descr')">{{ mygrp.descr }}</span>
</div>
<div v-if="mygrp.admins && !mygrp.admins.includes(userStore.my.username)">
<q-btn
v-if="!userStore.IsMyGroupByGroupname(mygrp.groupname) && !userStore.IsAskedGroupByGroupname(mygrp.groupname)"
icon="fas fa-user-plus"
color="primary" :label="$t('groups.ask_group')"
@click="tools.setRequestGroup($q, userStore.my.username, mygrp.groupname, true)"
/>
<q-btn
v-if="userStore.IsAskedGroupByGroupname(mygrp.groupname) && !userStore.IsMyGroupByGroupname(mygrp.groupname)"
icon="fas fa-user-minus"
flat :label="$t('groups.cancel_ask_group_short')"
@click="tools.cancelReqGroups($q, userStore.my.username, mygrp.groupname)"
/>
</div>
<div v-if="mygrp.title">
<br>
</div>
<q-btn
v-if="mygrp.admins.includes(userStore.my.username)" icon="fas fa-pencil-alt"
color="blue"
size="md"
:label="$t('otherpages.modifgrp')"
to="/editgrp">
</q-btn>
<div v-if="mygrp.title" class="myrow justify-evenly items-center q-pa-sm q-ma-sm">
<div class="col-6 q-ma-xs">
<q-btn
v-if="getLinkGrpTelegram()" icon="fab fa-telegram"
color="blue" type="a"
size="md"
rounded
:label="$t('msgs.telegrammsg')"
:href="getLinkGrpTelegram()" target="__blank">
</q-btn>
</div>
<div class="col-6 q-ma-xs">
<q-btn
v-if="getLinkWebSite()" icon="fas fa-globe"
color="blue" type="a"
size="md"
rounded
:label="$t('reg.website')"
:href="getLinkWebSite()" target="__blank">
</q-btn>
</div>
</div>
</div>
<div v-else class="fit column no-wrap justify-evenly items-center content-start">
<q-skeleton type="QAvatar" size="140px" height="140px" animation="fade"/>
<q-card flat bordered style="width: 250px">
<div class="text-h6">
<q-skeleton :animation="animation"/>
</div>
<div class="col-12 text-h7 text-grey text-center">
{{ groupname }}
</div>
<div class="col-12 text-h7">
<q-skeleton :animation="animation"/>
</div>
<div class="col-12 text-h8 q-mt-sm">
<q-skeleton :animation="animation"/>
</div>
<div class="col-12 text-h8 q-mt-sm">
<q-skeleton :animation="animation"/>
</div>
</q-card>
</div>
</div>
<q-dialog
v-model="showPic"
full-height full-width
>
<img :src="getImgGrp()" :alt="groupname" class="full-width">
</q-dialog>
</template>
<script lang="ts" src="./mygroup.ts">
</script>
<style lang="scss" scoped>
@import './mygroup.scss';
</style>

View File

View File

@@ -0,0 +1,105 @@
import { CMyGroups } from '@/components/CMyGroups'
import { CGridTableRec } from '@/components/CGridTableRec'
import { tools } from '@store/Modules/tools'
import { computed, defineComponent, onMounted, ref, watch } from 'vue'
import { useUserStore } from '@store/UserStore'
import { useRoute, useRouter } from 'vue-router'
import { useGlobalStore } from '@store/globalStore'
import { useI18n } from '@/boot/i18n'
import { colmyUserGroup } from '@store/Modules/fieldsTable'
import { ISearchList } from 'model'
import { costanti } from '@costanti'
import { shared_consts } from '@/common/shared_vuejs'
export default defineComponent({
name: 'mygroups',
components: { CMyGroups, CGridTableRec },
props: {},
setup() {
const userStore = useUserStore()
const $route = useRoute()
const { t } = useI18n()
const arrfilterand: any = ref([])
const filtercustom: any = ref([])
const searchList = ref(<ISearchList[]>[])
const filter = ref(costanti.FIND_GROUP)
function mounted() {
searchList.value = []
filtercustom.value = []
arrfilterand.value = []
const filt_loaded = tools.getCookie(tools.COOK_SEARCH + tools.GROUP_SEARCH)
filter.value = filt_loaded ? filt_loaded : costanti.FIND_GROUP
}
watch(() => filter.value, (newval: any, oldval) => {
tools.setCookie(tools.COOK_SEARCH + tools.GROUP_SEARCH, newval)
})
function extraparams() {
let lk_tab = 'mygroups'
let lk_LF = 'userId'
let lk_FF = '_id'
let lk_as = 'group'
let 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,
img: 1,
visibility: 1,
admins: 1,
idSector: 1,
photos: 1,
idCity: 1,
comune: 1,
}
},
lookup2: {
lk_tab: 'cities',
lk_LF: 'idCity',
lk_FF: '_id',
lk_as: 'comune',
lk_proj: {
groupname: 1,
title: 1,
descr: 1,
img: 1,
idSector: 1,
visibility: 1,
admins: 1,
photos: 1,
idCity: 1,
comune: 1,
}
}
}
}
onMounted(mounted)
return {
filter,
costanti,
shared_consts,
arrfilterand,
filtercustom,
searchList,
colmyUserGroup,
extraparams,
}
}
})

View File

@@ -0,0 +1,46 @@
<template>
<div class="">
<CMyGroups
v-model="filter"
:finder="true"
>
<CGridTableRec
prop_mytable="mygroups"
prop_mytitle=""
:prop_mycolumns="colmyUserGroup"
prop_colkey="_id"
col_title="groupname"
:vertical="true"
nodataLabel=" "
:prop_search="true"
hint="nome del gruppo da trovare"
:finder="true"
:choose_visutype="true"
:finder_noNull="false"
:options="shared_consts.OPTIONS_SEARCH_ONLY_FULL_WORDS"
:butt_modif_new="true"
noresultLabel="nome del gruppo non trovato"
:arrfilters="arrfilterand"
:filtercustom="filtercustom"
:prop_searchList="searchList"
:showType="costanti.SHOW_GROUPINFO"
keyMain=""
:showCol="false"
:extraparams="extraparams()">
</CGridTableRec>
</CMyGroups>
<div v-if="filter === costanti.CREATE_GROUP">
Nuovo Gruppo:
</div>
</div>
</template>
<script lang="ts" src="./mygroups.ts">
</script>
<style lang="scss" scoped>
@import './mygroups.scss';
</style>

View File

@@ -17,7 +17,7 @@ import { shared_consts } from '@/common/shared_vuejs'
export default defineComponent({
name: 'myuser',
name: 'myprofile',
components: { CProfile, CTitleBanner, CMyFieldDb, CSkill, CDateTime },
props: {},
setup() {

View File

@@ -102,6 +102,21 @@
</q-card>
</div>
<CTitleBanner
class="" title="Competenze e Talenti" bgcolor="bg-positive" clcolor="text-white"
myclass="myshad" :canopen="true">
<CSkill
:filtercustom="filtroutente"
:butt_modif_new="false"
>
</CSkill>
</CTitleBanner>
<div v-if="myuser.name">
<CTitleBanner
class="" :title="$t('dashboard.info')" bgcolor="bg-primary" clcolor="text-white"
@@ -124,20 +139,6 @@
</CTitleBanner>
</div>
<CTitleBanner
class="" title="Competenze e Talenti" bgcolor="bg-positive" clcolor="text-white"
myclass="myshad" :canopen="true">
<CSkill
:filtercustom="filtroutente"
:butt_modif_new="false"
>
</CSkill>
</CTitleBanner>
</div>
<q-dialog