From 06cbd767c9834d8aedf007db4626ffc715b3af8a Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期四, 19 十一月 2020 14:52:36 +0800
Subject: [PATCH] #

---
 src/main/webapp/views/monitor/js/monitor.js |   39 +++++++++++++++++++++++++++++++++++++--
 1 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/src/main/webapp/views/monitor/js/monitor.js b/src/main/webapp/views/monitor/js/monitor.js
index 4f325c8..e681b21 100644
--- a/src/main/webapp/views/monitor/js/monitor.js
+++ b/src/main/webapp/views/monitor/js/monitor.js
@@ -7,9 +7,10 @@
 var week = '鏄熸湡涓�';
 
 setInterval(function () {
+    getOther();
     setDate();
-    initlinChart();
-    // initPieChart();
+    initlineChart();
+    initPieChart();
 }, 1000);
 
 function setDate() {
@@ -45,3 +46,37 @@
 
 }
 
+/**
+ * 鑾峰彇鍏朵粬鏁版嵁
+ */
+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 = (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);
+
+            $('#xSpeed').text(res.data.xSpeed);
+            $('#ySpeed').text(res.data.ySpeed);
+
+            // 璁℃暟鍔ㄧ敾
+            $('.counter').countUp();
+        } else if (res.code === 403){
+            parent.location.href = baseUrl+"/login";
+        }  else {
+            layer.msg("杩炴帴鏈嶅姟鍣ㄥけ璐�", {icon: 2});
+        }
+    })
+
+}
+

--
Gitblit v1.9.1