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',
Todo: 'Todo',
personal: 'Personale',
work: 'Lavoro',
bacheca: 'Bacheca',
shopping: 'Spesa',
Admin: 'Admin',
Test1: 'Test1',

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -32,6 +32,7 @@ import { useQuasar } from 'quasar'
import { costanti } from '@costanti'
import translate from '@/globalroutines/util'
import { toolsext } from '@store/Modules/toolsext'
import { CMySkill } from '@/components/CMySkill'
export default defineComponent({
name: 'CGridTableRec',
@@ -204,7 +205,7 @@ export default defineComponent({
default: '',
},
},
components: { CMyPopupEdit, CTitleBanner, CMyFieldDb, CMySelect, CMyFriends, CMyGroups, CMyUser },
components: { CMyPopupEdit, CTitleBanner, CMyFieldDb, CMySelect, CMyFriends, CMyGroups, CMyUser, CMySkill },
setup(props, { emit }) {
const $q = useQuasar()
const { t } = useI18n()
@@ -900,7 +901,7 @@ export default defineComponent({
pagination.value = props.prop_pagination
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)
}

View File

@@ -1,6 +1,6 @@
<template>
<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
v-if="mytable && visButtRow()" rounded dense color="primary"
size="lg"
@@ -35,7 +35,8 @@
<q-spinner-tail size="2em" color="primary"/>
</q-inner-loading>
<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
bordered
class="my-sticky-header-table"
@@ -258,9 +259,9 @@
<div v-if="choose_visutype" class="">
<q-radio v-model="myvertical" :val="2" label="Lista"
@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) "/>
<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) "/>
<q-radio v-if="$q.screen.gt.xs" v-model="myvertical" :val="0" label="Tabella"
@update:model-value="tools.setCookie('myv_' + prop_mytable, myvertical) "/>
@@ -313,7 +314,15 @@
</template>
<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>
<CMyUser
:mycontact="props.row"

View File

@@ -432,6 +432,7 @@
</div>
</div>
<div v-else>
<!--
<div class="row justify-evenly">
<q-btn
v-if="myvalue"
@@ -448,6 +449,7 @@
>
</q-btn>
</div>
-->
<!--<div v-html="visuValByType(myvalue, col, row)" @click="visueditor = true"></div>-->
<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 './CMainView'
export * from './CBigBtn'
export * from './CMySkill'
// export * from './CPreloadImages'

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,6 +1,7 @@
<template>
<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;">
<div class="q-ma-sm q-gutter-sm q-pa-xs">