- Le immagini uploadate non vengono visualizzate subito... cache... aggiungere la versione dell'immagine: vers_img
- Aggiunto il Server TESTRISO e TEST_PCB.
This commit is contained in:
@@ -101,11 +101,6 @@ export default defineComponent({
|
||||
|
||||
}
|
||||
|
||||
function showandsave(value: any) {
|
||||
console.log('EMIT: showandsave')
|
||||
emit('showandsave', value)
|
||||
}
|
||||
|
||||
function getnumimages() {
|
||||
if (gallerylist.value)
|
||||
return gallerylist.value.length
|
||||
@@ -228,19 +223,31 @@ export default defineComponent({
|
||||
|
||||
function uploaded(info: any) {
|
||||
console.log('uploaded', info)
|
||||
|
||||
let vers_img = tools.getGenerateVersionImage()
|
||||
if (gallerylist.value) {
|
||||
console.log('vers_img', vers_img)
|
||||
if (props.single && info.files) {
|
||||
console.log('gallerylist.value[0]', info.files[0].name)
|
||||
gallerylist.value[0] = { imagefile: info.files[0].name }
|
||||
if (info.files[0].name.imagefile) {
|
||||
gallerylist.value[0] = info.files[0].name
|
||||
} else {
|
||||
gallerylist.value[0] = { imagefile: info.files[0].name, vers_img }
|
||||
}
|
||||
|
||||
} else {
|
||||
for (const file of info.files) {
|
||||
gallerylist.value.push({ imagefile: file.name })
|
||||
if (file.name.imagefile) {
|
||||
gallerylist.value.push(file.name)
|
||||
} else {
|
||||
gallerylist.value.push({ imagefile: file.name, vers_img })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
save()
|
||||
|
||||
console.log('gallerylist', gallerylist.value)
|
||||
console.log('CGALLERY gallerylist', gallerylist.value)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -313,7 +320,7 @@ export default defineComponent({
|
||||
if (!props.single) {
|
||||
emit('showandsave', gallerylist.value)
|
||||
} else {
|
||||
emit('showandsave', gallerylist.value[0].imagefile)
|
||||
emit('showandsave', gallerylist.value[0])
|
||||
}
|
||||
} else {
|
||||
emit('showandsave', !props.single ? [] : '')
|
||||
@@ -331,27 +338,6 @@ export default defineComponent({
|
||||
return props.directory
|
||||
}
|
||||
|
||||
function getsrcimg(gallerylistery: any) {
|
||||
|
||||
if (!gallerylistery.imagefile) {
|
||||
return 'images/noimg.png';
|
||||
}
|
||||
if (gallerylistery) {
|
||||
if (tools.getextfile(gallerylistery.imagefile) === 'pdf')
|
||||
return 'images/images/pdf.jpg'
|
||||
else {
|
||||
if (tools.contieneSlash(gallerylistery.imagefile)) {
|
||||
return gallerylistery.imagefile
|
||||
} else {
|
||||
return costanti.DIR_UPLOAD + getrealdirectory() + '/' + gallerylistery.imagefile
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
return 'images/noimg.png';
|
||||
}
|
||||
}
|
||||
|
||||
function getParamDir() {
|
||||
return tools.escapeslash(getrealdirectory())
|
||||
}
|
||||
@@ -389,7 +375,6 @@ export default defineComponent({
|
||||
getclimg,
|
||||
copytoclipboard,
|
||||
deleteFile,
|
||||
getsrcimg,
|
||||
tools,
|
||||
uploaded,
|
||||
gallerylist,
|
||||
|
||||
@@ -5,90 +5,96 @@
|
||||
<div class="q-pa-xs">
|
||||
<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="getsrcimg(mygallery)" :class="getclimg()"
|
||||
:alt="mygallery.alt">
|
||||
<div v-if="getnumimages() > 1" class="absolute-bottom text-shadow no-padding">
|
||||
: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>
|
||||
</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
|
||||
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-img src="images/noimg.png" :class="getclimg()" alt="no image">
|
||||
</q-img>
|
||||
</q-card>
|
||||
</div>
|
||||
<q-btn
|
||||
v-if="isInModif"
|
||||
color="primary" @click="apri"
|
||||
color="primary"
|
||||
@click="apri"
|
||||
icon="fas fa-file-upload"
|
||||
:label="$t('gallery.load_image')">
|
||||
:label="$t('gallery.load_image')"
|
||||
>
|
||||
</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>
|
||||
flat
|
||||
round
|
||||
color="blue"
|
||||
icon="fas fa-tools"
|
||||
size="md"
|
||||
@click="apri"
|
||||
></q-btn>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div class=" row">
|
||||
|
||||
<div class="row">
|
||||
<!--<q-draggable-rows
|
||||
v-model="order">-->
|
||||
|
||||
<div v-for="(mygallery, index) in getlistimages()" :key="index">
|
||||
<div v-for="(mygallery, index) in getlistimages()" :key="index">
|
||||
<div
|
||||
class="q-pa-sm q-gutter-sm"
|
||||
@dragenter="onDragEnter"
|
||||
@dragleave="onDragLeave"
|
||||
|
||||
@dragover="onDragOver">
|
||||
@dragover="onDragOver"
|
||||
>
|
||||
<q-card
|
||||
:id="mygallery._id" :class="getclass()"
|
||||
:id="mygallery._id"
|
||||
:class="getclass()"
|
||||
:draggable="canModify"
|
||||
@dragstart="onDragStart"
|
||||
@drop="onDrop"
|
||||
>
|
||||
|
||||
<q-img
|
||||
:src="getsrcimg(mygallery)"
|
||||
:src="tools.getsrcimg(mygallery, getrealdirectory())"
|
||||
:class="getclimg()"
|
||||
:alt="mygallery.alt">
|
||||
: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">{{ mygallery.description }}</div>
|
||||
<div class="text-subtitle-carica text-trans">
|
||||
{{ mygallery.description }}
|
||||
</div>
|
||||
</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">{{ mygallery.imagefile }}</div>
|
||||
<div class="self-center full-width no-outline" tabindex="0">
|
||||
{{ mygallery.imagefile }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</q-field>
|
||||
|
||||
<q-input
|
||||
@@ -99,26 +105,47 @@
|
||||
@keyup.enter.stop
|
||||
@update:model-value="save"
|
||||
debounce="1000"
|
||||
autofocus>
|
||||
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>
|
||||
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>
|
||||
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;">
|
||||
<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'"
|
||||
:label="
|
||||
single &&
|
||||
gallerylist.length > 0 &&
|
||||
gallerylist[0].imagefile !== ''
|
||||
? 'Sostituisci Immagine'
|
||||
: 'Aggiungi Immagine'
|
||||
"
|
||||
accept="image/*"
|
||||
:url="getUrl()"
|
||||
:headers="tools.getheaders()"
|
||||
@@ -145,16 +172,45 @@
|
||||
>
|
||||
<q-card>
|
||||
<q-bar class="bg-primary text-white">
|
||||
<q-space/>
|
||||
<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-tooltip
|
||||
:class="
|
||||
($q.dark.isActive ? `bg-black` : `bg-white`) + ` text-primary`
|
||||
"
|
||||
>{{ t('dialog.close') }}</q-tooltip
|
||||
>
|
||||
</q-btn>
|
||||
</q-bar>
|
||||
|
||||
@@ -163,8 +219,7 @@
|
||||
</q-card-section>
|
||||
|
||||
<q-card-section class="q-pt-none">
|
||||
<div class=" row">
|
||||
|
||||
<div class="row">
|
||||
<div v-for="(mygallery, index) in getlistimages()" :key="index">
|
||||
<div
|
||||
class="q-pa-sm barwidth"
|
||||
@@ -172,49 +227,62 @@
|
||||
@dragleave="onDragLeave"
|
||||
@dragover="onDragOver"
|
||||
>
|
||||
<q-bar
|
||||
class="bg-primary text-white"
|
||||
>
|
||||
<q-btn flat round dense icon="menu" class="q-mr-sm"/>
|
||||
<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>
|
||||
flat
|
||||
round
|
||||
icon="fas fa-copy"
|
||||
size="sm"
|
||||
@click="copytoclipboard(mygallery)"
|
||||
></q-btn>
|
||||
<div>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
|
||||
:id="mygallery._id" :class="getclass()"
|
||||
:id="mygallery._id"
|
||||
:class="getclass()"
|
||||
:data-ind="index"
|
||||
:draggable="canModify"
|
||||
@dragstart="onDragStart"
|
||||
@drop="onDrop"
|
||||
>
|
||||
<q-img
|
||||
:src="getsrcimg(mygallery)"
|
||||
:src="tools.getsrcimg(mygallery, getrealdirectory())"
|
||||
:class="getclimg()"
|
||||
@click="ImgFullScreen(mygallery)"
|
||||
:alt="mygallery.alt">
|
||||
<div v-if="mygallery.description" class="absolute-bottom text-shadow">
|
||||
: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 }}</div>
|
||||
<div class="text-subtitle-carica text-trans">
|
||||
{{ mygallery.description }}
|
||||
</div>
|
||||
</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">{{ mygallery.imagefile }}</div>
|
||||
<div
|
||||
class="self-center full-width no-outline"
|
||||
tabindex="0"
|
||||
>
|
||||
{{ mygallery.imagefile }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</q-field>
|
||||
<q-input
|
||||
v-if="canModify"
|
||||
@@ -224,17 +292,15 @@
|
||||
@keyup.enter.stop
|
||||
@update:model-value="save"
|
||||
debounce="1000"
|
||||
autofocus>
|
||||
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;">
|
||||
<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/*"
|
||||
@@ -252,24 +318,34 @@
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!isInModif && !isListImgValid && imagebak">
|
||||
|
||||
<q-card :class="getclass()" @click="ImgFullScreen(mygallery)">
|
||||
<q-img
|
||||
:src="imagebak" :class="getclimg()">
|
||||
</q-img>
|
||||
<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>
|
||||
@@ -280,7 +356,12 @@
|
||||
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>
|
||||
|
||||
@@ -233,7 +233,7 @@ export default defineComponent({
|
||||
if (!myel.value.listcards)
|
||||
myel.value.listcards = []
|
||||
|
||||
myel.value.listcards.push({ _id: objectId(), imagefile: '', alt: '', description: '' })
|
||||
myel.value.listcards.push({ _id: objectId(), imagefile: '', alt: '', description: '', vers_img: 0 })
|
||||
modifElem()
|
||||
|
||||
|
||||
@@ -299,6 +299,7 @@ export default defineComponent({
|
||||
} else if ((props.myelem.type === shared_consts.ELEMTYPE.IMGTITLE) ||
|
||||
(props.myelem.type === shared_consts.ELEMTYPE.IMAGE)) {
|
||||
myel.value.image = myval
|
||||
myel.value.vers_img = tools.getGenerateVersionImage()
|
||||
}
|
||||
modifElem()
|
||||
}
|
||||
@@ -312,13 +313,13 @@ export default defineComponent({
|
||||
|| (myel.value.type === shared_consts.ELEMTYPE.CAROUSEL_IMGS)
|
||||
}
|
||||
|
||||
function updateElem(myvalue: any) {
|
||||
/*function updateElem(myvalue: any) {
|
||||
console.log('updateElem', myvalue)
|
||||
if (myel.value.type === shared_consts.ELEMTYPE.IMGTITLE) {
|
||||
myel.value.container = myvalue
|
||||
}
|
||||
modifElem()
|
||||
}
|
||||
}*/
|
||||
|
||||
function generateSizeOptions() {
|
||||
const options = [];
|
||||
@@ -434,7 +435,7 @@ export default defineComponent({
|
||||
costanti,
|
||||
delRecCard,
|
||||
saveCard,
|
||||
updateElem,
|
||||
// updateElem,
|
||||
showAnimation,
|
||||
tabCard,
|
||||
tabElemsText,
|
||||
|
||||
@@ -746,6 +746,18 @@
|
||||
:fieldtype="costanti.FieldType.image"
|
||||
>
|
||||
</CMyFieldRec>
|
||||
<CMyFieldRec
|
||||
title="Versione Img:"
|
||||
table="myelems"
|
||||
:id="myel._id"
|
||||
:rec="myel"
|
||||
field="vers_img"
|
||||
@update:model-value="modifElem"
|
||||
:canEdit="true"
|
||||
:canModify="true"
|
||||
:fieldtype="costanti.FieldType.number"
|
||||
>
|
||||
</CMyFieldRec>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ export default defineComponent({
|
||||
type: Object as PropType<IColGridTable> | undefined,
|
||||
required: false,
|
||||
default: () => {
|
||||
return { }
|
||||
return {}
|
||||
},
|
||||
},
|
||||
id: {
|
||||
@@ -148,11 +148,10 @@ export default defineComponent({
|
||||
const { setValDb, getValDb } = MixinBase()
|
||||
|
||||
function showandsel(row: any, col: any, newval: any, valinitial: any) {
|
||||
console.log('showandsel CMyFieldDb', row, col, newval)
|
||||
console.log('showandsel CMyFieldDb:', newval)
|
||||
console.log('subkey', props.mysubkey, 'sskey', props.mysubsubkey)
|
||||
|
||||
if (newval !== valinitial) {
|
||||
setValDb($q, props.mykey, newval, props.type, props.serv, props.table, props.mysubkey, props.id, props.indrec, props.mysubsubkey, props.specialField)
|
||||
}
|
||||
tools.saveInDBForTypes($q, props.mykey, newval, props.type, props.serv, props.table, props.mysubkey, props.id, props.indrec, props.mysubsubkey, props.specialField);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -184,8 +184,9 @@ export default defineComponent({
|
||||
if (props.nosaveToDb)
|
||||
return
|
||||
|
||||
if (newval !== valinitial)
|
||||
setValDb($q, mykey.value, newval, props.fieldtype || col.fieldtype, false, props.table, mysubkey.value, props.id, props.indrec, mysubsubkey.value, props.specialField)
|
||||
if (newval !== valinitial) {
|
||||
tools.saveInDBForTypes($q, mykey.value, newval, props.fieldtype || col.fieldtype, false, props.table, mysubkey.value, props.id, props.indrec, mysubsubkey.value, props.specialField)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -294,6 +294,7 @@ export default defineComponent({
|
||||
myImgGall.value = [{
|
||||
_id: '',
|
||||
imagefile: myvalue.value,
|
||||
vers_img: 1,
|
||||
// order: 1,
|
||||
alt: 'img',
|
||||
}]
|
||||
@@ -629,7 +630,7 @@ export default defineComponent({
|
||||
function savefield(value: any, initialval: any, myq: any) {
|
||||
if (!props.insertMode) {
|
||||
myvalue.value = value
|
||||
setValDb(myq, props.field, myvalue.value, props.type, props.serv, props.table, props.subfield, props.id, props.indrec, props.mysubsubkey, props.specialField)
|
||||
tools.saveInDBForTypes(myq, props.field, myvalue.value, props.type, props.serv, props.table, props.subfield, props.id, props.indrec, props.mysubsubkey, props.specialField)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -644,7 +645,7 @@ export default defineComponent({
|
||||
else
|
||||
myvalue.value = value
|
||||
|
||||
setValDb($q, props.field, myvalue, props.type, props.serv, props.table, props.subfield, props.id, props.indrec, props.mysubsubkey, props.specialField)
|
||||
tools.saveInDBForTypes($q, props.field, myvalue, props.type, props.serv, props.table, props.subfield, props.id, props.indrec, props.mysubsubkey, props.specialField)
|
||||
}
|
||||
|
||||
|
||||
@@ -826,7 +827,12 @@ export default defineComponent({
|
||||
function uploaded(info: any) {
|
||||
|
||||
if (info.files) {
|
||||
myvalue.value = tools.geturlrelativeprofile() + '/' + getMyUsername() + '/' + info.files[0].name
|
||||
if (info.files[0].name.imagefile) {
|
||||
myvalue.value = tools.geturlrelativeprofile() + '/' + getMyUsername() + '/' + info.files[0].name.imagefile
|
||||
} else {
|
||||
myvalue.value = tools.geturlrelativeprofile() + '/' + getMyUsername() + '/' + info.files[0].name
|
||||
}
|
||||
|
||||
console.log('uploaded', myvalue.value)
|
||||
savefield(myvalue.value, '', $q)
|
||||
}
|
||||
|
||||
@@ -299,13 +299,13 @@
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.coordinates">
|
||||
<CMapEditAddressByCoord
|
||||
:visuMappa="false"
|
||||
:editaddress="true"
|
||||
v-model:model-value="myvalue"
|
||||
@update:model-value="changeValRecCoordAddr"
|
||||
></CMapEditAddressByCoord>
|
||||
<div v-else-if="col.fieldtype === costanti.FieldType.coordinates">
|
||||
<CMapEditAddressByCoord
|
||||
:visuMappa="false"
|
||||
:editaddress="true"
|
||||
v-model:model-value="myvalue"
|
||||
@update:model-value="changeValRecCoordAddr"
|
||||
></CMapEditAddressByCoord>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="
|
||||
@@ -389,7 +389,9 @@
|
||||
"
|
||||
:title="tools.getTitleGall(table)"
|
||||
:directory="tools.getDirectoryGall(myrow, table, mypath)"
|
||||
:imgGall="myvalue"
|
||||
:imgGall="
|
||||
myvalue && myvalue.imagefile ? myvalue.imagefile : myvalue
|
||||
"
|
||||
:isInModif="isInModif"
|
||||
:edit="isviewfield() && isInModif"
|
||||
:canModify="canModify && isInModif"
|
||||
@@ -426,7 +428,11 @@
|
||||
"
|
||||
:title="tools.getTitleGall(table)"
|
||||
:directory="tools.getDirectoryGall(myrow, table, mypath)"
|
||||
:imgGall="[{ imagefile: myvalue }]"
|
||||
:imgGall="
|
||||
myvalue && myvalue.imagefile
|
||||
? [myvalue]
|
||||
: [{ imagefile: myvalue, vers_img: 1 }]
|
||||
"
|
||||
:edit="isviewfield()"
|
||||
:canModify="canModify"
|
||||
:isInModif="isInModif"
|
||||
@@ -490,7 +496,11 @@
|
||||
"
|
||||
:title="tools.getTitleGall(table)"
|
||||
:directory="tools.getDirectoryGall(myrow, table, mypath)"
|
||||
:imgGall="[{ imagefile: myvalue }]"
|
||||
:imgGall="
|
||||
myvalue && myvalue.imagefile
|
||||
? [myvalue]
|
||||
: [{ imagefile: myvalue, vers_img: 1 }]
|
||||
"
|
||||
:edit="isviewfield()"
|
||||
:canModify="canModify"
|
||||
:isInModif="isInModif"
|
||||
@@ -545,7 +555,9 @@
|
||||
"
|
||||
:title="tools.getTitleGall(table)"
|
||||
:directory="tools.getDirectoryGall(myrow, table, mypath)"
|
||||
:imgGall="[myvalue]"
|
||||
:imgGall="
|
||||
myvalue && myvalue.imagefile ? [myvalue.imagefile] : [myvalue]
|
||||
"
|
||||
:edit="isviewfield()"
|
||||
:canModify="canModify"
|
||||
:isInModif="isInModif"
|
||||
@@ -1601,7 +1613,11 @@
|
||||
"
|
||||
:title="tools.getTitleGall(table)"
|
||||
:directory="tools.getDirectoryGall(myrow, table, mypath)"
|
||||
:imgGall="[{ imagefile: myvalue }]"
|
||||
:imgGall="
|
||||
myvalue && myvalue.imagefile
|
||||
? [myvalue]
|
||||
: [{ imagefile: myvalue, vers_img: 1 }]
|
||||
"
|
||||
:edit="isviewfield()"
|
||||
:canModify="canModify"
|
||||
:isInModif="isInModif"
|
||||
|
||||
@@ -110,7 +110,7 @@ export default defineComponent({
|
||||
type: Object as PropType<IColGridTable> | undefined,
|
||||
required: false,
|
||||
default: () => {
|
||||
return { }
|
||||
return {}
|
||||
},
|
||||
},
|
||||
id: {
|
||||
@@ -151,7 +151,7 @@ export default defineComponent({
|
||||
console.log('showandsel CMyFieldDb', row, col, newval)
|
||||
|
||||
if (newval !== valinitial) {
|
||||
setValDb($q, props.mykey, newval, props.type, props.serv, props.table, props.mysubkey, props.id, props.indrec, props.mysubsubkey, props.specialField)
|
||||
tools.saveInDBForTypes($q, props.mykey, newval, props.type, props.serv, props.table, props.mysubkey, props.id, props.indrec, props.mysubsubkey, props.specialField)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ export default defineComponent({
|
||||
if (Array.isArray(myarr)) {
|
||||
myarr.forEach((imgfile: string) => {
|
||||
if (imgfile) {
|
||||
gallerylist.value.push({ imagefile: imgfile })
|
||||
gallerylist.value.push({ imagefile: imgfile, vers_img: 1 })
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -92,11 +92,6 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
|
||||
function showandsave(value: any) {
|
||||
console.log('EMIT: showandsave')
|
||||
emit('showandsave', value)
|
||||
}
|
||||
|
||||
function getnumimages() {
|
||||
if (gallerylist.value)
|
||||
return gallerylist.value.length
|
||||
@@ -218,12 +213,18 @@ export default defineComponent({
|
||||
|
||||
function uploaded(info: any) {
|
||||
console.log('uploaded', info)
|
||||
let vers_img = tools.getGenerateVersionImage()
|
||||
|
||||
if (gallerylist.value) {
|
||||
for (const file of info.files) {
|
||||
gallerylist.value.push({ imagefile: file.name })
|
||||
if (file.name.imagefile) {
|
||||
gallerylist.value.push(file.name)
|
||||
} else {
|
||||
gallerylist.value.push({ imagefile: file.name, vers_img })
|
||||
}
|
||||
}
|
||||
|
||||
console.log('gallerylist', gallerylist.value)
|
||||
console.log('CSELECtIMAGE gallerylist', gallerylist.value)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,11 +289,11 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function save() {
|
||||
console.log('CGallery save', gallerylist.value)
|
||||
console.log('CSelectImage save', gallerylist.value)
|
||||
if (gallerylist.value.length > 0) {
|
||||
emit('showandsave', gallerylist.value[0].imagefile)
|
||||
emit('showandsave', gallerylist.value[0])
|
||||
} else {
|
||||
emit('showandsave', '')
|
||||
emit('showandsave', { imagefile: '' })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -300,21 +301,6 @@ export default defineComponent({
|
||||
return ''
|
||||
}
|
||||
|
||||
function getsrcimg(imgfile: any) {
|
||||
|
||||
if (!imgfile.imagefile) {
|
||||
return 'images/noimg.png';
|
||||
}
|
||||
if (imgfile) {
|
||||
if (tools.getextfile(imgfile.imagefile) === 'pdf')
|
||||
return 'images/images/pdf.jpg'
|
||||
else
|
||||
return costanti.DIR_UPLOAD + props.directory + '/' + imgfile.imagefile
|
||||
} else {
|
||||
return 'images/noimg.png';
|
||||
}
|
||||
}
|
||||
|
||||
function getParamDir() {
|
||||
return tools.escapeslash(props.directory)
|
||||
}
|
||||
@@ -341,18 +327,25 @@ export default defineComponent({
|
||||
}
|
||||
onMounted(created)
|
||||
|
||||
function getrealdirectory() {
|
||||
if (props.directory == 'productinfos')
|
||||
return 'products'
|
||||
else
|
||||
return props.directory
|
||||
}
|
||||
|
||||
return {
|
||||
getlistimages,
|
||||
onDragStart,
|
||||
onDragEnter,
|
||||
onDragLeave,
|
||||
onDragOver,
|
||||
getrealdirectory,
|
||||
onDrop,
|
||||
getclass,
|
||||
getclimg,
|
||||
copytoclipboard,
|
||||
deleteFile,
|
||||
getsrcimg,
|
||||
tools,
|
||||
uploaded,
|
||||
gallerylist,
|
||||
|
||||
@@ -7,48 +7,57 @@
|
||||
<div v-for="(imgfile, index) in getlistimages()" :key="index">
|
||||
<div v-if="index === 0">
|
||||
<q-img
|
||||
:src="getsrcimg(imgfile)" :class="getclimg()">
|
||||
<div v-if="getnumimages() > 1" class="absolute-bottom text-shadow no-padding">
|
||||
:src="tools.getsrcimg(imgfile, getrealdirectory())"
|
||||
:class="getclimg()"
|
||||
>
|
||||
<div
|
||||
v-if="getnumimages() > 1"
|
||||
class="absolute-bottom text-shadow no-padding"
|
||||
>
|
||||
({{ getnumimages() }})
|
||||
</div>
|
||||
</q-img>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
<div v-else-if="!isInModif && !isListImgValid && imagebak">
|
||||
|
||||
<q-card v-if="imagebak !== costanti.NESSUN_IMMAGINE" :class="getclass()" @click="ImgFullScreen(imgfile)">
|
||||
<q-img
|
||||
:src="imagebak" :class="getclimg()">
|
||||
</q-img>
|
||||
<q-card
|
||||
v-if="imagebak !== costanti.NESSUN_IMMAGINE"
|
||||
:class="getclass()"
|
||||
@click="ImgFullScreen(imgfile)"
|
||||
>
|
||||
<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-img src="images/noimg.png" :class="getclimg()" alt="no image">
|
||||
</q-img>
|
||||
</q-card>
|
||||
</div>
|
||||
<q-btn
|
||||
v-if="isInModif"
|
||||
color="primary" @click="apri"
|
||||
color="primary"
|
||||
@click="apri"
|
||||
icon="fas fa-file-upload"
|
||||
:label="$t('gallery.load_image')">
|
||||
:label="$t('gallery.load_image')"
|
||||
>
|
||||
</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>
|
||||
flat
|
||||
round
|
||||
color="blue"
|
||||
icon="fas fa-tools"
|
||||
size="md"
|
||||
@click="apri"
|
||||
></q-btn>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div class=" row">
|
||||
<div class="row">
|
||||
<!--<q-draggable-rows
|
||||
v-model="order">-->
|
||||
|
||||
@@ -57,34 +66,34 @@
|
||||
class="q-pa-sm q-gutter-sm"
|
||||
@dragenter="onDragEnter"
|
||||
@dragleave="onDragLeave"
|
||||
|
||||
@dragover="onDragOver">
|
||||
@dragover="onDragOver"
|
||||
>
|
||||
<q-card
|
||||
:id="mygallery._id" :class="getclass()"
|
||||
:id="mygallery._id"
|
||||
:class="getclass()"
|
||||
:draggable="canModify"
|
||||
@dragstart="onDragStart"
|
||||
@drop="onDrop"
|
||||
>
|
||||
|
||||
<q-img
|
||||
:src="getsrcimg(mygallery)"
|
||||
:src="tools.getsrcimg(mygallery, getrealdirectory())"
|
||||
:class="getclimg()"
|
||||
:alt="mygallery.alt">
|
||||
: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">{{ mygallery.description }}</div>
|
||||
<div class="text-subtitle-carica text-trans">
|
||||
{{ mygallery.description }}
|
||||
</div>
|
||||
</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">{{ mygallery.imagefile }}</div>
|
||||
<div class="self-center full-width no-outline" tabindex="0">
|
||||
{{ mygallery.imagefile }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</q-field>
|
||||
|
||||
<q-input
|
||||
@@ -95,24 +104,39 @@
|
||||
@keyup.enter.stop
|
||||
@update:model-value="save"
|
||||
debounce="1000"
|
||||
autofocus>
|
||||
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>
|
||||
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>
|
||||
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;">
|
||||
<div
|
||||
v-if="edit"
|
||||
class="q-gutter-sm"
|
||||
style="max-height: 200px; width: 208px"
|
||||
>
|
||||
<q-uploader
|
||||
label="Aggiungi Immagine"
|
||||
accept="image/*"
|
||||
@@ -141,16 +165,45 @@
|
||||
>
|
||||
<q-card>
|
||||
<q-bar class="bg-primary text-white">
|
||||
<q-space/>
|
||||
<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-tooltip
|
||||
:class="
|
||||
($q.dark.isActive ? `bg-black` : `bg-white`) + ` text-primary`
|
||||
"
|
||||
>{{ t('dialog.close') }}</q-tooltip
|
||||
>
|
||||
</q-btn>
|
||||
</q-bar>
|
||||
|
||||
@@ -159,8 +212,7 @@
|
||||
</q-card-section>
|
||||
|
||||
<q-card-section class="q-pt-none">
|
||||
<div class=" row">
|
||||
|
||||
<div class="row">
|
||||
<div v-for="(mygallery, index) in getlistimages()" :key="index">
|
||||
<div
|
||||
class="q-pa-sm barwidth"
|
||||
@@ -168,49 +220,62 @@
|
||||
@dragleave="onDragLeave"
|
||||
@dragover="onDragOver"
|
||||
>
|
||||
<q-bar
|
||||
class="bg-primary text-white"
|
||||
>
|
||||
<q-btn flat round dense icon="menu" class="q-mr-sm"/>
|
||||
<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>
|
||||
flat
|
||||
round
|
||||
icon="fas fa-copy"
|
||||
size="sm"
|
||||
@click="copytoclipboard(mygallery)"
|
||||
></q-btn>
|
||||
<div>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
|
||||
:id="mygallery._id" :class="getclass()"
|
||||
:id="mygallery._id"
|
||||
:class="getclass()"
|
||||
:data-ind="index"
|
||||
:draggable="canModify"
|
||||
@dragstart="onDragStart"
|
||||
@drop="onDrop"
|
||||
>
|
||||
<q-img
|
||||
:src="getsrcimg(mygallery)"
|
||||
:src="tools.getsrcimg(mygallery, getrealdirectory())"
|
||||
:class="getclimg()"
|
||||
@click="ImgFullScreen(mygallery)"
|
||||
:alt="mygallery.alt">
|
||||
<div v-if="mygallery.description" class="absolute-bottom text-shadow">
|
||||
: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 }}</div>
|
||||
<div class="text-subtitle-carica text-trans">
|
||||
{{ mygallery.description }}
|
||||
</div>
|
||||
</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">{{ mygallery.imagefile }}</div>
|
||||
<div
|
||||
class="self-center full-width no-outline"
|
||||
tabindex="0"
|
||||
>
|
||||
{{ mygallery.imagefile }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</q-field>
|
||||
<q-input
|
||||
v-if="canModify"
|
||||
@@ -220,17 +285,15 @@
|
||||
@keyup.enter.stop
|
||||
@update:model-value="save"
|
||||
debounce="1000"
|
||||
autofocus>
|
||||
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;">
|
||||
<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/*"
|
||||
@@ -248,24 +311,34 @@
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!isInModif && !isListImgValid && imagebak">
|
||||
|
||||
<q-card :class="getclass()" @click="ImgFullScreen(mygallery)">
|
||||
<q-img
|
||||
:src="imagebak" :class="getclimg()">
|
||||
</q-img>
|
||||
<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>
|
||||
@@ -276,7 +349,12 @@
|
||||
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>
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!--Prova URL : {{env('PROVA_PAOLO')}}-->
|
||||
<q-form ref="myForm" @submit="onSubmit" @reset="onReset">
|
||||
<div class="q-gutter-xs">
|
||||
<q-input
|
||||
|
||||
@@ -294,6 +294,18 @@ function getDynamicPages(site: ISites): IListRoutes[] {
|
||||
inmenu: false,
|
||||
infooter: false
|
||||
},
|
||||
|
||||
{
|
||||
active: true,
|
||||
order: 1000,
|
||||
path: '/404error',
|
||||
materialIcon: 'fas fa-calendar-plus',
|
||||
name: 'otherpages.error404',
|
||||
component: () => import('@/root/My404page/My404page.vue'),
|
||||
inmenu: false,
|
||||
infooter: false
|
||||
},
|
||||
|
||||
]
|
||||
|
||||
return baseroutes
|
||||
|
||||
@@ -149,6 +149,7 @@ export interface IMyElem {
|
||||
active?: boolean
|
||||
class?: string
|
||||
image?: string
|
||||
vers_img?: number
|
||||
class2?: string
|
||||
class3?: string
|
||||
class4?: string
|
||||
@@ -639,6 +640,7 @@ export interface ITimeLineMain {
|
||||
export interface IImgGallery {
|
||||
_id?: string
|
||||
imagefile: string
|
||||
vers_img: number
|
||||
// order?: number
|
||||
alt?: string
|
||||
description?: string
|
||||
@@ -647,6 +649,7 @@ export interface IImgGallery {
|
||||
export interface IMyCard {
|
||||
_id?: string
|
||||
imagefile?: string
|
||||
vers_img?: number
|
||||
alt?: string
|
||||
description?: string
|
||||
style?: string
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
<template>
|
||||
<div>
|
||||
<q-banner rounded class="bg-negative text-white">
|
||||
<div class="text-h6 text-center">
|
||||
Pagina non Trovata
|
||||
</div>
|
||||
<div class="text-h6 text-center">La Pagina non è stata Trovata</div>
|
||||
</q-banner>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" src="./My404page.ts">
|
||||
|
||||
</script>
|
||||
im
|
||||
|
||||
@@ -47,7 +47,7 @@ function getRoutesAd(site: ISites) {
|
||||
order: 1020,
|
||||
path: '/admin/server',
|
||||
materialIcon: 'event_seat',
|
||||
name: 'pages.server',
|
||||
name: 'otherpages.server',
|
||||
component: () => import('@/views/admin/server/server.vue'),
|
||||
level_parent: 0.0,
|
||||
level_child: 0.5,
|
||||
|
||||
@@ -130,6 +130,7 @@ const msg_it = {
|
||||
myactivities: 'Attività',
|
||||
myactivities2: 'Mie Attività',
|
||||
product: 'Prodotto',
|
||||
server: 'Server',
|
||||
catalogo: 'Catalogo',
|
||||
orderscart: 'Ordini',
|
||||
sito_offline: 'Sito in Aggiornamento',
|
||||
|
||||
@@ -135,6 +135,7 @@ export const colgallery = [
|
||||
export const colmylistcards = [
|
||||
AddCol({ name: 'imagefile', label_trans: 'imagefile', fieldtype: costanti.FieldType.string }),
|
||||
AddCol({ name: 'image', label_trans: 'image', fieldtype: costanti.FieldType.string }),
|
||||
AddCol({ name: 'vers_img', label_trans: 'vers_img', fieldtype: costanti.FieldType.number }),
|
||||
AddCol({ name: 'alt', label_trans: 'alt', fieldtype: costanti.FieldType.string }),
|
||||
AddCol({ name: 'description', label_trans: 'description', fieldtype: costanti.FieldType.string }),
|
||||
AddCol({ name: 'style', label_trans: 'style' }),
|
||||
|
||||
@@ -16,6 +16,8 @@ import {
|
||||
TipoVisu, IGroup, IMySkill, IMyBacheca, IImgGallery, IMsgGlobParam, IUserExport, ISpecialField, IAccount, IMyCircuit, ISendCoin, IMovement, IMovVisu, INotif, IMyElem, IMyCard, ILabelValue, ILabelValueStr, IAnim, ILang, IGroupShort, IPagination, IFavorite, IBookmark,
|
||||
} from '@model'
|
||||
|
||||
import MixinBase from '@/mixins/mixin-base'
|
||||
|
||||
import { fieldsTable } from '@store/Modules/fieldsTable'
|
||||
|
||||
import { addToDate } from '@quasar/quasar-ui-qcalendar'
|
||||
@@ -4425,9 +4427,13 @@ export const tools = {
|
||||
|
||||
getextfile(filename: string) {
|
||||
if (filename) {
|
||||
const mystr = filename.split('.')
|
||||
if (mystr)
|
||||
return mystr.pop()!.toLowerCase()
|
||||
try {
|
||||
const mystr = filename.split('.')
|
||||
if (mystr)
|
||||
return mystr.pop()!.toLowerCase()
|
||||
} catch (e) {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
return ''
|
||||
},
|
||||
@@ -5240,7 +5246,7 @@ export const tools = {
|
||||
const site = globalStore.site
|
||||
|
||||
if (site) {
|
||||
return site.host!.replace(/^(https?:\/\/)/, '');
|
||||
return site.host ? site.host!.replace(/^(https?:\/\/)/, '') : '';
|
||||
}
|
||||
return ''
|
||||
},
|
||||
@@ -7883,19 +7889,33 @@ export const tools = {
|
||||
|
||||
getImgFileByElem(elem: IMyElem, reccard?: IMyCard) {
|
||||
if (elem) {
|
||||
|
||||
let addtourl = ''
|
||||
if (elem && elem.vers_img) {
|
||||
addtourl = '?v=' + elem.vers_img
|
||||
}
|
||||
|
||||
if (elem.type === shared_consts.ELEMTYPE.CARD) {
|
||||
if (reccard?.imagefile)
|
||||
return 'upload/pages/' + elem.path + '/' + reccard.imagefile
|
||||
else
|
||||
if (reccard?.imagefile) {
|
||||
if (reccard.vers_img) {
|
||||
addtourl = '?v=' + reccard.vers_img
|
||||
}
|
||||
|
||||
return 'upload/pages/' + elem.path + '/' + reccard.imagefile + addtourl
|
||||
} else
|
||||
return ''
|
||||
} else if (elem.type === shared_consts.ELEMTYPE.IMAGE) {
|
||||
return 'upload/pages/' + elem.path + '/' + elem.container
|
||||
return 'upload/pages/' + elem.path + '/' + elem.container + addtourl
|
||||
} else {
|
||||
return 'upload/pages/' + elem.path + '/' + elem.image
|
||||
return 'upload/pages/' + elem.path + '/' + elem.image + addtourl
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
getGenerateVersionImage() {
|
||||
return 100000 + Math.round(Math.random() * 899999)
|
||||
},
|
||||
|
||||
findFirstElemInCommon(arr1: ILabelValueStr[], arr2: string[]) {
|
||||
for (let i = 0; i < arr1.length; i++) {
|
||||
for (let j = 0; j < arr2.length; j++) {
|
||||
@@ -8584,7 +8604,11 @@ export const tools = {
|
||||
},
|
||||
|
||||
contieneSlash(str: string) {
|
||||
return str.includes('/');
|
||||
try {
|
||||
return str.includes('/');
|
||||
} catch (e) {
|
||||
return ''
|
||||
}
|
||||
},
|
||||
|
||||
refreshPage() {
|
||||
@@ -8781,8 +8805,68 @@ export const tools = {
|
||||
// Attualmente se sei loggato puoi inserire Record
|
||||
|
||||
return this.isLogged() && this.isUserOk()
|
||||
}
|
||||
},
|
||||
|
||||
getsrcimg(gallerylist: any, dir: string) {
|
||||
|
||||
console.log('getsrcimg', gallerylist)
|
||||
|
||||
let addtourl = ''
|
||||
if (!gallerylist) {
|
||||
return 'images/noimg.png';
|
||||
}
|
||||
if (gallerylist && gallerylist.vers_img) {
|
||||
addtourl = '?v=' + gallerylist.vers_img
|
||||
}
|
||||
|
||||
if (gallerylist && !gallerylist.imagefile) {
|
||||
return 'images/noimg.png';
|
||||
}
|
||||
if (gallerylist) {
|
||||
if (this.getextfile(gallerylist.imagefile) === 'pdf')
|
||||
return 'images/images/pdf.jpg'
|
||||
else {
|
||||
if (this.contieneSlash(gallerylist.imagefile)) {
|
||||
return gallerylist.imagefile + addtourl
|
||||
} else {
|
||||
return costanti.DIR_UPLOAD + dir + '/' + gallerylist.imagefile + addtourl
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
return 'images/noimg.png';
|
||||
}
|
||||
},
|
||||
|
||||
async saveInDBForTypes($q: any, mykey: string, newval: any, type: any, serv: boolean, table?: string, mysubkey: string, id: any, indrec?: number, mysubsubkey: string, specialField: ISpecialField): boolean {
|
||||
|
||||
const { setValDb, getValDb } = MixinBase()
|
||||
|
||||
let eseguito = false
|
||||
|
||||
if (table === 'myelems') {
|
||||
if (type === costanti.FieldType.image && newval.imagefile) {
|
||||
|
||||
let myval = newval.imagefile
|
||||
setValDb($q, mykey, myval, type, serv, table, mysubkey, id, indrec, mysubsubkey, specialField)
|
||||
myval = newval.vers_img
|
||||
let mykey2 = 'vers_img'
|
||||
setValDb($q, mykey2, myval, type, serv, table, mysubkey, id, indrec, mysubsubkey, specialField)
|
||||
|
||||
eseguito = true
|
||||
}
|
||||
}
|
||||
|
||||
if (!eseguito) {
|
||||
|
||||
// if (newval !== valinitial) {
|
||||
setValDb($q, mykey, newval, type, serv, table, mysubkey, id, indrec, mysubsubkey, specialField)
|
||||
// }
|
||||
}
|
||||
|
||||
return eseguito
|
||||
|
||||
},
|
||||
|
||||
// FINE !
|
||||
|
||||
|
||||
@@ -989,7 +989,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
},
|
||||
|
||||
async saveCfgServerKey(dataval: ICfgServer) {
|
||||
console.log('saveCfgServerKey dataval', dataval)
|
||||
//console.log('saveCfgServerKey dataval', dataval)
|
||||
|
||||
const ris = await Api.SendReq('/admin/updateval', 'POST', { pairval: dataval })
|
||||
},
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
.results-container {
|
||||
border: 2px solid #4CAF50;
|
||||
/* Colore del bordo */
|
||||
border-radius: 10px;
|
||||
/* Angoli arrotondati */
|
||||
padding: 20px;
|
||||
/* Spaziatura interna */
|
||||
background-color: #f9f9f9;
|
||||
/* Colore di sfondo */
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
||||
/* Ombra */
|
||||
margin: 20px 0;
|
||||
/* Margine sopra e sotto */
|
||||
}
|
||||
|
||||
.results-title {
|
||||
color: #333;
|
||||
/* Colore del testo */
|
||||
font-family: Arial, sans-serif;
|
||||
/* Tipo di font */
|
||||
margin-bottom: 15px;
|
||||
/* Spaziatura sotto il titolo */
|
||||
font-size: 24px;
|
||||
/* Dimensione del font */
|
||||
}
|
||||
|
||||
.results-content {
|
||||
color: #555;
|
||||
/* Colore del testo dei risultati */
|
||||
font-family: Arial, sans-serif;
|
||||
/* Tipo di font */
|
||||
font-size: 18px;
|
||||
/* Dimensione del font */
|
||||
white-space: pre-wrap;
|
||||
/* Mantiene gli spazi e le interruzioni di riga */
|
||||
}
|
||||
@@ -36,6 +36,7 @@ export default defineComponent({
|
||||
const defpersmax = ref(200)
|
||||
const search_username = ref('')
|
||||
const replace_username = ref('')
|
||||
const risultato = ref('')
|
||||
const incaricamento = ref(false)
|
||||
|
||||
function EseguiFunz(miafunz: string, search_username?: string, replace_username?: string, valmin?: number, valmax?: number, circuitId?: string) {
|
||||
@@ -80,12 +81,9 @@ export default defineComponent({
|
||||
|
||||
ris.value = ''
|
||||
|
||||
if (miafunz === 'visuPlacca') {
|
||||
placca.value = risfunz.placca
|
||||
} else if (miafunz === 'visuListaIngresso' || miafunz === 'visuListaIngressoNuovi' || miafunz === 'visuNaviUtentiEliminati'
|
||||
|| miafunz === 'visuListaNave' || miafunz === 'visuNave' || miafunz === 'creaNavi'
|
||||
|| (miafunz === 'visuStat')) {
|
||||
placca.value = risfunz.mystr
|
||||
risultato.value = ''
|
||||
if (risfunz.data && risfunz.data.mystr) {
|
||||
risultato.value = risfunz.data.mystr
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -106,6 +104,7 @@ export default defineComponent({
|
||||
circuitStore,
|
||||
incaricamento,
|
||||
ris,
|
||||
risultato,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -98,29 +98,6 @@
|
||||
<br>
|
||||
|
||||
</div>
|
||||
<div v-if="!incaricamento" class="row">
|
||||
<CMyFieldDb title="Riga"
|
||||
mykey="riga"
|
||||
:serv="false"
|
||||
:type="costanti.FieldType.number">
|
||||
</CMyFieldDb>
|
||||
<CMyFieldDb title="Col"
|
||||
mykey="col"
|
||||
:serv="false"
|
||||
:type="costanti.FieldType.number">
|
||||
</CMyFieldDb>
|
||||
<CMyFieldDb title="Visu_TEST"
|
||||
mykey="VISU_TEST"
|
||||
:serv="false"
|
||||
:type="costanti.FieldType.boolean">
|
||||
</CMyFieldDb>
|
||||
<CMyFieldDb title="VISU_NAVE_BOT"
|
||||
mykey="VISU_NAVE_BOT"
|
||||
:serv="false"
|
||||
:type="costanti.FieldType.boolean">
|
||||
</CMyFieldDb>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<q-btn label="Statistiche" color="warning" @click="EseguiFunz('visuStat')"></q-btn>
|
||||
|
||||
@@ -705,8 +682,20 @@
|
||||
color="positive"
|
||||
@click="EseguiFunz('insertGeojsonToMongoDB')"
|
||||
></q-btn>
|
||||
<q-btn
|
||||
label="Lista Tabelle Database (spazio occupato)"
|
||||
color="positive"
|
||||
@click="EseguiFunz('listCollectionsBySize')"
|
||||
></q-btn>
|
||||
<br />
|
||||
</div>
|
||||
|
||||
<div class="results-container">
|
||||
<h2 class="results-title">Risultati:</h2>
|
||||
<div class="results-content">
|
||||
{{ risultato }}
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
|
||||
Reference in New Issue
Block a user