- Se non aggiungo la foto alla competenza, prendo quella del profilo
This commit is contained in:
@@ -42,14 +42,24 @@ $grayshadow: #555;
|
||||
width: 100%;
|
||||
max-width: 300px;
|
||||
min-width: 200px;
|
||||
padding: 1rem 1rem;
|
||||
padding: 0.5rem 0.5rem;
|
||||
height: 350px;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.my-card-gallery-noModif {
|
||||
width: 100%;
|
||||
max-width: 300px;
|
||||
min-width: 200px;
|
||||
padding: 1rem 1rem;
|
||||
height: 220px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.my-card-gallery-view {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
padding: 0.5rem 0.5rem;
|
||||
padding: 0.25rem 0.25rem;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,11 @@ export default defineComponent({
|
||||
type: Boolean,
|
||||
required: true,
|
||||
},
|
||||
isInModif: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
single: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
@@ -29,6 +34,11 @@ export default defineComponent({
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
imagebak: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
imgGall: {
|
||||
type: Object as PropType<IImgGallery[] | string | undefined | null>,
|
||||
required: true,
|
||||
@@ -184,7 +194,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
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() {
|
||||
@@ -247,7 +257,12 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
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) {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<template>
|
||||
<!--<div class="q-pa-md items-start " style="display: inline-flex; width: 800px;"> -->
|
||||
|
||||
<div v-if="!edit">
|
||||
<div class="q-pa-md q-gutter-md">
|
||||
<q-card :class="getclass()" @click="apri">
|
||||
<div class="q-pa-xs q-gutter-md">
|
||||
<q-card v-if="getlistimages().length > 0" :class="getclass()" @click="apri">
|
||||
<div v-for="(mygallery, index) in getlistimages()" :key="index">
|
||||
<div v-if="index === 0">
|
||||
<q-img
|
||||
@@ -16,6 +17,20 @@
|
||||
</div>
|
||||
</div>
|
||||
</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 v-else>
|
||||
@@ -53,8 +68,8 @@
|
||||
</div>
|
||||
</q-img>
|
||||
|
||||
|
||||
<q-field
|
||||
v-if="canModify"
|
||||
stack-label
|
||||
dense
|
||||
label="Nome File">
|
||||
@@ -65,6 +80,7 @@
|
||||
</q-field>
|
||||
|
||||
<q-input
|
||||
v-if="canModify"
|
||||
v-model="mygallery.description"
|
||||
dense
|
||||
:label="$t('proj.longdescr')"
|
||||
@@ -156,7 +172,8 @@
|
||||
Foto {{ index + 1 }}
|
||||
</div>
|
||||
<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-card
|
||||
@@ -178,6 +195,7 @@
|
||||
</q-img>
|
||||
<q-card-section>
|
||||
<q-field
|
||||
v-if="canModify"
|
||||
stack-label
|
||||
dense
|
||||
label="Nome File">
|
||||
@@ -187,6 +205,7 @@
|
||||
|
||||
</q-field>
|
||||
<q-input
|
||||
v-if="canModify"
|
||||
v-model="mygallery.description"
|
||||
dense
|
||||
:label="$t('proj.longdescr')"
|
||||
@@ -220,6 +239,15 @@
|
||||
></q-uploader>
|
||||
</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>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user