| | |
| | | <el-table-column label="图片/视频" > |
| | | <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 |
| | | style="width: 80px; height: 80px" |
| | | preview-teleported |
| | | @error="handleThumbnailError(row)" |
| | | /> |
| | | <div class="video-btn" v-if="row.attachmentType === 3 && row.resultUrl" @click="videoClick(row)"> |
| | | <el-icon :size="30" color="#fff"> |
| | |
| | | import {gdTaskResultPageApi, gdTaskResultDownloadApi, gdTaskResultRemoveApi,listByWorkOrderId}from './orderManageApi' |
| | | import { Search, RefreshRight, Download } from '@element-plus/icons-vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { getAiImg, getDictLabel } from '@ztzf/utils' |
| | | import { getDictLabel, appendAiImages } from '@ztzf/utils' |
| | | import dayjs from 'dayjs' |
| | | import VideoPlayDialog from '@/components/VideoPlayDialog.vue' |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | // 缩略图加载失败时展示原图 |
| | | function handleThumbnailError(item) { |
| | | if (item.thumbnail !== item.resultUrl) { |
| | | item.thumbnail = item.resultUrl |
| | | } |
| | | } |
| | | |
| | | // 获取成果数据列表 |
| | | async function getList() { |
| | | loading.value = true |
| | |
| | | ? searchParams.value.patrolTaskIds.join(',') |
| | | : '' |
| | | }) |
| | | list.value = await Promise.all( |
| | | (res?.data?.data?.records ?? []).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?.records ?? []).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) |
| | | } |
| | | }) |
| | | total.value = res?.data?.data?.total || 0 |
| | | } finally { |
| | | loading.value = false |