From f85b03cdde10589af174067c27720c257059cbcd Mon Sep 17 00:00:00 2001 From: whycq <10027870+whycq@user.noreply.gitee.com> Date: 星期三, 30 八月 2023 12:47:37 +0800 Subject: [PATCH] # 显示屏 --- src/main/webapp/views/monitor/js/monitor.js | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 113 insertions(+), 1 deletions(-) diff --git a/src/main/webapp/views/monitor/js/monitor.js b/src/main/webapp/views/monitor/js/monitor.js index 8889133..c99b0f8 100644 --- a/src/main/webapp/views/monitor/js/monitor.js +++ b/src/main/webapp/views/monitor/js/monitor.js @@ -8,9 +8,13 @@ setInterval(function () { setDate(); - initlinChart(); + initlineChart(); initPieChart(); }, 1000); + +setInterval(function () { + getOther(); +}, 500); function setDate() { getDate(); @@ -45,3 +49,111 @@ } +/** + * 鑾峰彇鍏朵粬鏁版嵁 + */ +function getOther() { + http.get(baseUrl+"/monitor/other", {crnId: getUrlVal("crnId"), ledId: getUrlVal("ledId")}, function (res) { + if (res.code === 200){ + + // 宸� + $('#xDistance').text(res.data.xDistance); + $('#yDistance').text(res.data.yDistance); + $('#xDuration').text(res.data.xDuration); + $('#yDuration').text(res.data.yDuration); + + // 涓笂 + crnChartOption.series[0].data[0].value = res.data.xSpeed - 0; // 璧拌 + crnChartOption.series[1].data[0].value = res.data.ySpeed - 0; // 鍗囬檷 + crnChartOption.series[2].data[0].value = res.data.zSpeed - 0; // 鍙夌墮 + crnChartOption.series[3].data[0].value = res.data.forkPos - 0; // 璐у弶浣嶇疆 + // crnChartOption.series[0].data[0].value = (Math.random()*100).toFixed(2) - 0; + // crnChartOption.series[1].data[0].value = (Math.random()*7).toFixed(2) - 0; + // crnChartOption.series[2].data[0].value = (Math.random()*2).toFixed(2) - 0; + // crnChartOption.series[3].data[0].value = (Math.random()*2).toFixed(2) - 0; + crnChart.setOption(crnChartOption); + + // 涓笅 + if (res.data.isShow) { + $('#banner').hide(); + $('#led-content').show(); + $('#led-p-content').text(res.data.content); + } else { + $('#led-content').hide(); + $('#banner').show(); + $('#led-p-content').text(""); + } + + } else if (res.code === 403){ + parent.location.href = baseUrl+"/login"; + } else { + layer.msg("杩炴帴鏈嶅姟鍣ㄥけ璐�", {icon: 2}); + } + }) + +} + +// 鍏ㄥ睆 ----------------------------------------------------------------------- + +//寮�濮嬪叏灞� +function full() { + var docElm = document.documentElement; + //W3C + if (docElm.requestFullscreen) { + docElm.requestFullscreen(); + } + //FireFox + else if (docElm.mozRequestFullScreen) { + docElm.mozRequestFullScreen(); + } + //Chrome绛� + else if (docElm.webkitRequestFullScreen) { + docElm.webkitRequestFullScreen(); + } + //IE11 + else if (elem.msRequestFullscreen) { + elem.msRequestFullscreen(); + } +} + +//閫�鍑哄叏灞� +function exitFull() { + if (document.exitFullscreen) { + document.exitFullscreen(); + } + else if (document.mozCancelFullScreen) { + document.mozCancelFullScreen(); + } + else if (document.webkitCancelFullScreen) { + document.webkitCancelFullScreen(); + } + else if (document.msExitFullscreen) { + document.msExitFullscreen(); + } +} + +//浜嬩欢鐩戝惉 +document.addEventListener("fullscreenchange", function () { + try { + fullscreenState.innerHTML = (document.fullscreen) ? "" : "not "; + } catch (e) {} +}, false); +document.addEventListener("mozfullscreenchange", function () { + fullscreenState.innerHTML = (document.mozFullScreen) ? "" : "not "; +}, false); +document.addEventListener("webkitfullscreenchange", function () { + fullscreenState.innerHTML = (document.webkitIsFullScreen) ? "" : "not "; +}, false); +document.addEventListener("msfullscreenchange", function () { + fullscreenState.innerHTML = (document.msFullscreenElement) ? "" : "not "; +}, false); +document.onkeyup = function (e) { + if (window.event)//濡傛灉window.event瀵硅薄瀛樺湪锛屽氨浠ユ浜嬩欢瀵硅薄涓哄噯 + e = window.event; + var key = e.charCode || e.keyCode; + if (key === 13 || key === 49 || key === 97) { + full(); + } else if (key === 50 || key === 98) { + exitFull(); + } +} -- Gitblit v1.9.1