This commit is contained in:
cwchen 2024-04-22 13:36:54 +08:00
parent 2675a68f77
commit 39bfacc7b0
7 changed files with 139 additions and 42 deletions

View File

@ -13,7 +13,7 @@ function loadProBrief(montageParam) {
loginout(1);
}
}, function (xhr, status, error) {
error(xhr, status, error)
errorFn(xhr, status, error)
setData(null);
}, aqEnnable);
@ -58,7 +58,7 @@ function loadRealMonitor(montageParam) {
loginout(1);
}
}, function (xhr, status, error) {
error(xhr, status, error)
errorFn(xhr, status, error)
setData(null);
}, aqEnnable);
@ -103,7 +103,7 @@ function loadProRisk(montageParam) {
loginout(1);
}
}, function (xhr, status, error) {
error(xhr, status, error)
errorFn(xhr, status, error)
}, aqEnnable);
/* 项目风险赋值 */
@ -125,7 +125,7 @@ function loadProProgress(montageParam) {
loginout(1);
}
}, function (xhr, status, error) {
error(xhr, status, error)
errorFn(xhr, status, error)
}, aqEnnable);
/* 项目进度赋值 */
@ -152,7 +152,7 @@ function loadProCost(montageParam) {
loginout(1);
}
}, function (xhr, status, error) {
error(xhr, status, error)
errorFn(xhr, status, error)
}, aqEnnable);
function setData(data) {
if (data) {

View File

@ -27,8 +27,11 @@ layui.config({
puid = puid.substring(0, puid.length - 2);
if (puid) {
parent.layer.msg("视频加载中,请稍候...", { icon: 16, scrollbar: false, time: 1000, });
QXPlayVideo(puid, '0', winDom)
playControl();
// QXPlayVideo(puid, '0', winDom)
// playControl();
let randomNum = Math.floor(Math.random() * 2) + 1;
console.log(randomNum);
$('#videoPlayer1').attr('src','../../../video/'+randomNum+'.mp4')
videoObject.devCode = puid;
} else {
return parent.layer.msg('请选择球机', { icon: 7 });

View File

@ -378,6 +378,84 @@ function recordVideo() {
}
}
/**
* 录制视频
*/
function recordVideo2() {
let video = $("#videoPlayer1")[0];
let encodeType = "video/webm;codecs=vp9,opus";
let chunks = [];
//创建MediaRecorder设置媒体参数
let stream = video.captureStream();
let start = true;
let recorder = new MediaRecorder(stream, {
mimeType: encodeType
});
//收集录制数据
recorder.ondataavailable = e => {
chunks.push(e.data);
};
// $('#videoLocal')[0].onclick = function () {
$('#videoLocal22')[0].onclick = function () {
if (start) {
videoObject.recordVideoState = true;
parent.layer.msg("开启远程录像", { icon: 0 });
chunks = [];
recorder.start(10);
start = false;
} else {
parent.layer.msg("关闭远程录像", { icon: 0 });
videoObject.recordVideoState = false;
recorder.stop();
download();
start = true;
}
}
//下载录制内容
function download() {
let blob = new Blob(chunks, { type: 'video/webm' });
const a = document.createElement('a');
document.body.appendChild(a)
a.style.display = 'none'
const url = window.URL.createObjectURL(blob);
a.href = url;
a.download = '视频.webm'; //视频下载后的名称
a.click();
document.body.removeChild(a)
window.URL.revokeObjectURL(url);
// let file = new window.File([blob], new Date().getTime() + ".webm", { type: 'video/webm' })
// console.log(file);
// let formData = new FormData();
// formData.append("multipartFile", file)
// let loadingMsg = layer.msg('视频加载中,请稍候...', { icon: 16, scrollbar: false, time: 0 });
/* $.ajax({
url: dataUrl + 'system/sys/video/webmToMp4?token=' + token,
type: 'POST',
headers: {
"encrypt": sm3(JSON.stringify(formData))
},
data: formData,
dataType: 'json',
processData: false,// ⑧告诉jQuery不要去处理发送的数据
contentType: false, // ⑨告诉jQuery不要去设置Content-Type请求头
beforeSend: function () {
},
success: function (result) {
if (result.code === 200) {
layer.close(loadingMsg);
uploadRectFile(result.data);
} else {
layer.msg('视频下载发生异常,请稍后重试', { icon: 16, scrollbar: false, time: 2000 });
}
},
error: function (result) {
}
}); */
}
}
/**
* 本地抓拍
*/

View File

@ -29,11 +29,13 @@
<div id="left-top-one" class="layout">
<div id="one-child">
<div id="yclx" class="layout">
<button id="videoRemote" lay-active="videoRemote"></button>
<!-- <button id="videoRemote" lay-active="videoRemote"></button> -->
<button id="videoLocal22" onclick="recordVideo2()"></button>
<p>远程录像</p>
</div>
<div id="bdlx" class="layout">
<button id="videoLocal"></button>
<!-- <button id="videoLocal"></button> -->
<button id="videoLocal" onclick="recordVideo()"></button>
<p>本地录像</p>
</div>
</div>
@ -53,7 +55,8 @@
</div>
<div id="three-child">
<div id="yczp" class="layout">
<button id="photoRemote" lay-active="photoRemote"></button>
<!-- <button id="photoRemote" lay-active="photoRemote"></button> -->
<button id="photoRemote" onclick="screenshot();"></button>
<p>远程抓拍</p>
</div>
<div id="bdzp" class="layout">
@ -109,7 +112,7 @@
<div id="balla" class="split split-horizontal">
<div id="windowbox" class="ballsplit " ondblclick="ballScreenBig('1')"
style="width: 100%;height: 100%; position: relative;z-index: 9999999999;pointer-events:auto">
<video id="videoPlayer1" class="ball-content"></video>
<video id="videoPlayer1" class="ball-content" autoplay="autoplay" loop="loop" muted controls="controls"></video>
</div>
</div>
</div>

View File

@ -380,24 +380,43 @@ input:-ms-input-placeholder {
color: rgb(191, 191, 191) !important;
}
#quality-ranking-title {
#quality-ranking-title,#alarm-reminder-title {
width: 100%;
height: 40px;
margin-bottom: 10px;
background-color: rgba(52, 231, 254, 0.1);
color: #8BFFFF;
}
#quality-ranking-title p {
width: 18%;
text-align: center;
}
#quality-ranking-title p:nth-child(1) {
width: 28%;
#alarm-reminder-title{
justify-content: space-around;
}
#quality-ranking-table {
width: 100%;
height: calc(100% - 50px);
}
#quality-ranking-title p:first-of-type {
width: 10%;
}
#quality-ranking-title p:nth-of-type(2) {
width: 35%;
}
#quality-ranking-title p:nth-of-type(3) {
width: 25%;
}
#quality-ranking-title p:nth-of-type(4) {
width: 15%;
}
#quality-ranking-title p:last-of-type {
width: 15%;
}
#alarm-reminder-table {
width: 100%;
height: calc(100% - 50px);
}

