From 7320bc8910fbfe1488a236aa1588e4d388c3f36c Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Tue, 11 Aug 2026 18:47:35 +0800
Subject: [PATCH] feat: 预览
---
applications/task-work-order/src/views/orderView/orderManage/clueEvents/ViewDiaLog.vue | 31 +++++++++++++++++++++----------
1 files changed, 21 insertions(+), 10 deletions(-)
diff --git a/applications/task-work-order/src/views/orderView/orderManage/clueEvents/ViewDiaLog.vue b/applications/task-work-order/src/views/orderView/orderManage/clueEvents/ViewDiaLog.vue
index 8a5d01b..cf88e59 100644
--- a/applications/task-work-order/src/views/orderView/orderManage/clueEvents/ViewDiaLog.vue
+++ b/applications/task-work-order/src/views/orderView/orderManage/clueEvents/ViewDiaLog.vue
@@ -5,12 +5,14 @@
<el-table-column label="线索缩略图" width="120">
<template v-slot="{ row }">
<el-image
+ :key="row.thumbnail"
v-if="row.attachmentType === 1 || row.attachmentType === 2"
- :src="row.attachmentType === 1 ? row.resultUrl : row.aiImg"
- :preview-src-list="[row.attachmentType === 1 ? row.resultUrl : row.aiImg]"
+ :src="row.thumbnail"
+ :preview-src-list="[row.resultUrl]"
fit="cover"
style="width: 80px; height: 80px"
preview-teleported
+ @error="handleThumbnailError(row)"
/>
<div class="video-btn" v-if="row.attachmentType === 3" @click="videoClick(row)">
<el-icon :size="30" color="#fff">
@@ -67,7 +69,7 @@
import { ref } from 'vue'
import { gdTaskResultListApi } from './achievementApi'
import DistributeDiaLog from './DistributeDiaLog.vue'
-import { getAiImg } from '@ztzf/utils'
+import { appendAiImages } from '@ztzf/utils'
import { VideoPlay } from '@element-plus/icons-vue'
import VideoPlayDialog from '@/components/VideoPlayDialog.vue'
@@ -110,19 +112,28 @@
return row.areaCode || '-'
}
+// 缩略图加载失败时展示原图
+function handleThumbnailError(item) {
+ if (item.thumbnail !== item.resultUrl) {
+ item.thumbnail = item.resultUrl
+ }
+}
+
// 获取成果列表
async function getList() {
if (!currentRow.value?.id) return
loading.value = true
try {
const res = await gdTaskResultListApi({ patrolTaskId: currentRow.value.id })
- list.value = await Promise.all(
- (res?.data?.data ?? []).map(async item => {
- if (item.attachmentType !== 2) return item
- const aiImg = await getAiImg(item.resultUrl, item.geojson)
- return { ...item, aiImg }
- })
- )
+ list.value = (res?.data?.data ?? []).map(item => ({
+ ...item,
+ thumbnail: item.resultUrl.replace(/(\.[^./?]+)(\?.*)?$/, '_thumbnail$1$2'),
+ }))
+ list.value.forEach(item => {
+ if (item.attachmentType === 2 && item.geojson !== '[]' && item.geojson?.length) {
+ appendAiImages(item)
+ }
+ })
} finally {
loading.value = false
}
--
Gitblit v1.9.3