- Aggiunta della copertina iniziale nelle raccolte (Catalogo Generale).
- Corretto altezza delle immagini che erano stretchate. - Fix: poter spostare l'ordinamento dei libri corretto.
This commit is contained in:
@@ -55,7 +55,7 @@
|
||||
:class="[
|
||||
'flex', // Classi comuni
|
||||
'image-container',
|
||||
{ 'shadow-2': options.in_3d && !optcatalogo.pdf }, // Classe condizionale
|
||||
{ alignContent: 'center', 'shadow-2': options.in_3d && !optcatalogo.pdf }, // Classe condizionale
|
||||
scheda.testo_right_attaccato.font?.posiz_text ===
|
||||
costanti.POSIZ_TESTO.IN_BASSO
|
||||
? ''
|
||||
@@ -76,7 +76,7 @@
|
||||
scheda,
|
||||
true
|
||||
) ?? '100%',
|
||||
height: tools.adjustSize(
|
||||
'height': tools.adjustSize(
|
||||
optcatalogo,
|
||||
scheda.dimensioni?.scheda_prodotto?.size?.height,
|
||||
scheda,
|
||||
@@ -84,7 +84,9 @@
|
||||
),
|
||||
}"
|
||||
>
|
||||
<div style="position: relative">
|
||||
<div
|
||||
:style="`position: relative; align-content: center;`"
|
||||
>
|
||||
<a
|
||||
:href="myproduct.productInfo.link_macro"
|
||||
target="_blank"
|
||||
@@ -117,22 +119,25 @@
|
||||
optcatalogo,
|
||||
scheda.dimensioni?.immagine_prodotto?.size?.width,
|
||||
scheda,
|
||||
true
|
||||
true,
|
||||
options
|
||||
) && {
|
||||
width:
|
||||
tools.adjustSize(
|
||||
optcatalogo,
|
||||
scheda.dimensioni?.immagine_prodotto.size?.width,
|
||||
scheda,
|
||||
true
|
||||
true,
|
||||
options
|
||||
) + ' !important',
|
||||
}),
|
||||
height: scheda.dimensioni?.immagine_prodotto?.size?.height
|
||||
'max-height': scheda.dimensioni?.immagine_prodotto?.size?.height
|
||||
? tools.adjustSize(
|
||||
optcatalogo,
|
||||
scheda.dimensioni?.immagine_prodotto?.size?.height,
|
||||
scheda,
|
||||
false
|
||||
false,
|
||||
options
|
||||
)
|
||||
: undefined,
|
||||
display: 'block',
|
||||
@@ -177,7 +182,7 @@
|
||||
</div>
|
||||
<div
|
||||
v-if="
|
||||
(tools.isCollaboratore()) &&
|
||||
tools.isCollaboratore() &&
|
||||
!optcatalogo.generazionePDFInCorso &&
|
||||
(editOn || options.show_edit_book)
|
||||
"
|
||||
@@ -195,7 +200,7 @@
|
||||
color="primary"
|
||||
icon="fas fa-pencil-alt"
|
||||
v-if="
|
||||
(tools.isCollaboratore()) &&
|
||||
tools.isCollaboratore() &&
|
||||
!optcatalogo.generazionePDFInCorso &&
|
||||
(editOn || options.show_edit_book)
|
||||
"
|
||||
@@ -203,7 +208,7 @@
|
||||
<q-list>
|
||||
<q-item
|
||||
v-if="
|
||||
(tools.isCollaboratore()) &&
|
||||
tools.isCollaboratore() &&
|
||||
!optcatalogo.generazionePDFInCorso &&
|
||||
(editOn || options.show_edit_book)
|
||||
"
|
||||
@@ -224,7 +229,7 @@
|
||||
</q-item>
|
||||
<q-item
|
||||
v-if="
|
||||
(tools.isCollaboratore()) &&
|
||||
tools.isCollaboratore() &&
|
||||
!optcatalogo.generazionePDFInCorso &&
|
||||
(editOn || options.show_edit_book)
|
||||
"
|
||||
@@ -488,7 +493,8 @@
|
||||
optcatalogo,
|
||||
scheda.barcode.size?.gap,
|
||||
scheda,
|
||||
true
|
||||
true,
|
||||
options
|
||||
)
|
||||
"
|
||||
:width="
|
||||
@@ -497,7 +503,8 @@
|
||||
optcatalogo,
|
||||
scheda.barcode.size?.width,
|
||||
scheda,
|
||||
true
|
||||
true,
|
||||
options
|
||||
)
|
||||
)
|
||||
"
|
||||
@@ -506,7 +513,8 @@
|
||||
optcatalogo,
|
||||
scheda.barcode.widthlines,
|
||||
scheda,
|
||||
true
|
||||
true,
|
||||
options
|
||||
)
|
||||
"
|
||||
:height="
|
||||
|
||||
@@ -9,6 +9,7 @@ import { CMyPage } from '@src/components/CMyPage'
|
||||
import { tools } from '@tools'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { costanti } from '@costanti'
|
||||
import { shared_consts } from 'app/src/common/shared_vuejs';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CGallery',
|
||||
@@ -41,6 +42,11 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
filetype: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: shared_consts.FILETYPE.IMG,
|
||||
},
|
||||
quality: {
|
||||
type: String,
|
||||
required: false,
|
||||
@@ -384,6 +390,33 @@ export default defineComponent({
|
||||
message: 'La Dimensione massima dell\'immagine è di 2 MB'
|
||||
})
|
||||
}
|
||||
|
||||
function getFileTypeStr() {
|
||||
let tipo = ''
|
||||
if (props.filetype === shared_consts.FILETYPE.IMG)
|
||||
tipo = 'Immagine'
|
||||
else if (props.filetype === shared_consts.FILETYPE.PDF)
|
||||
tipo = 'PDF'
|
||||
|
||||
return tipo
|
||||
}
|
||||
function getAccept() {
|
||||
let tipo = ''
|
||||
if (props.filetype === shared_consts.FILETYPE.IMG)
|
||||
tipo = 'image/*'
|
||||
else if (props.filetype === shared_consts.FILETYPE.PDF)
|
||||
tipo = 'application/pdf'
|
||||
|
||||
return tipo
|
||||
}
|
||||
|
||||
function isPDF() {
|
||||
return props.filetype === shared_consts.FILETYPE.PDF
|
||||
}
|
||||
function isIMG() {
|
||||
return props.filetype === shared_consts.FILETYPE.IMG
|
||||
}
|
||||
|
||||
onMounted(created)
|
||||
|
||||
return {
|
||||
@@ -415,6 +448,11 @@ export default defineComponent({
|
||||
costanti,
|
||||
getrealdirectory,
|
||||
uploadOptions,
|
||||
getFileTypeStr,
|
||||
getAccept,
|
||||
shared_consts,
|
||||
isIMG,
|
||||
isPDF,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -3,46 +3,128 @@
|
||||
|
||||
<div v-if="!edit">
|
||||
<div class="q-pa-xs">
|
||||
<q-card v-if="isListImgValid" :class="getclass()" @click="apri">
|
||||
<div v-for="(mygallery, index) in getlistimages()" :key="index">
|
||||
<q-card
|
||||
v-if="isListImgValid"
|
||||
:class="getclass()"
|
||||
@click="apri"
|
||||
>
|
||||
<div
|
||||
v-for="(mygallery, index) in getlistimages()"
|
||||
:key="index"
|
||||
>
|
||||
<div v-if="index === 0">
|
||||
<q-img :src="tools.getsrcimg(mygallery, getrealdirectory())" :class="getclimg()" :alt="mygallery.alt">
|
||||
<div v-if="getnumimages() > 1" class="absolute-bottom text-shadow no-padding">
|
||||
({{ getnumimages() }})
|
||||
</div>
|
||||
</q-img>
|
||||
<div v-if="filetype === shared_consts.FILETYPE.IMG">
|
||||
<q-img
|
||||
:src="tools.getsrcimg(mygallery, getrealdirectory())"
|
||||
:class="getclimg()"
|
||||
:alt="mygallery.alt"
|
||||
>
|
||||
<div
|
||||
v-if="getnumimages() > 1"
|
||||
class="absolute-bottom text-shadow no-padding"
|
||||
>
|
||||
({{ getnumimages() }})
|
||||
</div>
|
||||
</q-img>
|
||||
</div>
|
||||
<div v-else-if="filetype === shared_consts.FILETYPE.PDF">
|
||||
<div>{{ mygallery.imagefile }}</div>
|
||||
<q-icon
|
||||
name="fas fa-file-pdf"
|
||||
:class="getclimg()"
|
||||
size="lg"
|
||||
:title="mygallery.alt"
|
||||
>
|
||||
</q-icon>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
<div v-else-if="!isInModif && !isListImgValid && imagebak">
|
||||
<q-card v-if="imagebak !== costanti.NESSUN_IMMAGINE" :class="getclass()" @click="ImgFullScreen(mygallery)">
|
||||
<q-img :src="imagebak" :class="getclimg()"> </q-img>
|
||||
</q-card>
|
||||
</div>
|
||||
<div v-else>
|
||||
<q-card :class="getclass()" @click="apri">
|
||||
<q-img src="/images/noimg.png" :class="getclimg()" alt="no image">
|
||||
<q-card
|
||||
v-if="imagebak !== costanti.NESSUN_IMMAGINE"
|
||||
: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" icon="fas fa-file-upload" :label="$t('gallery.load_image')">
|
||||
<div v-else>
|
||||
<q-card
|
||||
:class="getclass()"
|
||||
@click="apri"
|
||||
>
|
||||
<q-icon
|
||||
v-if="filetype === shared_consts.FILETYPE.PDF"
|
||||
name="fas fa-file-pdf"
|
||||
size="lg"
|
||||
:class="getclimg()"
|
||||
alt="no image"
|
||||
>
|
||||
</q-icon>
|
||||
<q-img
|
||||
v-else
|
||||
src="/images/noimg.png"
|
||||
:class="getclimg()"
|
||||
alt="no image"
|
||||
>
|
||||
</q-img>
|
||||
</q-card>
|
||||
</div>
|
||||
|
||||
<q-btn
|
||||
v-if="isInModif"
|
||||
color="primary"
|
||||
@click="apri"
|
||||
icon="fas fa-file-upload"
|
||||
:label="isIMG() ? $t('gallery.load_image') : $t('gallery.load_pdf')"
|
||||
>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div v-if="!isListImgValid">
|
||||
<q-btn flat round color="blue" icon="fas fa-tools" size="md" @click="apri"></q-btn>
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="blue"
|
||||
icon="fas fa-tools"
|
||||
size="md"
|
||||
@click="apri"
|
||||
></q-btn>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div class="row">
|
||||
<!--<q-draggable-rows
|
||||
v-model="order">-->
|
||||
|
||||
<div v-for="(mygallery, index) in getlistimages()" :key="index">
|
||||
<div class="q-pa-sm q-gutter-sm" @dragenter="onDragEnter" @dragleave="onDragLeave" @dragover="onDragOver">
|
||||
<q-card :id="mygallery._id" :class="getclass()" :draggable="canModify" @dragstart="onDragStart"
|
||||
@drop="onDrop">
|
||||
<q-img :src="tools.getsrcimg(mygallery, getrealdirectory())" :class="getclimg()" :alt="mygallery.alt">
|
||||
<div
|
||||
v-for="(mygallery, index) in getlistimages()"
|
||||
:key="index"
|
||||
>
|
||||
<div
|
||||
class="q-pa-sm q-gutter-sm"
|
||||
@dragenter="onDragEnter"
|
||||
@dragleave="onDragLeave"
|
||||
@dragover="onDragOver"
|
||||
>
|
||||
<q-card
|
||||
:id="mygallery._id"
|
||||
:class="getclass()"
|
||||
:draggable="canModify"
|
||||
@dragstart="onDragStart"
|
||||
@drop="onDrop"
|
||||
>
|
||||
<q-img
|
||||
:src="tools.getsrcimg(mygallery, getrealdirectory())"
|
||||
:class="getclimg()"
|
||||
:alt="mygallery.alt"
|
||||
>
|
||||
<div class="absolute-bottom text-shadow">
|
||||
<!-- <div class="text-h6 text-trans">{{ mygallery.description }} </div> -->
|
||||
<div class="text-subtitle-carica text-trans">
|
||||
@@ -51,60 +133,134 @@
|
||||
</div>
|
||||
</q-img>
|
||||
|
||||
<q-field v-if="canModify" stack-label dense label="Nome File">
|
||||
<q-field
|
||||
v-if="canModify"
|
||||
stack-label
|
||||
dense
|
||||
label="Nome File"
|
||||
>
|
||||
<template v-slot:control>
|
||||
<div class="self-center full-width no-outline" tabindex="0">
|
||||
<div
|
||||
class="self-center full-width no-outline"
|
||||
tabindex="0"
|
||||
>
|
||||
{{ mygallery.imagefile }}
|
||||
</div>
|
||||
</template>
|
||||
</q-field>
|
||||
|
||||
<q-input v-if="canModify" v-model="mygallery.description" dense :label="$t('proj.longdescr')"
|
||||
@keyup.enter.stop @update:model-value="save" debounce="1000" autofocus>
|
||||
<q-input
|
||||
v-if="canModify"
|
||||
v-model="mygallery.description"
|
||||
dense
|
||||
:label="$t('proj.longdescr')"
|
||||
@keyup.enter.stop
|
||||
@update:model-value="save"
|
||||
debounce="1000"
|
||||
autofocus
|
||||
>
|
||||
</q-input>
|
||||
|
||||
<q-card-actions align="center">
|
||||
<q-btn v-if="canModify" flat round color="blue" icon="fas fa-copy" size="sm"
|
||||
@click="copytoclipboard(mygallery)"></q-btn>
|
||||
<q-btn v-if="canModify" flat round color="red" icon="fas fa-trash-alt" size="sm"
|
||||
@click="deleteFile(mygallery)"></q-btn>
|
||||
<q-btn
|
||||
v-if="canModify"
|
||||
flat
|
||||
round
|
||||
color="blue"
|
||||
icon="fas fa-copy"
|
||||
size="sm"
|
||||
@click="copytoclipboard(mygallery)"
|
||||
></q-btn>
|
||||
<q-btn
|
||||
v-if="canModify"
|
||||
flat
|
||||
round
|
||||
color="red"
|
||||
icon="fas fa-trash-alt"
|
||||
size="sm"
|
||||
@click="deleteFile(mygallery)"
|
||||
></q-btn>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
<div class="q-pa-sm">
|
||||
<div v-if="edit" class="q-gutter-sm" style="max-height: 200px; width: 208px">
|
||||
<q-uploader :label="single &&
|
||||
gallerylist.length > 0 &&
|
||||
gallerylist[0].imagefile !== ''
|
||||
? 'Sostituisci Immagine'
|
||||
: 'Aggiungi Immagine'
|
||||
" accept="image/*" :url="getUrl()" :headers="tools.getheaders()" :max-file-size="3000000"
|
||||
:multiple="!single" auto-upload hide-upload-btn no-thumbnails @uploaded="uploaded" @rejected="onRejected"
|
||||
<div
|
||||
v-if="edit"
|
||||
class="q-gutter-sm"
|
||||
style="max-height: 200px; width: 208px"
|
||||
>
|
||||
<q-uploader
|
||||
:label="
|
||||
single && gallerylist.length > 0 && gallerylist[0].imagefile !== ''
|
||||
? 'Sostituisci Immagine'
|
||||
: 'Aggiungi Immagine'
|
||||
"
|
||||
:accept="getAccept()"
|
||||
:url="getUrl()"
|
||||
:headers="tools.getheaders()"
|
||||
:max-file-size="3000000"
|
||||
:multiple="!single"
|
||||
auto-upload
|
||||
hide-upload-btn
|
||||
no-thumbnails
|
||||
@uploaded="uploaded"
|
||||
@rejected="onRejected"
|
||||
style="width: 208px"
|
||||
:options="uploadOptions"></q-uploader>
|
||||
:options="uploadOptions"
|
||||
></q-uploader>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<q-dialog v-model="displayGall" persistent :maximized="maximizedToggle" transition-show="slide-up"
|
||||
transition-hide="slide-down">
|
||||
<q-dialog
|
||||
v-model="displayGall"
|
||||
persistent
|
||||
:maximized="maximizedToggle"
|
||||
transition-show="slide-up"
|
||||
transition-hide="slide-down"
|
||||
>
|
||||
<q-card>
|
||||
<q-bar class="bg-primary text-white">
|
||||
<q-space />
|
||||
|
||||
<q-btn dense flat icon="minimize" @click="maximizedToggle = false" :disable="!maximizedToggle">
|
||||
<q-tooltip v-if="maximizedToggle" :class="($q.dark.isActive ? `bg-black` : `bg-white`) + ` text-primary`
|
||||
">Minimize</q-tooltip>
|
||||
<q-btn
|
||||
dense
|
||||
flat
|
||||
icon="minimize"
|
||||
@click="maximizedToggle = false"
|
||||
:disable="!maximizedToggle"
|
||||
>
|
||||
<q-tooltip
|
||||
v-if="maximizedToggle"
|
||||
:class="($q.dark.isActive ? `bg-black` : `bg-white`) + ` text-primary`"
|
||||
>Minimize</q-tooltip
|
||||
>
|
||||
</q-btn>
|
||||
<q-btn dense flat icon="crop_square" @click="maximizedToggle = true" :disable="maximizedToggle">
|
||||
<q-tooltip v-if="!maximizedToggle" :class="($q.dark.isActive ? `bg-black` : `bg-white`) + ` text-primary`
|
||||
">Maximize</q-tooltip>
|
||||
<q-btn
|
||||
dense
|
||||
flat
|
||||
icon="crop_square"
|
||||
@click="maximizedToggle = true"
|
||||
:disable="maximizedToggle"
|
||||
>
|
||||
<q-tooltip
|
||||
v-if="!maximizedToggle"
|
||||
:class="($q.dark.isActive ? `bg-black` : `bg-white`) + ` text-primary`"
|
||||
>Maximize</q-tooltip
|
||||
>
|
||||
</q-btn>
|
||||
<q-btn dense flat icon="close" v-close-popup>
|
||||
<q-tooltip :class="($q.dark.isActive ? `bg-black` : `bg-white`) + ` text-primary`
|
||||
">{{ t('dialog.close') }}</q-tooltip>
|
||||
<q-btn
|
||||
dense
|
||||
flat
|
||||
icon="close"
|
||||
v-close-popup
|
||||
>
|
||||
<q-tooltip
|
||||
:class="($q.dark.isActive ? `bg-black` : `bg-white`) + ` text-primary`"
|
||||
>{{ t('dialog.close') }}</q-tooltip
|
||||
>
|
||||
</q-btn>
|
||||
</q-bar>
|
||||
|
||||
@@ -114,23 +270,64 @@
|
||||
|
||||
<q-card-section class="q-pt-none">
|
||||
<div class="row">
|
||||
<div v-for="(mygallery, index) in getlistimages()" :key="index">
|
||||
<div class="q-pa-sm barwidth" @dragenter="onDragEnter" @dragleave="onDragLeave" @dragover="onDragOver">
|
||||
<div
|
||||
v-for="(mygallery, index) in getlistimages()"
|
||||
:key="index"
|
||||
>
|
||||
<div
|
||||
class="q-pa-sm barwidth"
|
||||
@dragenter="onDragEnter"
|
||||
@dragleave="onDragLeave"
|
||||
@dragover="onDragOver"
|
||||
>
|
||||
<q-bar class="bg-primary text-white">
|
||||
<q-btn flat round dense icon="menu" class="q-mr-sm" />
|
||||
<q-btn v-if="canModify" flat round icon="fas fa-copy" size="sm"
|
||||
@click="copytoclipboard(mygallery)"></q-btn>
|
||||
<div>Foto {{ index + 1 }}</div>
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
dense
|
||||
icon="menu"
|
||||
class="q-mr-sm"
|
||||
/>
|
||||
<q-btn
|
||||
v-if="canModify"
|
||||
flat
|
||||
round
|
||||
icon="fas fa-copy"
|
||||
size="sm"
|
||||
@click="copytoclipboard(mygallery)"
|
||||
></q-btn>
|
||||
<div v-if="isIMG()">Foto {{ index + 1 }}</div>
|
||||
<div v-else-if="isPDF()">PDF {{ 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 :id="mygallery._id" :class="getclass()" :data-ind="index" :draggable="canModify"
|
||||
@dragstart="onDragStart" @drop="onDrop">
|
||||
<q-img :src="tools.getsrcimg(mygallery, getrealdirectory())" :class="getclimg()"
|
||||
@click="ImgFullScreen(mygallery)" :alt="mygallery.alt">
|
||||
<div v-if="mygallery.description" class="absolute-bottom text-shadow">
|
||||
<q-card
|
||||
:id="mygallery._id"
|
||||
:class="getclass()"
|
||||
:data-ind="index"
|
||||
:draggable="canModify"
|
||||
@dragstart="onDragStart"
|
||||
@drop="onDrop"
|
||||
>
|
||||
<q-img
|
||||
v-if="isIMG()"
|
||||
:src="tools.getsrcimg(mygallery, getrealdirectory())"
|
||||
:class="getclimg()"
|
||||
@click="ImgFullScreen(mygallery)"
|
||||
:alt="mygallery.alt"
|
||||
>
|
||||
<div
|
||||
v-if="mygallery.description"
|
||||
class="absolute-bottom text-shadow"
|
||||
>
|
||||
<!-- <div class="text-h6 text-trans">{{ mygallery.description }} </div> -->
|
||||
<div class="text-subtitle-carica text-trans">
|
||||
{{ mygallery.description }}
|
||||
@@ -138,51 +335,117 @@
|
||||
</div>
|
||||
</q-img>
|
||||
<q-card-section>
|
||||
<q-field v-if="canModify" stack-label dense label="Nome File">
|
||||
<q-field
|
||||
v-if="canModify"
|
||||
stack-label
|
||||
dense
|
||||
label="Nome File"
|
||||
>
|
||||
<template v-slot:control>
|
||||
<div class="self-center full-width no-outline" tabindex="0">
|
||||
<div
|
||||
class="self-center full-width no-outline"
|
||||
tabindex="0"
|
||||
>
|
||||
{{ mygallery.imagefile }}
|
||||
</div>
|
||||
</template>
|
||||
</q-field>
|
||||
<q-input v-if="canModify" v-model="mygallery.description" dense :label="$t('proj.longdescr')"
|
||||
@keyup.enter.stop @update:model-value="save" debounce="1000" autofocus>
|
||||
<q-input
|
||||
v-if="canModify"
|
||||
v-model="mygallery.description"
|
||||
dense
|
||||
:label="$t('proj.longdescr')"
|
||||
@keyup.enter.stop
|
||||
@update:model-value="save"
|
||||
debounce="1000"
|
||||
autofocus
|
||||
>
|
||||
</q-input>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="canModify" class="q-pa-sm">
|
||||
<div class="q-gutter-sm" style="max-height: 200px; width: 208px">
|
||||
<q-uploader label="Aggiungi Immagine" accept="image/*" :url="getUrl()" :headers="tools.getheaders()"
|
||||
:max-file-size="40000000" multiple auto-upload hide-upload-btn no-thumbnails @uploaded="uploaded"
|
||||
@rejected="onRejected" style="width: 208px"></q-uploader>
|
||||
<div
|
||||
v-if="canModify"
|
||||
class="q-pa-sm"
|
||||
>
|
||||
<div
|
||||
class="q-gutter-sm"
|
||||
style="max-height: 200px; width: 208px"
|
||||
>
|
||||
<q-uploader
|
||||
:label="`Aggiungi ` + getFileTypeStr()"
|
||||
:accept="getAccept()"
|
||||
:url="getUrl()"
|
||||
:headers="tools.getheaders()"
|
||||
:max-file-size="40000000"
|
||||
multiple
|
||||
auto-upload
|
||||
hide-upload-btn
|
||||
no-thumbnails
|
||||
@uploaded="uploaded"
|
||||
@rejected="onRejected"
|
||||
style="width: 208px"
|
||||
></q-uploader>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!isInModif && !isListImgValid && imagebak">
|
||||
<q-card :class="getclass()" @click="ImgFullScreen(mygallery)">
|
||||
<q-img :src="imagebak" :class="getclimg()"> </q-img>
|
||||
<q-card
|
||||
:class="getclass()"
|
||||
@click="ImgFullScreen(mygallery)"
|
||||
>
|
||||
<q-img
|
||||
:src="imagebak"
|
||||
:class="getclimg()"
|
||||
>
|
||||
</q-img>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<q-card-actions align="right">
|
||||
<q-btn v-if="canModify" flat label="Annulla" color="primary" v-close-popup />
|
||||
<q-btn v-if="canModify" label="salva" color="primary" v-close-popup @click="save" />
|
||||
<q-btn v-if="!canModify" label="Chiudi" color="primary" v-close-popup />
|
||||
<q-btn
|
||||
v-if="canModify"
|
||||
flat
|
||||
label="Annulla"
|
||||
color="primary"
|
||||
v-close-popup
|
||||
/>
|
||||
<q-btn
|
||||
v-if="canModify"
|
||||
label="salva"
|
||||
color="primary"
|
||||
v-close-popup
|
||||
@click="save"
|
||||
/>
|
||||
<q-btn
|
||||
v-if="!canModify"
|
||||
label="Chiudi"
|
||||
color="primary"
|
||||
v-close-popup
|
||||
/>
|
||||
</q-card-actions>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
<q-dialog v-model="fullscreen" :maximized="false" transition-show="slide-up" transition-hide="slide-down">
|
||||
<q-dialog
|
||||
v-model="fullscreen"
|
||||
:maximized="false"
|
||||
transition-show="slide-up"
|
||||
transition-hide="slide-down"
|
||||
>
|
||||
<q-card class="my-card">
|
||||
<q-img v-if="fullscreensrc" alt="fullscreen" :src="fullscreensrc" @click="fullscreen = false"></q-img>
|
||||
<q-img
|
||||
v-if="fullscreensrc"
|
||||
alt="fullscreen"
|
||||
:src="fullscreensrc"
|
||||
@click="fullscreen = false"
|
||||
></q-img>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CGallery.ts">
|
||||
</script>
|
||||
<script lang="ts" src="./CGallery.ts"></script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CGallery.scss';
|
||||
|
||||
@@ -520,6 +520,7 @@
|
||||
{{ t(col.label_trans) }}
|
||||
</span>
|
||||
<CGallery
|
||||
:filetype="shared_consts.FILETYPE.IMG"
|
||||
:imagebak="
|
||||
col.showpicprofile_ifnotset
|
||||
? userStore.getImgByProfile(row, true) === ''
|
||||
@@ -559,6 +560,7 @@
|
||||
{{ t(col.label_trans ? col.label_trans : '') }}
|
||||
</span>
|
||||
<CGallery
|
||||
:filetype="shared_consts.FILETYPE.IMG"
|
||||
:imagebak="
|
||||
col.showpicprofile_ifnotset
|
||||
? userStore.getImgByProfile(row['profile'], true)
|
||||
@@ -619,6 +621,76 @@
|
||||
></q-btn>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="col.fieldtype === costanti.FieldType.pdf"
|
||||
style="text-align: center"
|
||||
>
|
||||
<div v-if="canEdit">
|
||||
<span class="text-h7 text-weight-bold row justify-center">
|
||||
{{ t(col.label_trans ? col.label_trans : '') }}
|
||||
</span>
|
||||
<CGallery
|
||||
:filetype="shared_consts.FILETYPE.PDF"
|
||||
:imagebak="
|
||||
col.showpicprofile_ifnotset
|
||||
? userStore.getImgByProfile(row['profile'], true)
|
||||
: ''
|
||||
"
|
||||
:title="tools.getTitleGall(table)"
|
||||
:directory="tools.getDirectoryGall(myrow, table, mypath)"
|
||||
:imgGall="
|
||||
myvalue && myvalue.imagefile
|
||||
? [myvalue]
|
||||
: [{ imagefile: myvalue, vers_img: 1 }]
|
||||
"
|
||||
:edit="isviewfield()"
|
||||
:canModify="canModify"
|
||||
:isInModif="isInModif"
|
||||
:single="true"
|
||||
@update:imgGall="changevalRec"
|
||||
@showandsave="Savedb"
|
||||
>
|
||||
</CGallery>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div
|
||||
v-if="myvalue"
|
||||
class="text-center"
|
||||
>
|
||||
<q-img
|
||||
icon="fas fa-file-pdf"
|
||||
class="text-center"
|
||||
style="height: 100px; width: 100px"
|
||||
alt="foto"
|
||||
>
|
||||
</q-img>
|
||||
</div>
|
||||
<div
|
||||
v-else
|
||||
class="text-center"
|
||||
>
|
||||
<q-img
|
||||
:src="
|
||||
col.showpicprofile_ifnotset
|
||||
? userStore.getImgByProfile(row['profile'], true)
|
||||
: '/images/noimg-user.svg'
|
||||
"
|
||||
class="text-center"
|
||||
style="height: 100px; width: 100px"
|
||||
alt="nessun PDF"
|
||||
>
|
||||
</q-img>
|
||||
</div>
|
||||
<q-btn
|
||||
v-if="myvalue"
|
||||
label="Rimuovi Foto"
|
||||
color="blue"
|
||||
icon="fas fa-trash-alt"
|
||||
size="sm"
|
||||
@click="removephoto"
|
||||
></q-btn>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.image_and_filename">
|
||||
<div v-if="canEdit">
|
||||
{{ t('reg.photo') }}
|
||||
|
||||
@@ -146,7 +146,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function riaggiornaListaProdAlGenitore() {
|
||||
aggiornaLista();
|
||||
aggiornaLista(false);
|
||||
}
|
||||
|
||||
const editOn = computed({
|
||||
@@ -996,15 +996,16 @@ export default defineComponent({
|
||||
persistent: false,
|
||||
})
|
||||
.onOk(() => {
|
||||
aggiornaLista(product);
|
||||
aggiornaLista(false, product);
|
||||
});
|
||||
};
|
||||
|
||||
function aggiornaLista(deleteelem: any = null) {
|
||||
function aggiornaLista(frominput: boolean, deleteelem: any = null) {
|
||||
const precsearch = searchText.value;
|
||||
|
||||
searchText.value = '';
|
||||
internalProducts.value = [...props.lista_prodotti];
|
||||
if (frominput)
|
||||
internalProducts.value = [...props.lista_prodotti];
|
||||
|
||||
if (deleteelem) {
|
||||
internalProducts.value = internalProducts.value.filter(
|
||||
@@ -1054,7 +1055,7 @@ export default defineComponent({
|
||||
// Funzione chiamata alla fine del drag-and-drop
|
||||
const onDragEnd = () => {
|
||||
// console.log("Nuovo ordine:", internalProducts.value);
|
||||
aggiornaLista();
|
||||
aggiornaLista(false);
|
||||
};
|
||||
|
||||
function formatAuthors(authors: IAuthor[] | undefined | null): string {
|
||||
@@ -1119,7 +1120,7 @@ export default defineComponent({
|
||||
return prod;
|
||||
});
|
||||
|
||||
aggiornaLista();
|
||||
aggiornaLista(false);
|
||||
}
|
||||
|
||||
async function updateproductmodif(element: any) {
|
||||
|
||||
Reference in New Issue
Block a user