View File

@ -86,7 +86,6 @@ layui.use(['form','layer', 'element', 'table'], function () {
let valueArr = value.split('@');
loadBidProTower(valueArr[0],valueArr[1]);
});
$("#quality-ranking").niceScroll({ cursorborder: "", cursorcolor: "#c0c4cc", boxzoom: true });
});
$('#indexIframe').attr('src', './views/main.html');
@ -143,14 +142,11 @@ function initQualityRanking() {
<div title="${score}">${score}</div>
</li>`;
$("#quality-ranking-table").append(newRow);
$("#quality-ranking-table").myScroll({
speed: 40, //数值越大,速度越慢
rowHeight: 41 //li的高度
});
})
if (res.data.length) {
$('.quality-ranking__empty').hide()
if (res.data && res.data.length === 0) {
$("#quality-ranking-table").append('<li class="layout"><p>无数据</p></li>');
}
$("#quality-ranking-table").niceScroll({ cursorborder: "", cursorcolor: "#c0c4cc", boxzoom: true });
})
}
@ -1409,9 +1405,10 @@ function initAlarmReminder() {
</li>`;
$("#alarm-reminder-table").append(newRow);
})
if (res.data.length) {
$('.alarm-reminder__empty').hide()
if (res.data && res.data.length === 0) {
$("#alarm-reminder-table").append('<li class="layout" style="justify-content: center;"><p>无数据</p></li>');
}
$("#alarm-reminder-table").niceScroll({ cursorborder: "", cursorcolor: "#c0c4cc", boxzoom: true });
})
}

View File

@ -72,15 +72,6 @@
</div>
</div>
<div id="quality-ranking" style="padding: 7% 3% 3% 3%;">
<!-- <ul id="quality-ranking-table" class="custom-table">
<li class="custom-table__title">
<div style="padding-left: 10px">排名</div>
<div>工程名称</div>
<div>班组名称</div>
<div>班组长</div>
<div>施工质量</div>
</li>
</ul> -->
<div id="quality-ranking-title" class="layout">
<p>排名</p>
<p>工程名称</p>
@ -91,7 +82,6 @@
<ul id="quality-ranking-table" class="custom-table">
</ul>
<!-- <div style="text-align: center; line-height: 32px;" class="quality-ranking__empty">暂无数据</div> -->
</div>
<div id="environment-analysis">
<div id="environment-analysis-1" class="environment-analysis-item">
@ -177,14 +167,21 @@
<div class="resource-rate-item"></div>
<div class="resource-rate-item"></div>
</div>
<div id="alarm-reminder" style="padding: 10% 3% 2% 3%">
<ul id="alarm-reminder-table" class="custom-table">
<div id="alarm-reminder" style="padding: 7% 3% 2% 3%">
<!-- <ul id="alarm-reminder-table" class="custom-table">
<li class="custom-table__title">
<div>工程名称</div>
<div>告警内容</div>
</li>
</ul>
<div style="text-align: center; line-height: 32px;" class="alarm-reminder__empty">暂无数据</div>
<div style="text-align: center; line-height: 32px;" class="alarm-reminder__empty">暂无数据</div> -->
<div id="alarm-reminder-title" class="layout">
<p>工程名称</p>
<p>告警内容</p>
</div>
<ul id="alarm-reminder-table" class="custom-table">
</ul>
</div>
</div>
</div>