From b621bb1034544a8c3c90257c96e4a1460747aa6d Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期二, 17 十一月 2020 09:35:39 +0800
Subject: [PATCH] #

---
 src/main/webapp/views/monitor/monitor.html |   74 +++++++++++++++++++++++++++++++------
 1 files changed, 62 insertions(+), 12 deletions(-)

diff --git a/src/main/webapp/views/monitor/monitor.html b/src/main/webapp/views/monitor/monitor.html
index 37cf403..7bdb4b6 100644
--- a/src/main/webapp/views/monitor/monitor.html
+++ b/src/main/webapp/views/monitor/monitor.html
@@ -367,9 +367,13 @@
     };
     var data = [];
 
-//    鎶樼嚎鍥�
-    let lineCharts = echarts.init(document.getElementById('line-charts'));
-    lineChartOption = {
+
+    /***********************************************************************************/
+    /************************************* 鎶樼嚎鍥� ***************************************/
+    /***********************************************************************************/
+
+    var lineCharts = echarts.init(document.getElementById('line-charts'));
+    var lineChartOption = {
         // animation: false,
         grid: {
             top: '0%',
@@ -434,11 +438,39 @@
         }]
     };
 
-    lineCharts.setOption(lineChartOption);
+    // 璁块棶閲忔姤琛ㄥ姞杞�
+    function initlinChart() {
+        var reportView = lineChartOption;
+        var xAxisDate = [];
+        var seriesDate=[];
+        $.ajax({
+            url: baseUrl+"/monitor/pakin/rep",
+            method: 'GET',
+            success: function (res) {
+                if (res.code === 200){
+                    var json = res.data;
+                    for (var i = 0; i < json.length; i++) {
+                        xAxisDate[i]=json[i].node;
+                        seriesDate[i]=json[i].val;
+                    }
+                    reportView.xAxis.data=xAxisDate;
+                    reportView.series[0].data=seriesDate;
+                    lineCharts.setOption(reportView)
+                } else if (res.code === 403){
+                    top.location.href = "/";
+                } else {
+                    layer.msg(res.msg);
+                }
+            }
+        });
+    }
 
-//    楗煎浘
-    let pieCharts = echarts.init(document.getElementById('pie-charts'));
-    pieChartOption = {
+    /***********************************************************************************/
+    /************************************* 楗煎浘 *****************************************/
+    /***********************************************************************************/
+
+    var pieCharts = echarts.init(document.getElementById('pie-charts'));
+    var pieChartOption = {
         // animation: false,
         grid: {
             top: '0%',
@@ -454,7 +486,7 @@
         legend: {
             orient: 'vertical',
             left: 10,
-            data: ['1', '2', '3']
+            data: ['鍦ㄥ簱搴撲綅', '绌哄簱浣�', '浣跨敤搴撲綅', '绂佺敤搴撲綅']
         },
         series: [
             {
@@ -477,9 +509,10 @@
                     show: false
                 },
                 data: [
-                    {value: 335, name: '1'},
-                    {value: 310, name: '2'},
-                    {value: 234, name: '3'},
+                    {value: 1, name: '鍦ㄥ簱搴撲綅'},
+                    {value: 1, name: '绌哄簱浣�'},
+                    {value: 1, name: '浣跨敤搴撲綅'},
+                    {value: 1, name: '绂佺敤搴撲綅'},
                 ],
                 itemStyle: {
                     emphasis: {
@@ -500,7 +533,24 @@
             }
         ]
     };
-    pieCharts.setOption(pieChartOption);
+    // pieCharts.setOption(pieChartOption)
+    // 楗煎浘鍔犺浇
+    function initPieChart() {
+        $.ajax({
+            url: baseUrl+"/monitor/loc/rep",
+            method: 'GET',
+            success: function (res) {
+                if (res.code === 200){
+                    pieChartOption.series[0].data = res.data;
+                    pieCharts.setOption(pieChartOption)
+                } else if (res.code === 403){
+                    top.location.href = "/";
+                } else {
+                    layer.msg(res.msg);
+                }
+            }
+        });
+    }
 
 </script>
 </html>

--
Gitblit v1.9.1