| | |
| | | ></video> |
| | | <van-swipe v-else :autoplay="3000" indicator-color="#4C85FF"> |
| | | <van-swipe-item v-for="(img, index) in [mediaSrc]" :key="index"> |
| | | <van-image class="detailImage" :src="img" fit="cover" width="100%" height="235px" |
| | | @click="openPreview(index)" preview-visible="false" /> |
| | | <van-image |
| | | class="detailImage" |
| | | :src="img" |
| | | fit="cover" |
| | | width="100%" |
| | | height="235px" |
| | | @click="openPreview(index)" |
| | | preview-visible="false" |
| | | /> |
| | | </van-swipe-item> |
| | | </van-swipe> |
| | | </div> |
| | |
| | | import { showToast, showNotify, showImagePreview } from 'vant' |
| | | import { getShowImg, getSmallImg } from '@/utils/util' |
| | | import { useRoute,useRouter } from 'vue-router' |
| | | import { getAiImg } from '@ztzf/utils' |
| | | import { getAiImg, replaceWithProxy } from '@ztzf/utils' |
| | | import videojs from 'video.js' |
| | | import 'video.js/dist/video-js.css' |
| | | const keyword = ref('') |
| | |
| | | router.push({ |
| | | path: '/webViewWrapper/mapWork', |
| | | query: { |
| | | currentItem: JSON.stringify(item) |
| | | } |
| | | currentItem: JSON.stringify(item), |
| | | }, |
| | | }) |
| | | } |
| | | |
| | | function replaceWithProxy(url) { |
| | | if (!url) return '' |
| | | return url.replace( |
| | | /^https?:\/\/[^/]+/, |
| | | 'https://wrj.shuixiongit.com/ja-proxy' |
| | | ) |
| | | } |
| | | |
| | | function getVideoType(url) { |
| | |
| | | } catch (error) { |
| | | showToast('分享链接失效') |
| | | } |
| | | |
| | | }) |
| | | |
| | | onBeforeUnmount(destroyPlayer) |
| | |
| | | :deep(.custom-field .van-field__control) { |
| | | padding: 0 !important; |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | </style> |
| | |
| | | function getXTToken() { |
| | | loginApi({ |
| | | "belongSystem": "basic", |
| | | "username": "dkzx01", |
| | | "username": "admin", |
| | | "password": "geovis@123" |
| | | }) |
| | | .then(res => { |
| | |
| | | <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"> |
| | |
| | | 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' |
| | | |
| | |
| | | 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 |
| | | } |
| | |
| | | )" |
| | | > |
| | | <el-image |
| | | :key="item.thumbnail" |
| | | v-if="item.attachmentType === 1 || item.attachmentType === 2" |
| | | :src="item.attachmentType === 1 ? item.resultUrl : item.aiImg" |
| | | :preview-src-list="[item.attachmentType === 1 ? item.resultUrl : item.aiImg]" |
| | | :src="item.thumbnail" |
| | | :preview-src-list="[item.resultUrl]" |
| | | fit="cover" |
| | | preview-teleported |
| | | @error="handleThumbnailError(item)" |
| | | /> |
| | | <div class="video-btn" v-if="item.attachmentType === 3" @click="videoClick(item)"> |
| | | <el-icon :size="30" color="#fff"> |
| | |
| | | <script setup> |
| | | import { computed, ref, onMounted, inject } from 'vue' |
| | | import { ElMessage } from 'element-plus' |
| | | import { fieldRules, flyVisual, geomAnalysis, getAiImg } from '@ztzf/utils' |
| | | import { fieldRules, flyVisual, geomAnalysis, appendAiImages } from '@ztzf/utils' |
| | | import { |
| | | gdPatrolTaskRepublish, |
| | | gdFlyerPageApi, |
| | |
| | | } |
| | | |
| | | let taskResultList = ref([]) |
| | | // 缩略图加载失败时展示原图 |
| | | function handleThumbnailError(item) { |
| | | if (item.thumbnail !== item.resultUrl) { |
| | | item.thumbnail = item.resultUrl |
| | | } |
| | | } |
| | | |
| | | // 获取成果列表 |
| | | async function getTaskResultList() { |
| | | if (!formData.value?.id) return |
| | | try { |
| | | const res = await gdTaskResultListApi({ patrolTaskId: formData.value.id }) |
| | | taskResultList.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 } |
| | | taskResultList.value = (res?.data?.data ?? []).map(item => ({ |
| | | ...item, |
| | | thumbnail: item.resultUrl.replace(/(\.[^./?]+)(\?.*)?$/, '_thumbnail$1$2'), |
| | | })) |
| | | taskResultList.value.forEach(item => { |
| | | if (item.attachmentType === 2 && item.geojson !== '[]' && item.geojson?.length) { |
| | | appendAiImages(item) |
| | | } |
| | | }) |
| | | ) |
| | | } finally { |
| | | } |
| | | } |
| | |
| | | <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 |
| | | @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 |
| | |
| | | }) |
| | | } |
| | | |
| | | // 替换图片请求代理地址 |
| | | export function replaceWithProxy(url) { |
| | | if (!url) return '' |
| | | return url.replace( |
| | | /^https?:\/\/[^/]+/, |
| | | 'https://wrj.shuixiongit.com/ja-proxy' |
| | | ) |
| | | } |
| | | |
| | | // 异步生成算法成果图片 |
| | | export async function appendAiImages(item) { |
| | | try { |
| | | const [resultUrl, thumbnail] = await Promise.all([ |
| | | getAiImg(replaceWithProxy(item.resultUrl), item.geojson), |
| | | getAiImg(replaceWithProxy(item.thumbnail), item.geojson), |
| | | ]) |
| | | console.log() |
| | | if (item.id === '2019312870354416746'){ |
| | | console.log(resultUrl) |
| | | console.log(thumbnail) |
| | | } |
| | | item.resultUrl = resultUrl |
| | | item.thumbnail = thumbnail |
| | | } catch { |
| | | item.thumbnail = item.resultUrl |
| | | } |
| | | } |
| | | |
| | | // 图片转带ai框的图片 |
| | | export function getAiImg(url, aiFrameSource) { |
| | | if (!url) return url |