Creare Visualizzazione Nuova della scheda della MySkill (Bacheca)

This commit is contained in:
paoloar77
2022-02-14 15:38:23 +01:00
parent cac35f9243
commit 7249886e8f
24 changed files with 164 additions and 24 deletions

View File

@@ -9,7 +9,7 @@ const msg_website = {
Category: 'Categorie', Category: 'Categorie',
Todo: 'Todo', Todo: 'Todo',
personal: 'Personale', personal: 'Personale',
work: 'Lavoro', bacheca: 'Bacheca',
shopping: 'Spesa', shopping: 'Spesa',
Admin: 'Admin', Admin: 'Admin',
Test1: 'Test1', Test1: 'Test1',

View File

@@ -384,7 +384,7 @@ const baseroutes: IListRoutes[] = [
order: 10, order: 10,
path: '/bacheca', path: '/bacheca',
materialIcon: 'fas fa-bullhorn', materialIcon: 'fas fa-bullhorn',
name: 'mypages.work', name: 'mypages.bacheca',
component: () => import('@/root/bacheca/bacheca.vue'), component: () => import('@/root/bacheca/bacheca.vue'),
meta: { requiresAuth: true }, meta: { requiresAuth: true },
inmenu: true, inmenu: true,

View File

@@ -9,7 +9,7 @@ const msg_website = {
Category: 'Categorie', Category: 'Categorie',
Todo: 'Todo', Todo: 'Todo',
personal: 'Personale', personal: 'Personale',
work: 'Lavoro', bacheca: 'Bacheca',
shopping: 'Spesa', shopping: 'Spesa',
Admin: 'Admin', Admin: 'Admin',
Test1: 'Test1', Test1: 'Test1',

View File

@@ -384,7 +384,7 @@ const baseroutes: IListRoutes[] = [
order: 100, order: 100,
path: '/bacheca', path: '/bacheca',
materialIcon: 'fas fa-bullhorn', materialIcon: 'fas fa-bullhorn',
name: 'mypages.work', name: 'mypages.bacheca',
component: () => import('@/root/bacheca/bacheca.vue'), component: () => import('@/root/bacheca/bacheca.vue'),
meta: { requiresAuth: true }, meta: { requiresAuth: true },
inmenu: true, inmenu: true,

View File

@@ -9,7 +9,7 @@ const msg_website = {
Category: 'Categorie', Category: 'Categorie',
Todo: 'Todo', Todo: 'Todo',
personal: 'Personale', personal: 'Personale',
work: 'Lavoro', bacheca: 'Bacheca',
shopping: 'Spesa', shopping: 'Spesa',
Admin: 'Admin', Admin: 'Admin',
Test1: 'Test1', Test1: 'Test1',

View File

@@ -384,7 +384,7 @@ const baseroutes: IListRoutes[] = [
order: 10, order: 10,
path: '/bacheca', path: '/bacheca',
materialIcon: 'fas fa-bullhorn', materialIcon: 'fas fa-bullhorn',
name: 'mypages.work', name: 'mypages.bacheca',
component: () => import('@/root/bacheca/bacheca.vue'), component: () => import('@/root/bacheca/bacheca.vue'),
meta: { requiresAuth: true }, meta: { requiresAuth: true },
inmenu: true, inmenu: true,

View File

@@ -21,7 +21,8 @@
col_title="descr" col_title="descr"
col_footer="idCity" col_footer="idCity"
col_tabfooter="mycities" col_tabfooter="mycities"
:vertical="-1" :vertical="costanti.VISUTABLE_LISTA"
:showType="costanti.SHOW_MYSKILL"
:nodataLabel="idSector > 0 ? 'Nessuna Competenza trovata': 'Selezionare un Settore'" :nodataLabel="idSector > 0 ? 'Nessuna Competenza trovata': 'Selezionare un Settore'"
:prop_search="true" :prop_search="true"
:finder="true" :finder="true"

View File

@@ -32,6 +32,7 @@ import { useQuasar } from 'quasar'
import { costanti } from '@costanti' import { costanti } from '@costanti'
import translate from '@/globalroutines/util' import translate from '@/globalroutines/util'
import { toolsext } from '@store/Modules/toolsext' import { toolsext } from '@store/Modules/toolsext'
import { CMySkill } from '@/components/CMySkill'
export default defineComponent({ export default defineComponent({
name: 'CGridTableRec', name: 'CGridTableRec',
@@ -204,7 +205,7 @@ export default defineComponent({
default: '', default: '',
}, },
}, },
components: { CMyPopupEdit, CTitleBanner, CMyFieldDb, CMySelect, CMyFriends, CMyGroups, CMyUser }, components: { CMyPopupEdit, CTitleBanner, CMyFieldDb, CMySelect, CMyFriends, CMyGroups, CMyUser, CMySkill },
setup(props, { emit }) { setup(props, { emit }) {
const $q = useQuasar() const $q = useQuasar()
const { t } = useI18n() const { t } = useI18n()
@@ -900,7 +901,7 @@ export default defineComponent({
pagination.value = props.prop_pagination pagination.value = props.prop_pagination
myvertical.value = props.vertical myvertical.value = props.vertical
myvertical.value = tools.getCookie('myv_' + props.prop_mytable, props.vertical) // myvertical.value = tools.getCookie('myv_' + props.prop_mytable, props.vertical)
showfilteradv.value = tools.getCookie('s_adv', false) showfilteradv.value = tools.getCookie('s_adv', false)
} }

View File

@@ -1,6 +1,6 @@
<template> <template>
<div :class="$q.screen.lt.sm ? `` : `q-pa-xs`" v-if="isfinishLoading"> <div :class="$q.screen.lt.sm ? `` : `q-pa-xs`" v-if="isfinishLoading">
<div class="centermydiv q-ma-sm" style="text-align: center"> <div class="centermydiv q-my-sm" style="text-align: center">
<q-btn <q-btn
v-if="mytable && visButtRow()" rounded dense color="primary" v-if="mytable && visButtRow()" rounded dense color="primary"
size="lg" size="lg"
@@ -35,7 +35,8 @@
<q-spinner-tail size="2em" color="primary"/> <q-spinner-tail size="2em" color="primary"/>
</q-inner-loading> </q-inner-loading>
<q-table <q-table
:grid="myvertical === costanti.VISUTABLE_SCHEDA_USER || myvertical === 2 || myvertical === costanti.VISUTABLE_SCHEDA_GROUP" :grid="(myvertical === costanti.VISUTABLE_SCHEDA_USER || myvertical === 2 || myvertical === costanti.VISUTABLE_SCHEDA_GROUP)"
:grid-header="false"
flat flat
bordered bordered
class="my-sticky-header-table" class="my-sticky-header-table"
@@ -258,9 +259,9 @@
<div v-if="choose_visutype" class=""> <div v-if="choose_visutype" class="">
<q-radio v-model="myvertical" :val="2" label="Lista" <q-radio v-model="myvertical" :val="2" label="Lista"
@update:model-value="tools.setCookie('myv_' + prop_mytable, myvertical) "/> @update:model-value="tools.setCookie('myv_' + prop_mytable, myvertical) "/>
<q-radio v-if="mytable === toolsext.TABMYGROUPS" v-model="myvertical" :val="costanti.VISUTABLE_SCHEDA_GROUP" label="Scheda" <q-radio v-if="mytable === toolsext.TAB" v-model="myvertical" :val="costanti.VISUTABLE_SCHEDA_GROUP" label="Scheda"
@update:model-value="tools.setCookie('myv_' + prop_mytable, myvertical) "/> @update:model-value="tools.setCookie('myv_' + prop_mytable, myvertical) "/>
<q-radio v-else v-model="myvertical" :val="costanti.VISUTABLE_SCHEDA_USER" label="Scheda" <q-radio v-else-if="mytable !== toolsext.TABMYGROUPS && !finder" v-model="myvertical" :val="costanti.VISUTABLE_SCHEDA_USER" label="Scheda"
@update:model-value="tools.setCookie('myv_' + prop_mytable, myvertical) "/> @update:model-value="tools.setCookie('myv_' + prop_mytable, myvertical) "/>
<q-radio v-if="$q.screen.gt.xs" v-model="myvertical" :val="0" label="Tabella" <q-radio v-if="$q.screen.gt.xs" v-model="myvertical" :val="0" label="Tabella"
@update:model-value="tools.setCookie('myv_' + prop_mytable, myvertical) "/> @update:model-value="tools.setCookie('myv_' + prop_mytable, myvertical) "/>
@@ -313,7 +314,15 @@
</template> </template>
<template v-slot:item="props"> <template v-slot:item="props">
<div v-if="((showType === costanti.SHOW_USERINFO) && myvertical !== costanti.VISUTABLE_SCHEDA_USER) || ((myvertical === 2) && (shared_consts.TABLES_VISU_LISTA_USER.includes(tablesel)))" class="fill-all-width"> <div v-if="showType === costanti.SHOW_MYSKILL">
<CMySkill
:prop_myskill="props.row"
:visu="visufind"
>
</CMySkill>
</div>
<div v-else-if="((showType === costanti.SHOW_USERINFO) && myvertical !== costanti.VISUTABLE_SCHEDA_USER) || ((myvertical === 2) && (shared_consts.TABLES_VISU_LISTA_USER.includes(tablesel)))" class="fill-all-width">
<div> <div>
<CMyUser <CMyUser
:mycontact="props.row" :mycontact="props.row"

View File

@@ -432,6 +432,7 @@
</div> </div>
</div> </div>
<div v-else> <div v-else>
<!--
<div class="row justify-evenly"> <div class="row justify-evenly">
<q-btn <q-btn
v-if="myvalue" v-if="myvalue"
@@ -448,6 +449,7 @@
> >
</q-btn> </q-btn>
</div> </div>
-->
<!--<div v-html="visuValByType(myvalue, col, row)" @click="visueditor = true"></div>--> <!--<div v-html="visuValByType(myvalue, col, row)" @click="visueditor = true"></div>-->
<div v-if="!isFieldDb()"> <div v-if="!isFieldDb()">

View File

@@ -0,0 +1,4 @@
.myflex{
display: flex;
flex: 1;
}

View File

@@ -0,0 +1,72 @@
import { defineComponent, onMounted, PropType, ref, watch } from 'vue'
import { useUserStore } from '@store/UserStore'
import { IImgGallery, IMySkill, IUserFields, IUserProfile } from 'model'
import { costanti } from '@costanti'
import { shared_consts } from '@/common/shared_vuejs'
import { fieldsTable } from '@store/Modules/fieldsTable'
import { tools } from '@store/Modules/tools'
import { useQuasar } from 'quasar'
import { useI18n } from '@/boot/i18n'
import { useRoute, useRouter } from 'vue-router'
export default defineComponent({
name: 'CMySkill',
emits: ['setCmd'],
props: {
prop_myskill: {
type: Object as PropType<IMySkill | null>,
required: false,
default: null,
},
},
setup(props, { emit }) {
const userStore = useUserStore()
const $q = useQuasar()
const { t } = useI18n()
const $router = useRouter()
const $route = useRoute()
const username = ref('')
const myskill = ref(<IMySkill | null>null)
watch(() => props.prop_myskill, (newval, oldval) => {
console.log('watch: myskill')
mounted()
})
function mounted() {
if (props.prop_myskill) {
myskill.value = props.prop_myskill
}
}
function getImgUser(profile: IUserFields) {
return userStore.getImgByProfile(profile)
}
function naviga(path: string) {
$router.push(path)
}
function setCmd($q: any, cmd: number, myusername: string, value: any, groupname: string) {
emit('setCmd', $q, cmd, myusername, value, groupname)
}
onMounted(mounted)
return {
myskill,
costanti,
getImgUser,
naviga,
setCmd,
shared_consts,
userStore,
tools,
fieldsTable,
}
},
})

View File

@@ -0,0 +1,45 @@
<template>
<div class="q-py-xs centermydiv" :style="`min-width: `+ (tools.getwidth($q) - 20) +`px;`">
<q-item v-if="myskill" clickable v-ripple>
<q-item-section avatar @click="naviga(`/my/` + myskill.username)">
<q-badge class="q-my-xs self-center" :color="myskill.adType === 1 ? 'green' : 'red'">
{{ fieldsTable.getValByTabAndId('myskills', 'adType', myskill.adType) }}
<q-icon :name="myskill.adType === 1 ? 'fas fa-street-view' : 'fas fa-search'" color="white"
class="q-ml-xs"/>
</q-badge>
<q-avatar size="60px">
<q-img :src="getImgUser(myskill)" :alt="myskill.username" img-class="imgprofile" height="60px"/>
</q-avatar>
</q-item-section>
<q-item-section @click="naviga(`/mypage/` + myskill._id)">
<q-item-label class="full-width">
<span v-for="(rec, ind) of myskill.recSkill" :key="ind"> <q-chip
dense
class="text-center shadow-5 glossy bg-blue chipmodif">{{ rec.descr }}</q-chip></span>
<span v-for="(rec, ind) of myskill.myskill" :key="ind"> <q-chip
dense
class="text-center shadow-5 glossy bg-green chipmodif">{{ rec.descr }}</q-chip></span>
<!--<span> - {{ myskill.profile.qualifica }}</span>-->
</q-item-label>
<q-item-label lines="3">{{ myskill.descr }}<br>
</q-item-label>
<q-item-label overline lines="1" style="text-align: right">
<span class="text-weight-bold">{{ myskill.username }}</span> -
<span v-for="(rec, ind) of myskill.mycities" :key="ind">{{ rec.comune }}</span>
</q-item-label>
</q-item-section>
</q-item>
<q-separator inset="item"/>
</div>
</template>
<script lang="ts" src="./CMySkill.ts">
</script>
<style lang="scss" scoped>
@import './CMySkill.scss';
</style>

View File

@@ -0,0 +1 @@
export { default as CMySkill } from './CMySkill.vue'

View File

@@ -10,3 +10,5 @@ export default defineComponent({
}, },
}, },
}) })

View File

@@ -42,4 +42,5 @@ export * from './CMyGroups'
export * from './CDashboard' export * from './CDashboard'
export * from './CMainView' export * from './CMainView'
export * from './CBigBtn' export * from './CBigBtn'
export * from './CMySkill'
// export * from './CPreloadImages' // export * from './CPreloadImages'

View File

@@ -9,7 +9,7 @@ const msg_website = {
Category: 'Categorie', Category: 'Categorie',
Todo: 'Todo', Todo: 'Todo',
personal: 'Personale', personal: 'Personale',
work: 'Lavoro', bacheca: 'Bacheca',
shopping: 'Spesa', shopping: 'Spesa',
Admin: 'Admin', Admin: 'Admin',
Test1: 'Test1', Test1: 'Test1',

View File

@@ -384,7 +384,7 @@ const baseroutes: IListRoutes[] = [
order: 100, order: 100,
path: '/bacheca', path: '/bacheca',
materialIcon: 'fas fa-bullhorn', materialIcon: 'fas fa-bullhorn',
name: 'mypages.work', name: 'mypages.bacheca',
component: () => import('@/root/bacheca/bacheca.vue'), component: () => import('@/root/bacheca/bacheca.vue'),
meta: { requiresAuth: true }, meta: { requiresAuth: true },
inmenu: true, inmenu: true,

View File

@@ -876,7 +876,7 @@ const msg_it = {
follow_groups: 'Gruppi che Seguo', follow_groups: 'Gruppi che Seguo',
create_group: 'Crea Gruppo', create_group: 'Crea Gruppo',
friends: 'Amici', friends: 'Amici',
work: 'Lavoro', bacheca: 'Bacheca',
groups: 'Gruppi', groups: 'Gruppi',
request_friends: 'Rich. Amicizia', request_friends: 'Rich. Amicizia',
request_sent_friends: 'Rich. Inviate', request_sent_friends: 'Rich. Inviate',

View File

@@ -10,6 +10,7 @@ export const costanti = {
SHOW_USERINFO: 1, SHOW_USERINFO: 1,
SHOW_GROUPINFO: 5, SHOW_GROUPINFO: 5,
SHOW_MYSKILL: 10,
BINARY_CHECK: 1, BINARY_CHECK: 1,

View File

@@ -570,7 +570,7 @@ export const colmySkills = [
jointable: 'skills', jointable: 'skills',
filter_table: 'sectors', filter_table: 'sectors',
filter_field: 'idSector', filter_field: 'idSector',
noshowlabel: true, noshowlabel: false,
icon: 'engineering', icon: 'engineering',
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView, showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView,
allowNewValue: true, allowNewValue: true,
@@ -583,7 +583,7 @@ export const colmySkills = [
jointable: 'subskills', jointable: 'subskills',
filter_table: 'skills', filter_table: 'skills',
filter_field: 'idSkill', filter_field: 'idSkill',
noshowlabel: true, noshowlabel: false,
icon: 'far fa-id-card', icon: 'far fa-id-card',
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist, showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
allowNewValue: true, allowNewValue: true,
@@ -595,7 +595,7 @@ export const colmySkills = [
required: false, required: false,
jointable: 'levels', jointable: 'levels',
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist, showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
noshowlabel: true, noshowlabel: false,
icon: 'grading', icon: 'grading',
}), }),
AddCol({ AddCol({
@@ -604,7 +604,7 @@ export const colmySkills = [
fieldtype: costanti.FieldType.multiselect, fieldtype: costanti.FieldType.multiselect,
jointable: 'statusSkills', jointable: 'statusSkills',
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist, showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
noshowlabel: true, noshowlabel: false,
icon: 'mood', icon: 'mood',
}), }),
AddCol({ AddCol({
@@ -613,7 +613,7 @@ export const colmySkills = [
fieldtype: costanti.FieldType.multiselect, fieldtype: costanti.FieldType.multiselect,
jointable: 'contribtypes', jointable: 'contribtypes',
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist, showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
noshowlabel: true, noshowlabel: false,
icon: 'currency_exchange', icon: 'currency_exchange',
//icon: 'fas fa-hands-helping', //icon: 'fas fa-hands-helping',
}), }),

View File

@@ -102,7 +102,6 @@ export const tools = {
'lime', 'lime',
'orange', 'orange',
'deeporange', 'deeporange',
'grey',
'blue-gray', 'blue-gray',
'yellow', 'yellow',
], ],

View File

@@ -60,6 +60,7 @@ export const toolsext = {
TABUSER: 'users', TABUSER: 'users',
TABFRIENDS: 'friends', TABFRIENDS: 'friends',
TABMYGROUPS: 'mygroups', TABMYGROUPS: 'mygroups',
TABMYSKILLS: 'myskills',
TABNAVI: 'navi', TABNAVI: 'navi',
TABLISTAINGRESSO: 'listaingressos', TABLISTAINGRESSO: 'listaingressos',
TABGRADUATORIA: 'graduatorias', TABGRADUATORIA: 'graduatorias',

View File

@@ -1,6 +1,7 @@
<template> <template>
<CMyPage <CMyPage
:title='myskill.subTitle' imgbackground="images/calendario_eventi.jpg" :title='myskill.username' imgbackground="images/calendario_eventi.jpg"
sizes="max-height: 120px" styleadd="bottom: -20px !important;"> sizes="max-height: 120px" styleadd="bottom: -20px !important;">
<div class="q-ma-sm q-gutter-sm q-pa-xs"> <div class="q-ma-sm q-gutter-sm q-pa-xs">