- Se non aggiungo la foto alla competenza, prendo quella del profilo

This commit is contained in:
paoloar77
2022-02-10 23:31:18 +01:00
parent 86635053d7
commit c63ed7e6d3
11 changed files with 104 additions and 40 deletions

View File

@@ -42,14 +42,24 @@ $grayshadow: #555;
width: 100%; width: 100%;
max-width: 300px; max-width: 300px;
min-width: 200px; min-width: 200px;
padding: 1rem 1rem; padding: 0.5rem 0.5rem;
height: 350px; height: 350px;
margin: auto; margin: auto;
} }
.my-card-gallery-noModif {
width: 100%;
max-width: 300px;
min-width: 200px;
padding: 1rem 1rem;
height: 220px;
}
.my-card-gallery-view { .my-card-gallery-view {
width: 100px; width: 100px;
height: 100px; height: 100px;
padding: 0.5rem 0.5rem; padding: 0.25rem 0.25rem;
margin: auto; margin: auto;
} }

View File

@@ -19,6 +19,11 @@ export default defineComponent({
type: Boolean, type: Boolean,
required: true, required: true,
}, },
isInModif: {
type: Boolean,
required: false,
default: false,
},
single: { single: {
type: Boolean, type: Boolean,
required: false, required: false,
@@ -29,6 +34,11 @@ export default defineComponent({
type: String, type: String,
required: true, required: true,
}, },
imagebak: {
type: String,
required: false,
default: '',
},
imgGall: { imgGall: {
type: Object as PropType<IImgGallery[] | string | undefined | null>, type: Object as PropType<IImgGallery[] | string | undefined | null>,
required: true, required: true,
@@ -184,7 +194,7 @@ export default defineComponent({
} }
function getclass() { function getclass() {
return (props.edit || displayGall.value) ? 'my-card-gallery' : 'my-card-gallery-view' + ' text-center' return (props.edit || displayGall.value) ? (props.isInModif ? 'my-card-gallery' : 'my-card-gallery-noModif') : 'my-card-gallery-view' + ' text-center'
} }
function getclimg() { function getclimg() {
@@ -247,7 +257,12 @@ export default defineComponent({
} }
function getfullname(rec: any) { function getfullname(rec: any) {
return costanti.DIR_UPLOAD + props.directory + '/' + rec.imagefile if (rec) {
return costanti.DIR_UPLOAD + props.directory + '/' + rec.imagefile
} else {
return props.imagebak
}
} }
function copytoclipboard(rec: any) { function copytoclipboard(rec: any) {

View File

@@ -1,8 +1,9 @@
<template> <template>
<!--<div class="q-pa-md items-start " style="display: inline-flex; width: 800px;"> --> <!--<div class="q-pa-md items-start " style="display: inline-flex; width: 800px;"> -->
<div v-if="!edit"> <div v-if="!edit">
<div class="q-pa-md q-gutter-md"> <div class="q-pa-xs q-gutter-md">
<q-card :class="getclass()" @click="apri"> <q-card v-if="getlistimages().length > 0" :class="getclass()" @click="apri">
<div v-for="(mygallery, index) in getlistimages()" :key="index"> <div v-for="(mygallery, index) in getlistimages()" :key="index">
<div v-if="index === 0"> <div v-if="index === 0">
<q-img <q-img
@@ -16,6 +17,20 @@
</div> </div>
</div> </div>
</q-card> </q-card>
<div v-if="!isInModif && getlistimages().length <= 0 && imagebak">
<q-card :class="getclass()" @click="ImgFullScreen(mygallery)">
<q-img
:src="imagebak" :class="getclimg()">
</q-img>
</q-card>
</div>
<q-btn
v-if="isInModif"
color="primary" @click="apri"
:label="$t('gallery.select_image')">
</q-btn>
</div> </div>
</div> </div>
<div v-else> <div v-else>
@@ -53,8 +68,8 @@
</div> </div>
</q-img> </q-img>
<q-field <q-field
v-if="canModify"
stack-label stack-label
dense dense
label="Nome File"> label="Nome File">
@@ -65,6 +80,7 @@
</q-field> </q-field>
<q-input <q-input
v-if="canModify"
v-model="mygallery.description" v-model="mygallery.description"
dense dense
:label="$t('proj.longdescr')" :label="$t('proj.longdescr')"
@@ -156,7 +172,8 @@
Foto {{ index + 1 }} Foto {{ index + 1 }}
</div> </div>
<q-space></q-space> <q-space></q-space>
<q-btn v-if="canModify" flat round color="red" icon="fas fa-trash-alt" @click="deleteFile(mygallery)"></q-btn> <q-btn v-if="canModify" flat round color="red" icon="fas fa-trash-alt"
@click="deleteFile(mygallery)"></q-btn>
</q-bar> </q-bar>
<q-card <q-card
@@ -178,6 +195,7 @@
</q-img> </q-img>
<q-card-section> <q-card-section>
<q-field <q-field
v-if="canModify"
stack-label stack-label
dense dense
label="Nome File"> label="Nome File">
@@ -187,6 +205,7 @@
</q-field> </q-field>
<q-input <q-input
v-if="canModify"
v-model="mygallery.description" v-model="mygallery.description"
dense dense
:label="$t('proj.longdescr')" :label="$t('proj.longdescr')"
@@ -220,6 +239,15 @@
></q-uploader> ></q-uploader>
</div> </div>
</div> </div>
<div v-if="!isInModif && getlistimages().length <= 0 && imagebak">
<q-card :class="getclass()" @click="ImgFullScreen(mygallery)">
<q-img
:src="imagebak" :class="getclimg()">
</q-img>
</q-card>
</div>
</div> </div>

View File

@@ -65,6 +65,7 @@
:props="props" :props="props"
class="text-italic text-weight-bold" class="text-italic text-weight-bold"
> >
<span v-if="col && showColCheck(col, tools.TIPOVIS_SHOW_RECORD, true)"> <span v-if="col && showColCheck(col, tools.TIPOVIS_SHOW_RECORD, true)">
{{ col.label }} {{ col.label }}
</span> </span>
@@ -266,6 +267,7 @@
<div <div
v-if="showColCheck(col, tools.TIPOVIS_SHOW_RECORD, true, 1, props.row)" class="tdclass"> v-if="showColCheck(col, tools.TIPOVIS_SHOW_RECORD, true, 1, props.row)" class="tdclass">
<div :class="getclrow(props.row)"> <div :class="getclrow(props.row)">
<CMyPopupEdit <CMyPopupEdit
:table="mytable" :table="mytable"
:canEdit="canEdit" :canEdit="canEdit"
@@ -353,7 +355,6 @@
<q-card-section class="inset-shadow"> <q-card-section class="inset-shadow">
<q-list dense> <q-list dense>
<div v-for="col in mycolumns" :key="col.name"> <div v-for="col in mycolumns" :key="col.name">
<q-item v-if="showColCheck(col, tools.TIPOVIS_SHOW_RECORD, false, tools.getValue(props.row,col.field, col.subfield))" <q-item v-if="showColCheck(col, tools.TIPOVIS_SHOW_RECORD, false, tools.getValue(props.row,col.field, col.subfield))"
:class="clByCol(col)" class="riduci_pad"> :class="clByCol(col)" class="riduci_pad">
@@ -414,7 +415,6 @@
<div <div
class="q-ma-sm q-pa-sm colmodif col-grow rounded-borders " style="border: 1px solid #bbb" class="q-ma-sm q-pa-sm colmodif col-grow rounded-borders " style="border: 1px solid #bbb"
@click="colclicksel = mycol"> @click="colclicksel = mycol">
<CMyPopupEdit <CMyPopupEdit
:table="mytable" :table="mytable"
:canEdit="true" :canEdit="true"

View File

@@ -107,13 +107,12 @@
</div> </div>
</div> </div>
<div v-else-if="col.fieldtype === costanti.FieldType.listimages" style="text-align: center;"> <div v-else-if="col.fieldtype === costanti.FieldType.listimages" style="text-align: center;">
<p v-if="isInModif">
{{ $t('reg.image') }}:
</p>
<CGallery <CGallery
:imagebak="col.showpicprofile_ifnotset ? userStore.getImgByProfile(row) : ''"
:title="getTitleGall()" :title="getTitleGall()"
:directory="getDirectoryGall()" :directory="getDirectoryGall()"
:imgGall="myvalue" :imgGall="myvalue"
:isInModif="isInModif"
:edit="isviewfield() && isInModif" :edit="isviewfield() && isInModif"
:canModify="canModify && isInModif" :canModify="canModify && isInModif"
@showandsave="Savedb"> @showandsave="Savedb">
@@ -123,11 +122,13 @@
<div v-if="canEdit"> <div v-if="canEdit">
{{ $t('reg.photo') }} {{ $t('reg.photo') }}
<CGallery <CGallery
:imagebak="col.showpicprofile_ifnotset ? userStore.getImgByProfile(row['profile']) : ''"
:title="getTitleGall()" :title="getTitleGall()"
:directory="getDirectoryGall()" :directory="getDirectoryGall()"
:imgGall="[{ imagefile: myvalue }]" :imgGall="[{ imagefile: myvalue }]"
:edit="isviewfield()" :edit="isviewfield()"
:canModify="canModify" :canModify="canModify"
:isInModif="isInModif"
:single="isFieldDb()" :single="isFieldDb()"
@update:imgGall="changevalRec" @update:imgGall="changevalRec"
@showandsave="Savedb"> @showandsave="Savedb">

View File

@@ -876,7 +876,7 @@ $heightBtn: 100%;
.myimg-view { .myimg-view {
border-radius: 5px !important; border-radius: 5px !important;
height: 80px; height: 90px;
} }
.dialog_card{ .dialog_card{

View File

@@ -522,6 +522,7 @@ export interface IColGridTable {
field_extra1?: string field_extra1?: string
subfield_extra1?: string subfield_extra1?: string
allowNewValue?: boolean allowNewValue?: boolean
showpicprofile_ifnotset?: boolean
} }
export interface ITableRec { export interface ITableRec {

View File

@@ -155,35 +155,39 @@ export default defineComponent({
if (sector) if (sector)
sector = sector.replace('\'', '\\\'') sector = sector.replace('\'', '\\\'')
idSector = findidSector(sector) if (sector) {
if (!idSector) { idSector = findidSector(sector)
idSector = createSector(sector) if (!idSector) {
idSector = createSector(sector)
// sectors // sectors
strsectors += '{ \n' strsectors += '{ \n'
strsectors += ' _id:' + idSector + ',' strsectors += ' _id:' + idSector + ','
strsectors += ' descr:\'' + sector + '\',' strsectors += ' descr:\'' + sector + '\','
strsectors += '}, \n' strsectors += '}, \n'
} }
idSkill = findidSkill(skill) if (skill !== '') {
if (!idSkill) { idSkill = findidSkill(skill)
idSkill = createSkill(skill) if (!idSkill) {
idSkill = createSkill(skill)
// skills // skills
strskills += '{ \n' strskills += '{ \n'
strsectors += ' _id:' + idSkill + ',' strsectors += ' _id:' + idSkill + ','
strskills += ' idSector: [' + idSector + '],' strskills += ' idSector: [' + idSector + '],'
strskills += ' descr:\'' + skill + '\',' strskills += ' descr:\'' + skill + '\','
strskills += '}, \n' strskills += '}, \n'
} }
}
if (sotto_cat !== '') { if (sotto_cat !== '') {
// subskills // subskills
strsubskills += '{ \n' strsubskills += '{ \n'
strsubskills += ' idSkill: ' + idSkill + ',' strsubskills += ' idSkill: ' + idSkill + ','
strsubskills += ' descr:\'' + sotto_cat + '\',' strsubskills += ' descr:\'' + sotto_cat + '\','
strsubskills += '}, \n' strsubskills += '}, \n'
}
} }
indrecsub++ indrecsub++

View File

@@ -21,6 +21,7 @@ const msg_it = {
title: 'Titolo', title: 'Titolo',
directory: 'Directory', directory: 'Directory',
list: 'Lista', list: 'Lista',
select_image: 'Scegli un\'Immagine',
}, },
profile: { profile: {
chisei: 'Chi Sei? Raccontaci di te:', chisei: 'Chi Sei? Raccontaci di te:',

View File

@@ -60,6 +60,7 @@ function AddCol(params: IColGridTable) {
field_extra1: (params.field_extra1 === undefined) ? '' : params.field_extra1, field_extra1: (params.field_extra1 === undefined) ? '' : params.field_extra1,
subfield_extra1: (params.subfield_extra1 === undefined) ? '' : params.subfield_extra1, subfield_extra1: (params.subfield_extra1 === undefined) ? '' : params.subfield_extra1,
allowNewValue: (params.allowNewValue === undefined) ? false : params.allowNewValue, allowNewValue: (params.allowNewValue === undefined) ? false : params.allowNewValue,
showpicprofile_ifnotset: (params.showpicprofile_ifnotset === undefined) ? false : params.showpicprofile_ifnotset,
visible: (params.visible === undefined) ? true : params.visible, visible: (params.visible === undefined) ? true : params.visible,
icon: (params.icon === undefined) ? '' : params.icon, icon: (params.icon === undefined) ? '' : params.icon,
action: (params.action === undefined) ? '' : params.action, action: (params.action === undefined) ? '' : params.action,
@@ -531,7 +532,9 @@ export const colmySkills = [
label_trans: 'skill.photos', label_trans: 'skill.photos',
fieldtype: costanti.FieldType.listimages, fieldtype: costanti.FieldType.listimages,
jointable: '', jointable: '',
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist, showpicprofile_ifnotset: true,
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView,
visible: true,
}), }),
AddCol({ AddCol({
name: 'idSector', name: 'idSector',

View File

@@ -115,6 +115,7 @@
mykey="profile" mykey="profile"
mysubkey="biografia" mysubkey="biografia"
maxlength="300" maxlength="300"
hint="Scrivi chi sei e quale percorso formativo hai fatto"
:showall="true" :showall="true"
:type="costanti.FieldType.string"> :type="costanti.FieldType.string">
</CMyFieldDb> </CMyFieldDb>