|
@@ -8,6 +8,13 @@
|
|
|
|
|
|
|
|
<hardware-check @confirm="onHardwareCheckConfirm"/>
|
|
<hardware-check @confirm="onHardwareCheckConfirm"/>
|
|
|
|
|
|
|
|
|
|
+ <ImagePreview
|
|
|
|
|
+ :visible="previewVisible"
|
|
|
|
|
+ :list="previewList"
|
|
|
|
|
+ :initial-index="previewInitialIndex"
|
|
|
|
|
+ @close="previewVisible = false"
|
|
|
|
|
+ />
|
|
|
|
|
+
|
|
|
<div class="photography-page flex-col">
|
|
<div class="photography-page flex-col">
|
|
|
<div class="main-container">
|
|
<div class="main-container">
|
|
|
<div class="content-wrapper flex-col">
|
|
<div class="content-wrapper flex-col">
|
|
@@ -131,15 +138,11 @@
|
|
|
v-loading="!image.PhotoRecord.image_path && runAction.goods_art_no == item.goods_art_no"
|
|
v-loading="!image.PhotoRecord.image_path && runAction.goods_art_no == item.goods_art_no"
|
|
|
>
|
|
>
|
|
|
<!-- <span class="tag" v-if="!image.PhotoRecord.image_path">{{ image.action_name }}</span>-->
|
|
<!-- <span class="tag" v-if="!image.PhotoRecord.image_path">{{ image.action_name }}</span>-->
|
|
|
- <div class="el-image_view" >
|
|
|
|
|
|
|
+ <div class="el-image_view" @click="image.PhotoRecord.image_path && openPreview(item, index)">
|
|
|
<el-image
|
|
<el-image
|
|
|
:src="thumbnailMap[image.PhotoRecord.image_path] || getFilePath(image.PhotoRecord.image_path)"
|
|
:src="thumbnailMap[image.PhotoRecord.image_path] || getFilePath(image.PhotoRecord.image_path)"
|
|
|
- :preview-src-list="getPreviewImageList(item)"
|
|
|
|
|
- hide-on-click-modal
|
|
|
|
|
- :initial-index="getPreviewIndex(item, index)"
|
|
|
|
|
class="preview-image"
|
|
class="preview-image"
|
|
|
fit="contain"
|
|
fit="contain"
|
|
|
- :preview-teleported="true"
|
|
|
|
|
lazy
|
|
lazy
|
|
|
>
|
|
>
|
|
|
<template #placeholder>
|
|
<template #placeholder>
|
|
@@ -151,7 +154,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
</el-image>
|
|
</el-image>
|
|
|
- <el-button v-if="image.action_name && !runLoading && !takePictureLoading" :disabled="runLoading || takePictureLoading" class="reset-button" @click="reTakePicture(image.PhotoRecord)" v-log="{ describe: { action: '重拍单张图片', goods_art_no: image.PhotoRecord.goods_art_no, action_name: image.action_name } }">重拍</el-button>
|
|
|
|
|
|
|
+ <el-button v-if="image.action_name && !runLoading && !takePictureLoading" :disabled="runLoading || takePictureLoading" class="reset-button" @click.stop="reTakePicture(image.PhotoRecord)" v-log="{ describe: { action: '重拍单张图片', goods_art_no: image.PhotoRecord.goods_art_no, action_name: image.action_name } }">重拍</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -222,6 +225,7 @@ import HardwareCheck from '@/components/check/index.vue'
|
|
|
import RemoteControl from '@/views/RemoteControl/index.vue'
|
|
import RemoteControl from '@/views/RemoteControl/index.vue'
|
|
|
import usePhotography from './mixin/usePhotography'
|
|
import usePhotography from './mixin/usePhotography'
|
|
|
import { useThumbnails } from './composables/useThumbnails'
|
|
import { useThumbnails } from './composables/useThumbnails'
|
|
|
|
|
+import ImagePreview, { PreviewItem } from '@/components/PreviewImage/index.vue'
|
|
|
import generate from '@/utils/menus/generate'
|
|
import generate from '@/utils/menus/generate'
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
|
|
|
|
@@ -374,16 +378,19 @@ const onHardwareCheckConfirm = () => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// 获取预览图片列表(只包含有图片路径的,保持原始顺序)
|
|
|
|
|
-const getPreviewImageList = (item: any) => {
|
|
|
|
|
|
|
+// 获取预览图片列表(只包含有图片路径的,保持原始顺序),携带 action_name 用于大图预览展示
|
|
|
|
|
+const getPreviewImageList = (item: any): PreviewItem[] => {
|
|
|
if (!item || !item.items) return []
|
|
if (!item || !item.items) return []
|
|
|
return item.items
|
|
return item.items
|
|
|
.filter((img: any) => img.PhotoRecord?.image_path)
|
|
.filter((img: any) => img.PhotoRecord?.image_path)
|
|
|
- .map((img: any) => getFilePath(img.PhotoRecord.image_path))
|
|
|
|
|
|
|
+ .map((img: any) => ({
|
|
|
|
|
+ url: getFilePath(img.PhotoRecord.image_path),
|
|
|
|
|
+ action_name: img.action_name,
|
|
|
|
|
+ }))
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 获取当前图片在预览列表中的索引
|
|
// 获取当前图片在预览列表中的索引
|
|
|
-const getPreviewIndex = (item: any, currentIndex: number) => {
|
|
|
|
|
|
|
+const getPreviewIndex = (item: any, currentIndex: number): number => {
|
|
|
if (!item || !item.items) return 0
|
|
if (!item || !item.items) return 0
|
|
|
// 计算当前图片在过滤后的预览列表中的索引
|
|
// 计算当前图片在过滤后的预览列表中的索引
|
|
|
let previewIndex = 0
|
|
let previewIndex = 0
|
|
@@ -396,6 +403,18 @@ const getPreviewIndex = (item: any, currentIndex: number) => {
|
|
|
return previewIndex
|
|
return previewIndex
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// 大图预览状态
|
|
|
|
|
+const previewVisible = ref(false)
|
|
|
|
|
+const previewList = ref<PreviewItem[]>([])
|
|
|
|
|
+const previewInitialIndex = ref(0)
|
|
|
|
|
+
|
|
|
|
|
+// 打开大图预览
|
|
|
|
|
+const openPreview = (item: any, index: number) => {
|
|
|
|
|
+ previewList.value = getPreviewImageList(item)
|
|
|
|
|
+ previewInitialIndex.value = getPreviewIndex(item, index)
|
|
|
|
|
+ previewVisible.value = true
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
|
await getPhotoRecords()
|
|
await getPhotoRecords()
|
|
|
initEventListeners()
|
|
initEventListeners()
|