diff --git a/js/pages/index/indexAjax.js b/js/pages/index/indexAjax.js index f1ff872..568a146 100644 --- a/js/pages/index/indexAjax.js +++ b/js/pages/index/indexAjax.js @@ -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) { diff --git a/js/pages/video/video.js b/js/pages/video/video.js index 858d01c..5adcdd3 100644 --- a/js/pages/video/video.js +++ b/js/pages/video/video.js @@ -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 }); diff --git a/js/pages/video/videoConnect.js b/js/pages/video/videoConnect.js index 4a6b991..314788b 100644 --- a/js/pages/video/videoConnect.js +++ b/js/pages/video/videoConnect.js @@ -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) { + } + }); */ + } +} + /** * 本地抓拍 */ diff --git a/pages/video/video.html b/pages/video/video.html index 1d38e4c..97dbac1 100644 --- a/pages/video/video.html +++ b/pages/video/video.html @@ -29,11 +29,13 @@
- + +

远程录像

- + +

本地录像

@@ -53,7 +55,8 @@
- + +

远程抓拍

@@ -109,7 +112,7 @@
- +
diff --git a/pages/web/css/main.css b/pages/web/css/main.css index b61267f..d4b148a 100644 --- a/pages/web/css/main.css +++ b/pages/web/css/main.css @@ -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); } \ No newline at end of file diff --git a/pages/web/js/main.js b/pages/web/js/main.js index 0355760..91d54e8 100644 --- a/pages/web/js/main.js +++ b/pages/web/js/main.js @@ -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() {
${score}
`; $("#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('
  • 无数据

  • '); } + $("#quality-ranking-table").niceScroll({ cursorborder: "", cursorcolor: "#c0c4cc", boxzoom: true }); }) } @@ -1409,9 +1405,10 @@ function initAlarmReminder() { `; $("#alarm-reminder-table").append(newRow); }) - if (res.data.length) { - $('.alarm-reminder__empty').hide() + if (res.data && res.data.length === 0) { + $("#alarm-reminder-table").append('
  • 无数据

  • '); } + $("#alarm-reminder-table").niceScroll({ cursorborder: "", cursorcolor: "#c0c4cc", boxzoom: true }); }) } diff --git a/pages/web/views/main.html b/pages/web/views/main.html index d686144..c319579 100644 --- a/pages/web/views/main.html +++ b/pages/web/views/main.html @@ -72,15 +72,6 @@
    -

    排名

    工程名称

    @@ -91,7 +82,6 @@ -
    @@ -177,14 +167,21 @@
    -
    -
      +
      + +
      +

      工程名称

      +

      告警内容

      +
      +
        + +