- 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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user