From 718dd839d68cea067b554624b044c1a2be30659e Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期一, 04 一月 2021 11:24:45 +0800
Subject: [PATCH] #
---
src/main/webapp/views/monitor/js/monitor.js | 129 ++++++++++++++++++++++++++++++++++++++++--
1 files changed, 121 insertions(+), 8 deletions(-)
diff --git a/src/main/webapp/views/monitor/js/monitor.js b/src/main/webapp/views/monitor/js/monitor.js
index c35e91c..5fc35d8 100644
--- a/src/main/webapp/views/monitor/js/monitor.js
+++ b/src/main/webapp/views/monitor/js/monitor.js
@@ -1,14 +1,20 @@
-var year = null;
-var month = null;
-var day = null;
-var hour = null;
-var minute = null;
-var second = null;
-var week = null;
+var year = '2020';
+var month = '05';
+var day = '01';
+var hour = '08';
+var minute = '00';
+var second = '00';
+var week = '鏄熸湡涓�';
setInterval(function () {
setDate();
+ initlineChart();
+ initPieChart();
}, 1000);
+
+setInterval(function () {
+ getOther();
+}, 500);
function setDate() {
getDate();
@@ -43,4 +49,111 @@
}
-getDate();
\ No newline at end of file
+/**
+ * 鑾峰彇鍏朵粬鏁版嵁
+ */
+function getOther() {
+ http.get(baseUrl+"/monitor/other", {crnId: getUrlVal("crnId")}, 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