This commit is contained in:
parent
4564391d8c
commit
f895aeac51
|
|
@ -631,7 +631,13 @@ function initEnvironmentRecordTable() {
|
|||
{ field: 'airQuality', title: '空气质量', width: '6%', align: 'center' },
|
||||
{
|
||||
title: '视频查看', width: '6%', align: 'center', templet: function (d) {
|
||||
return '<a href="javascript:void(0)" style="color: #00FFB8;" onclick="viewVideo(\'' + (d.monitoringPointNumber || '') + '\')">查看</a>';
|
||||
const videoUrl = d.videoUrl || d.video || '';
|
||||
if (videoUrl) {
|
||||
// 将视频URL编码后传递
|
||||
return '<a href="javascript:void(0)" style="color: #00FFB8;" onclick="viewVideo(\'' + encodeURIComponent(videoUrl) + '\')">查看</a>';
|
||||
} else {
|
||||
return '<span style="color: rgba(255,255,255,0.5);">暂无视频</span>';
|
||||
}
|
||||
}
|
||||
},
|
||||
{ field: 'analysis', title: '分析改进', width: '6%', align: 'center' },
|
||||
|
|
@ -663,9 +669,37 @@ function queryRecords() {
|
|||
}
|
||||
|
||||
// 查看视频
|
||||
function viewVideo(monitoringPointNumber) {
|
||||
layer.msg('查看视频: ' + monitoringPointNumber, { icon: 1 });
|
||||
// 后续实现视频查看功能
|
||||
function viewVideo(videoUrlEncoded) {
|
||||
try {
|
||||
// 解码视频URL
|
||||
const videoUrl = decodeURIComponent(videoUrlEncoded);
|
||||
|
||||
// 设置视频源
|
||||
const videoPlayer = document.getElementById('videoPlayer');
|
||||
if (videoPlayer) {
|
||||
videoPlayer.src = videoUrl;
|
||||
videoPlayer.load();
|
||||
}
|
||||
|
||||
// 显示弹框
|
||||
$('#videoModal').addClass('show');
|
||||
} catch (e) {
|
||||
console.error('解析视频URL失败:', e);
|
||||
layer.msg('视频URL格式错误', { icon: 2 });
|
||||
}
|
||||
}
|
||||
|
||||
// 关闭视频查看弹框
|
||||
function closeVideoModal() {
|
||||
const videoPlayer = document.getElementById('videoPlayer');
|
||||
if (videoPlayer) {
|
||||
// 暂停视频并清空源
|
||||
videoPlayer.pause();
|
||||
videoPlayer.src = '';
|
||||
}
|
||||
|
||||
// 隐藏弹框
|
||||
$('#videoModal').removeClass('show');
|
||||
}
|
||||
|
||||
// 分析与改进
|
||||
|
|
|
|||
|
|
@ -87,6 +87,24 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 视频查看弹框 -->
|
||||
<div id="videoModal" class="video-modal">
|
||||
<div class="modal-overlay" onclick="closeVideoModal()"></div>
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<span class="modal-title">现场视频</span>
|
||||
<span class="modal-close" onclick="closeVideoModal()">×</span>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="video-container">
|
||||
<video id="videoPlayer" controls style="width: 100%; height: 100%; background: #000;">
|
||||
您的浏览器不支持视频播放。
|
||||
</video>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
<style>
|
||||
#proQuality {
|
||||
|
|
@ -362,6 +380,109 @@
|
|||
.table-container::-webkit-scrollbar-thumb:hover {
|
||||
background: rgba(6, 189, 221, 0.8);
|
||||
}
|
||||
|
||||
/* 视频查看弹框样式 */
|
||||
.video-modal {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: none;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 10000;
|
||||
}
|
||||
|
||||
.video-modal.show {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.video-modal .modal-overlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
backdrop-filter: blur(4px);
|
||||
}
|
||||
|
||||
.video-modal .modal-content {
|
||||
position: relative;
|
||||
width: 80%;
|
||||
max-width: 1200px;
|
||||
height: 80%;
|
||||
max-height: 800px;
|
||||
background: rgba(13, 34, 37, 0.95);
|
||||
border: 1px solid rgba(6, 189, 221, 0.6);
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
z-index: 10001;
|
||||
}
|
||||
|
||||
.video-modal .modal-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 15px 20px;
|
||||
background: rgba(13, 34, 37, 0.9);
|
||||
border-bottom: 1px solid rgba(6, 189, 221, 0.3);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.video-modal .modal-title {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.video-modal .modal-close {
|
||||
font-size: 28px;
|
||||
color: #FFFFFF;
|
||||
cursor: pointer;
|
||||
line-height: 1;
|
||||
transition: color 0.3s;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.video-modal .modal-close:hover {
|
||||
color: #00FFB8;
|
||||
background: rgba(6, 189, 221, 0.2);
|
||||
}
|
||||
|
||||
.video-modal .modal-body {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
min-height: 0;
|
||||
background: #000;
|
||||
}
|
||||
|
||||
.video-modal .video-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #000;
|
||||
}
|
||||
|
||||
.video-modal video {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: contain;
|
||||
}
|
||||
</style>
|
||||
<script src="../../js/pages/dataAnalysisOctober/engineeringSafetyAnalysis.js" type="text/javascript"></script>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue