|
|
|
@ -1,6 +1,6 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<div class="relative">
|
|
|
|
<div v-for="(previewImage, index) in document.preview_images" :key="previewImage.id" class="relative">
|
|
|
|
<img
|
|
|
|
<img
|
|
|
|
:src="previewImage.url"
|
|
|
|
:src="previewImage.url"
|
|
|
|
:width="previewImage.metadata.width"
|
|
|
|
:width="previewImage.metadata.width"
|
|
|
|
@ -8,12 +8,15 @@
|
|
|
|
class="rounded border"
|
|
|
|
class="rounded border"
|
|
|
|
loading="lazy"
|
|
|
|
loading="lazy"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
|
|
|
|
<div class="absolute bottom-0 left-0 bg-white text-gray-700 p-1">
|
|
|
|
|
|
|
|
{{ index + 1 }}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
class="group flex justify-end cursor-pointer top-0 bottom-0 left-0 right-0 absolute p-1"
|
|
|
|
class="group flex justify-end cursor-pointer top-0 bottom-0 left-0 right-0 absolute p-1"
|
|
|
|
@click="$emit('scroll-to', item)"
|
|
|
|
@click="$emit('scroll-to', item)"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
v-if="editable"
|
|
|
|
v-if="editable && index==0"
|
|
|
|
class="flex justify-between w-full"
|
|
|
|
class="flex justify-between w-full"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<div style="width: 26px" />
|
|
|
|
<div style="width: 26px" />
|
|
|
|
@ -32,7 +35,7 @@
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<button
|
|
|
|
<button
|
|
|
|
class="btn border-base-200 bg-white text-base-content btn-xs rounded hover:text-base-100 hover:bg-base-content hover:border-base-content w-full transition-colors"
|
|
|
|
class="btn border-base-200 bg-white text-base-content btn-xs rounded hover:text-base-100 hover:bg-red-500 hover:border-base-content w-full transition-colors"
|
|
|
|
style="width: 24px; height: 24px"
|
|
|
|
style="width: 24px; height: 24px"
|
|
|
|
@click.stop="$emit('remove', item)"
|
|
|
|
@click.stop="$emit('remove', item)"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
@ -44,14 +47,14 @@
|
|
|
|
class="flex flex-col space-y-1"
|
|
|
|
class="flex flex-col space-y-1"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<button
|
|
|
|
<button
|
|
|
|
class="btn border-base-200 bg-white text-base-content btn-xs rounded hover:text-base-100 hover:bg-base-content hover:border-base-content w-full transition-colors"
|
|
|
|
class="btn border-base-200 bg-white text-base-content btn-xs rounded hover:text-base-100 hover:bg-red-500 hover:border-base-content w-full transition-colors"
|
|
|
|
style="width: 24px; height: 24px"
|
|
|
|
style="width: 24px; height: 24px"
|
|
|
|
@click.stop="$emit('up', item)"
|
|
|
|
@click.stop="$emit('up', item)"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
↑
|
|
|
|
↑
|
|
|
|
</button>
|
|
|
|
</button>
|
|
|
|
<button
|
|
|
|
<button
|
|
|
|
class="btn border-base-200 bg-white text-base-content btn-xs rounded hover:text-base-100 hover:bg-base-content hover:border-base-content w-full transition-colors"
|
|
|
|
class="btn border-base-200 bg-white text-base-content btn-xs rounded hover:text-base-100 hover:bg-red-500 hover:border-base-content w-full transition-colors"
|
|
|
|
style="width: 24px; height: 24px"
|
|
|
|
style="width: 24px; height: 24px"
|
|
|
|
@click.stop="$emit('down', item)"
|
|
|
|
@click.stop="$emit('down', item)"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
@ -60,6 +63,22 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
|
|
|
v-else
|
|
|
|
|
|
|
|
class="flex justify-between w-full"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
|
|
|
class="flex flex-col justify-between opacity-0 group-hover:opacity-100"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<button
|
|
|
|
|
|
|
|
class="btn border-base-200 bg-white text-base-content btn-xs rounded hover:text-base-100 hover:bg-base-content hover:border-base-content w-full transition-colors"
|
|
|
|
|
|
|
|
style="width: 24px; height: 24px"
|
|
|
|
|
|
|
|
@click.stop="$emit('remove-image', previewImage.id)"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
×
|
|
|
|
|
|
|
|
</button>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="flex pb-2 pt-1.5">
|
|
|
|
<div class="flex pb-2 pt-1.5">
|
|
|
|
@ -119,7 +138,7 @@ export default {
|
|
|
|
default: true
|
|
|
|
default: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
emits: ['scroll-to', 'change', 'remove', 'up', 'down', 'replace'],
|
|
|
|
emits: ['scroll-to', 'change', 'remove', 'up', 'down', 'replace', 'remove-image'],
|
|
|
|
computed: {
|
|
|
|
computed: {
|
|
|
|
previewImage () {
|
|
|
|
previewImage () {
|
|
|
|
return [...this.document.preview_images].sort((a, b) => parseInt(a.filename) - parseInt(b.filename))[0]
|
|
|
|
return [...this.document.preview_images].sort((a, b) => parseInt(a.filename) - parseInt(b.filename))[0]
|
|
|
|
|