This commit is contained in:
parent
f895aeac51
commit
ccb013294d
|
|
@ -631,13 +631,7 @@ function initEnvironmentRecordTable() {
|
||||||
{ field: 'airQuality', title: '空气质量', width: '6%', align: 'center' },
|
{ field: 'airQuality', title: '空气质量', width: '6%', align: 'center' },
|
||||||
{
|
{
|
||||||
title: '视频查看', width: '6%', align: 'center', templet: function (d) {
|
title: '视频查看', width: '6%', align: 'center', templet: function (d) {
|
||||||
const videoUrl = d.videoUrl || d.video || '';
|
return '<a href="javascript:void(0)" style="color: #00FFB8;" onclick="viewVideo()">查看</a>';
|
||||||
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' },
|
{ field: 'analysis', title: '分析改进', width: '6%', align: 'center' },
|
||||||
|
|
@ -669,24 +663,15 @@ function queryRecords() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查看视频
|
// 查看视频
|
||||||
function viewVideo(videoUrlEncoded) {
|
function viewVideo() {
|
||||||
try {
|
// 清空视频源(占位)
|
||||||
// 解码视频URL
|
const videoPlayer = document.getElementById('videoPlayer');
|
||||||
const videoUrl = decodeURIComponent(videoUrlEncoded);
|
if (videoPlayer) {
|
||||||
|
videoPlayer.src = '';
|
||||||
// 设置视频源
|
|
||||||
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 });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 显示弹框
|
||||||
|
$('#videoModal').addClass('show');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 关闭视频查看弹框
|
// 关闭视频查看弹框
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue