From 9dfc65ef3cb0d280011588de0e7ecd5229d2b927 Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Tue, 10 Jun 2025 14:22:31 +0800
Subject: [PATCH] Merge branch 'refs/heads/master' into feature/v2.0.0/后台管理数据中心
---
src/views/dataCenter/dataCenter.vue | 179 +++++++++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 135 insertions(+), 44 deletions(-)
diff --git a/src/views/dataCenter/dataCenter.vue b/src/views/dataCenter/dataCenter.vue
index a693c57..185cc2f 100644
--- a/src/views/dataCenter/dataCenter.vue
+++ b/src/views/dataCenter/dataCenter.vue
@@ -17,7 +17,22 @@
<el-table-column prop="filename" label="文件名称" />
<el-table-column property="img" label="缩图" width="120">
<template #default="scope">
+ <img
+ class="quanjing"
+ @click="clickpanorama(scope.row)"
+ v-if="scope.row.fileformat === '全景'"
+ :src="scope.row.img"
+ alt=""
+ />
+ <img
+ v-else-if="scope.row.fileformat === '视频'"
+ :src="convertVideoUrlToThumbnail(scope.row.img)"
+ alt=""
+ class="imageBox"
+ @click="enterFullScreen(scope.row)"
+ />
<el-image
+ v-else
:src="scope.row.img"
:preview-src-list="[scope.row.img]"
fit="cover"
@@ -69,21 +84,22 @@
dialogDetailList?.filename
}}</span>
<el-input
- v-else
- v-model="dialogDetailList.filename"
- @keyup.enter="saveTitle()"
- class="title-input"
- clearable
- />
+ v-else
+ v-model="dialogDetailList.filename"
+ @keyup.enter="saveTitle()"
+ class="title-input"
+ clearable
+ />
</div>
- <div class="editname" @click="editTitle(dialogDetailList)"
- >
- <span v-if="!dialogDetailList.checkedinput"><el-icon><Edit /></el-icon></span>
+ <div class="editname" @click="editTitle(dialogDetailList)">
+ <span v-if="!dialogDetailList.checkedinput"
+ ><el-icon><Edit /></el-icon
+ ></span>
<div v-else class="suffixBoxEdit">
- <div class="editText" @click="submitEditSuffix(item, index)">✔</div>
- <div class="editText" @click="cancelEditSuffix(item, index)">✖</div>
- </div>
+ <div class="editText" @click="submitEditSuffix(item, index)">✔</div>
+ <div class="editText" @click="cancelEditSuffix(item, index)">✖</div>
</div>
+ </div>
</div>
<div>任务名称:{{ dialogDetailList?.taskname }}</div>
<div>所属区域:{{ dialogDetailList?.address }}</div>
@@ -97,13 +113,44 @@
</div>
</div>
</el-dialog>
+ <!-- 全景预览 -->
+ <PanoramaPopup
+ v-model:panoramaParamsShow="panoramaParamsShow"
+ v-model:panoramaParamsUrl="panoramaParamsUrl"
+ ></PanoramaPopup>
+ <!-- 视频预览 -->
+ <el-dialog
+ :title="currentVideoTitle"
+ modal-class="videoDialog"
+ append-to-body
+ width="54%"
+ v-model="VideoShow"
+ :close-on-click-modal="false"
+ :destroy-on-close="true"
+ @close="currentVideoIndex = -1"
+ >
+ <div class="video-container">
+ <video style="width:100%" class="videoBox" ref="videoRefs" controls autoplay :src="currentVideoUrl"></video>
+ </div>
+ </el-dialog>
</div>
</template>
<script setup>
+import PanoramaPopup from '@/components/PanoramaPopup/PanoramaPopup.vue'; //全景
import { ElMessage, ElMessageBox } from 'element-plus';
import searchData from '@/views/dataCenter/components/searchData.vue';
-import fy1 from '@/assets/images/workbench/fy1.png';
+import fy1 from '@/assets/images/dataCenter/1.jpeg';
+
+function convertVideoUrlToThumbnail(videoUrl) {
+ // 检查是否是有效的视频URL
+ if (!videoUrl || typeof videoUrl !== 'string') {
+ return videoUrl;
+ }
+ // 替换文件扩展名
+ const thumbnailUrl = videoUrl.replace(/\.mp4$/, '_small.jpg');
+ return thumbnailUrl;
+}
const jobListParams = reactive({
current: 1,
size: 10,
@@ -127,7 +174,7 @@
date: '2016-05-04',
taskname: '测试任务',
filename: '1111',
- img: fy1,
+ img: 'https://wrj.shuixiongit.com/minio/cloud-bucket/9748effb-f27b-49c8-b57d-3e2c2ac7c03a/DJI_202506100845_010_9748effb-f27b-49c8-b57d-3e2c2ac7c03a/DJI_20250610084758_0002_V.mp4',
timer: '2025-05-26 10:25',
fileclass: '可见光',
fileformat: '视频',
@@ -191,10 +238,27 @@
});
};
// 编辑文件名
-const editTitle = (val) => {
- console.log('val',val);
- val.checkedinput = !val.checkedinput
-
+const editTitle = val => {
+ // console.log('val', val);
+ val.checkedinput = !val.checkedinput;
+};
+// 全景预览
+const panoramaParamsShow = ref(false);
+const panoramaParamsUrl = ref(null);
+const clickpanorama = val => {
+ panoramaParamsShow.value = true;
+ panoramaParamsUrl.value = val.img;
+ // console.log('全景', val);
+};
+// 视频
+const currentVideoTitle = ref('');
+const VideoShow = ref(false);
+const currentVideoUrl = ref(null);
+const enterFullScreen = val => {
+ currentVideoTitle.value = val.filename;
+ VideoShow.value = true;
+ currentVideoUrl.value = val.img;
+ console.log('视频', val);
};
</script>
@@ -226,6 +290,28 @@
justify-content: end;
margin-top: 20px;
}
+ .quanjing,
+ .el-image,
+ .imageBox {
+ cursor: pointer;
+ width: 96px;
+ height: 72px;
+ }
+ .videoDialog :deep(.el-dialog){
+ height: 600px;
+ width: 54%;
+ }
+ .video-container {
+ width: 100%;
+ aspect-ratio: 16/9; /* 按视频比例设置(如16:9) */
+ overflow: hidden; /* 隐藏溢出部分 */
+}
+ .videoBox {
+ width: 100%;
+ height: 100%;
+ object-fit: contain; /* 保持比例完整显示 */
+ display: block;
+ }
}
:deep(.custom-header th.el-table__cell) {
color: rgba(0, 0, 0, 0.85);
@@ -252,8 +338,9 @@
cursor: pointer;
}
.inputEdit {
- display: flex;
- align-items: center;}
+ display: flex;
+ align-items: center;
+ }
}
div {
margin-bottom: 20px;
@@ -271,28 +358,32 @@
}
}
.title-input {
- margin-bottom: 0 !important;
-width: 50%;}
- .suffixBoxEdit {
- display: flex;
- // align-items: center;
- justify-content: space-between;
- margin-bottom: 0 !important;
- font-size: 16px;
- > .editText {
- cursor: pointer;
- margin-right: 6px;
- &:hover {
- transform: scale(1.2);
- }
- }
- .editimg {
- cursor: pointer;
- width: 15px;
- height: 15px;
- &:hover {
- transform: scale(1.2);
- }
- }
- }
+ margin-bottom: 0 !important;
+ width: 70%;
+}
+.editname {
+ margin-bottom: 0 !important;
+}
+.suffixBoxEdit {
+ display: flex;
+ // align-items: center;
+ justify-content: space-between;
+ margin-bottom: 0 !important;
+ font-size: 16px;
+ > .editText {
+ cursor: pointer;
+ margin-right: 6px;
+ &:hover {
+ transform: scale(1.2);
+ }
+ }
+ .editimg {
+ cursor: pointer;
+ width: 15px;
+ height: 15px;
+ &:hover {
+ transform: scale(1.2);
+ }
+ }
+}
</style>
--
Gitblit v1.9.3