From cb15c6400b7dfc3855e5fdd76b8b217bf6bc9567 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <xltys1995>
Date: 星期三, 30 十二月 2020 10:55:09 +0800
Subject: [PATCH] #

---
 src/main/webapp/views/monitor/monitor.html |  435 ++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 390 insertions(+), 45 deletions(-)

diff --git a/src/main/webapp/views/monitor/monitor.html b/src/main/webapp/views/monitor/monitor.html
index a8ead2e..31dacad 100644
--- a/src/main/webapp/views/monitor/monitor.html
+++ b/src/main/webapp/views/monitor/monitor.html
@@ -18,11 +18,13 @@
     <style>
         .crn-speed {
             width: 100%;
-            height: 35%;
+            height: 75%;
+            position: absolute;
             text-align: center;
             overflow: hidden;
             text-overflow: ellipsis;
             white-space: nowrap;
+            top: -15%;
             /*border-bottom: 1px solid rgba(0, 0, 0, 0.3);*/
         }
 
@@ -33,13 +35,20 @@
             font-family:'Pacifico',serif
         }
         .speed-content {
-            display: inline-block;
+            height: 100%;
+        }
+        .speed-chart {
+            float: left;
+            width: 100%;
+            height: 100%;
         }
 
 
         .scroll-pane {
+            position: absolute;
+            top: 42%;
             width: 100%;
-            height: 65%;
+            height: 58%;
         }
         .scroll-bar {
             float: left;
@@ -71,6 +80,16 @@
             }
         }
 
+        #led-content {
+            display: none;
+        }
+        #led-p-content {
+            text-align: center;
+            padding: 20px 40px;
+            font-size: 35px;
+            font-weight: bold;
+            /*color: #FF5722;*/
+        }
 
     </style>
 </head>
@@ -168,7 +187,7 @@
                     <div class="image-border image-border3"></div>
                     <div class="image-border image-border4"></div>
                     <span>娴欐睙涓壃鐗╂祦瑁呭鏈夐檺鍏徃</span>
-                    <img src="img/wxCode.jpg">
+                    <img src="../../static/image/barcode.png">
                 </div>
             </div>
         </div>
@@ -184,18 +203,14 @@
                     <!-- 涓笂 -->
                     <div class="crn-speed">
                         <div class="speed-content">
-                            <div>
-                                <span>鍫嗗灈鏈鸿蛋琛岄�熷害锛�</span><span id="xSpeed" class="counter">5.00</span><span>绫�/绉�</span>
-                            </div>
-                            <div>
-                                <span>鍫嗗灈鏈哄崌闄嶉�熷害锛�</span><span id="ySpeed" class="counter">5.00</span><span>绫�/绉�</span>
+                            <div id="crn-chart" class="speed-chart">
                             </div>
                         </div>
                     </div>
 
+                    <!-- 涓笅 -->
                     <div class="scroll-pane">
-
-                        <div class="layui-carousel" id="test1">
+                        <div class="layui-carousel" id="banner">
                             <div carousel-item>
                                 <div class="item-img" id="img-1" style="background-color: red"></div>
                                 <div class="item-img" id="img-2" style="background-color: gold"></div>
@@ -203,6 +218,10 @@
                                 <div class="item-img" id="img-4" style="background-color: white"></div>
                                 <div class="item-img" id="img-5" style="background-color: darkgoldenrod"></div>
                             </div>
+                        </div>
+
+                        <div id="led-content">
+                            <pre id="led-p-content"></pre>
                         </div>
 
 <!--                        &lt;!&ndash; 涓乏 &ndash;&gt;-->
@@ -260,7 +279,7 @@
                 <div class="image-border image-border4"></div>
                 <div class="line-chart-title">
                     <div class="order-report">
-                        <span class="order-report-left" >鍏ュ簱鍗曠粺璁�</span>
+                        <span class="order-report-left" >鍏ュ嚭搴撶粺璁�</span>
                         <span class="order-report-right">31</span>
                     </div>
                     <div class="order-report-english english">
@@ -355,23 +374,329 @@
     layui.use(['element', 'carousel'], function(){
         var carousel = layui.carousel;
         var element = layui.element;
-        //寤洪�犲疄渚�
+        // 杞挱鍥�
         carousel.render({
-            elem: '#test1'
+            elem: '#banner'
             ,width: '100%' //璁剧疆瀹瑰櫒瀹藉害
-            ,arrow: 'always' //濮嬬粓鏄剧ず绠ご
-            //,anim: 'updown' //鍒囨崲鍔ㄧ敾鏂瑰紡
+            ,arrow: 'hover' // 鍒囨崲绠ご榛樿鏄剧ず鐘舵�侊紝鍙�夊�间负 hover锛堟偓鍋滄樉绀猴級 always锛堝缁堟樉绀猴級 none锛堝缁堜笉鏄剧ず锛�
+            ,interval: '3000' // 鑷姩鍒囨崲鐨勬椂闂撮棿闅旓紝鍗曚綅锛歮s锛堟绉掞級锛屼笉鑳戒綆浜�800
+            ,anim: 'fade'
         });
     });
+
+    /***********************************************************************************/
+    /************************************* 澶撮儴鎸夐挳 *************************************/
+    /***********************************************************************************/
+    // 宸�
+    $('.button-left').click(function () {
+        exitFull();
+    });
+    // 鍙�
+    $('.button-right').click(function () {
+        full();
+    });
+
+
 
     /***********************************************************************************/
     /************************************ 鍫嗗灈鏈洪�熷害 *************************************/
     /***********************************************************************************/
 
-
-
-
-
+    var crnChart = echarts.init(document.getElementById('crn-chart'));
+    crnChartOption = {
+        // backgroundColor: '#1b1b1b',
+        tooltip: {
+            formatter: '{a} <br/>{c} {b}'
+        },
+        // toolbox: {  // 淇濆瓨鍥剧墖
+        //     show: true,
+        //     feature: {
+        //         mark: {show: true},
+        //         restore: {show: true},
+        //         saveAsImage: {show: true}
+        //     }
+        // },
+        series: [
+            {
+                name: '璧拌閫熷害',
+                type: 'gauge',
+                min: 0,
+                max: 130,
+                splitNumber: 13,
+                radius: '50%',
+                axisLine: {            // 鍧愭爣杞寸嚎
+                    lineStyle: {       // 灞炴�ineStyle鎺у埗绾挎潯鏍峰紡
+                        color: [[0.09, '#0fe507'], [0.82, '#1e90ff'], [1, '#ff4500']],
+                        width: 3,
+                        shadowColor: '#fff', //榛樿閫忔槑
+                        shadowBlur: 10
+                    }
+                },
+                axisLabel: {            // 鍧愭爣杞存暟瀛�
+                    fontWeight: 'bolder',
+                    color: '#fff',
+                    shadowColor: '#fff', //榛樿閫忔槑
+                    shadowBlur: 10
+                },
+                axisTick: {            // 鍧愭爣杞村皬鏍囪
+                    length: 15,        // 灞炴�ength鎺у埗绾块暱
+                    lineStyle: {       // 灞炴�ineStyle鎺у埗绾挎潯鏍峰紡
+                        color: 'auto',
+                        shadowColor: '#fff', //榛樿閫忔槑
+                        shadowBlur: 10
+                    }
+                },
+                splitLine: {           // 鍒嗛殧绾�
+                    length: 25,         // 灞炴�ength鎺у埗绾块暱
+                    lineStyle: {       // 灞炴�ineStyle锛堣瑙乴ineStyle锛夋帶鍒剁嚎鏉℃牱寮�
+                        width: 3,
+                        color: '#fff',
+                        shadowColor: '#fff', //榛樿閫忔槑
+                        shadowBlur: 10
+                    }
+                },
+                pointer: {           // 鍒嗛殧绾�
+                    shadowColor: '#fff', //榛樿閫忔槑
+                    shadowBlur: 5
+                },
+                title: {    // 閫熷害鍗曚綅
+                    textStyle: {       // 鍏朵綑灞炴�ч粯璁や娇鐢ㄥ叏灞�鏂囨湰鏍峰紡锛岃瑙乀EXTSTYLE
+                        fontWeight: 'bolder',
+                        fontSize: 20,
+                        fontStyle: 'italic',
+                        color: '#fff',
+                        shadowColor: '#fff', //榛樿閫忔槑
+                        shadowBlur: 10
+                    }
+                },
+                detail: {   // 閫熷害鍊�
+                    backgroundColor: 'rgba(30,144,255,0.8)',
+                    borderWidth: 1,
+                    borderColor: '#fff',
+                    shadowColor: '#fff', //榛樿閫忔槑
+                    shadowBlur: 5,
+                    offsetCenter: [0, '50%'],       // x, y锛屽崟浣峱x
+                    textStyle: {       // 鍏朵綑灞炴�ч粯璁や娇鐢ㄥ叏灞�鏂囨湰鏍峰紡锛岃瑙乀EXTSTYLE
+                        fontWeight: 'bolder',
+                        color: '#fff'
+                    }
+                },
+                data: [{value: 40, name: 'x\nm/min'}]
+            },
+            {
+                name: '鍗囬檷閫熷害',
+                type: 'gauge',
+                center: ['25%', '55%'],    // 榛樿鍏ㄥ眬灞呬腑
+                radius: '30%',
+                min: 0,
+                max: 30,
+                endAngle: 30,
+                splitNumber: 6,
+                axisLine: {            // 鍧愭爣杞寸嚎
+                    lineStyle: {       // 灞炴�ineStyle鎺у埗绾挎潯鏍峰紡
+                        color: [[0.32, '#0fe507'], [0.86, '#1e90ff'], [1, '#ff4500']],
+                        width: 2,
+                        shadowColor: '#fff', //榛樿閫忔槑
+                        shadowBlur: 10
+                    }
+                },
+                axisLabel: {            // 鍧愭爣杞村皬鏍囪
+                    fontWeight: 'bolder',
+                    color: '#fff',
+                    shadowColor: '#fff', //榛樿閫忔槑
+                    shadowBlur: 10
+                },
+                axisTick: {            // 鍧愭爣杞村皬鏍囪
+                    length: 12,        // 灞炴�ength鎺у埗绾块暱
+                    lineStyle: {       // 灞炴�ineStyle鎺у埗绾挎潯鏍峰紡
+                        color: 'auto',
+                        shadowColor: '#fff', //榛樿閫忔槑
+                        shadowBlur: 10
+                    }
+                },
+                splitLine: {           // 鍒嗛殧绾�
+                    length: 20,         // 灞炴�ength鎺у埗绾块暱
+                    lineStyle: {       // 灞炴�ineStyle锛堣瑙乴ineStyle锛夋帶鍒剁嚎鏉℃牱寮�
+                        width: 3,
+                        color: '#fff',
+                        shadowColor: '#fff', //榛樿閫忔槑
+                        shadowBlur: 10
+                    }
+                },
+                pointer: {
+                    width: 5,
+                    shadowColor: '#fff', //榛樿閫忔槑
+                    shadowBlur: 5
+                },
+                title: {
+                    offsetCenter: [0, '-30%'],       // x, y锛屽崟浣峱x
+                    textStyle: {       // 鍏朵綑灞炴�ч粯璁や娇鐢ㄥ叏灞�鏂囨湰鏍峰紡锛岃瑙乀EXTSTYLE
+                        fontWeight: 'bolder',
+                        fontStyle: 'italic',
+                        color: '#fff',
+                        shadowColor: '#fff', //榛樿閫忔槑
+                        shadowBlur: 10
+                    }
+                },
+                detail: {
+                    //backgroundColor: 'rgba(30,144,255,0.8)',
+                    // borderWidth: 1,
+                    borderColor: '#fff',
+                    shadowColor: '#fff', //榛樿閫忔槑
+                    shadowBlur: 5,
+                    width: 80,
+                    height: 30,
+                    offsetCenter: [35, '20%'],       // x, y锛屽崟浣峱x
+                    textStyle: {       // 鍏朵綑灞炴�ч粯璁や娇鐢ㄥ叏灞�鏂囨湰鏍峰紡锛岃瑙乀EXTSTYLE
+                        fontWeight: 'bolder',
+                        color: '#fff'
+                    }
+                },
+                data: [{value: 1.5, name: 'y'}]
+            },
+            {
+                name: '璐у弶閫熷害',
+                type: 'gauge',
+                center: ['75%', '50%'],    // 榛樿鍏ㄥ眬灞呬腑
+                radius: '30%',
+                min: 0,
+                max: 25,
+                startAngle: 135,
+                endAngle: 45,
+                splitNumber: 2,
+                axisLine: {            // 鍧愭爣杞寸嚎
+                    lineStyle: {       // 灞炴�ineStyle鎺у埗绾挎潯鏍峰紡
+                        color: [[0.2, '#0fe507'], [0.8, '#1e90ff'], [1, '#ff4500']],
+                        width: 2,
+                        shadowColor: '#fff', //榛樿閫忔槑
+                        shadowBlur: 10
+                    }
+                },
+				axisLabel: {            // 鍧愭爣杞村皬鏍囪
+                    fontWeight: 'bolder',
+                    color: '#fff',
+                    shadowColor: '#fff', //榛樿閫忔槑
+                    shadowBlur: 10
+                },
+                axisTick: {            // 鍧愭爣杞村皬鏍囪
+                    length: 12,        // 灞炴�ength鎺у埗绾块暱
+                    lineStyle: {       // 灞炴�ineStyle鎺у埗绾挎潯鏍峰紡
+                        color: 'auto',
+                        shadowColor: '#fff', //榛樿閫忔槑
+                        shadowBlur: 10
+                    }
+                },
+                // axisLabel: {
+                //     fontWeight: 'bolder',
+                //     color: '#fff',
+                //     shadowColor: '#fff', //榛樿閫忔槑
+                //     shadowBlur: 10,
+                //     formatter: function (v){
+                //         switch (v + '') {
+                //             case '0': return 'E';
+                //             case '1': return 'Gas';
+                //             case '2': return 'F';
+                //         }
+                //     }
+                // },
+                splitLine: {           // 鍒嗛殧绾�
+                    length:15,         // 灞炴�ength鎺у埗绾块暱
+                    lineStyle: {       // 灞炴�ineStyle锛堣瑙乴ineStyle锛夋帶鍒剁嚎鏉℃牱寮�
+                        width:3,
+                        color: '#fff',
+                        shadowColor: '#fff', //榛樿閫忔槑
+                        shadowBlur: 10
+                    }
+                },
+                pointer: {
+                    width:2,
+                    shadowColor: '#fff', //榛樿閫忔槑
+                    shadowBlur: 5
+                },
+                title: {
+                    offsetCenter: [0, '-30%'],       // x, y锛屽崟浣峱x
+                    textStyle: {       // 鍏朵綑灞炴�ч粯璁や娇鐢ㄥ叏灞�鏂囨湰鏍峰紡锛岃瑙乀EXTSTYLE
+                        fontWeight: 'bolder',
+                        fontStyle: 'italic',
+                        color: '#fff',
+                        shadowColor: '#fff', //榛樿閫忔槑
+                        shadowBlur: 10
+                    }
+                },
+                detail: {
+                    //backgroundColor: 'rgba(30,144,255,0.8)',
+                    // borderWidth: 1,
+                    borderColor: '#fff',
+                    shadowColor: '#fff', //榛樿閫忔槑
+                    shadowBlur: 5,
+                    width: 80,
+                    height: 30,
+                    offsetCenter: [40, '5%'],       // x, y锛屽崟浣峱x
+                    textStyle: {       // 鍏朵綑灞炴�ч粯璁や娇鐢ㄥ叏灞�鏂囨湰鏍峰紡锛岃瑙乀EXTSTYLE
+                        fontWeight: 'bolder',
+                        color: '#fff'
+                    }
+                },
+                data: [{value: 0.5, name: 'z'}]
+            },
+            {
+                name: '璐у弶浣嶇疆',
+                type: 'gauge',
+                center: ['75%', '50%'],    // 榛樿鍏ㄥ眬灞呬腑
+                radius: '30%',
+                min: 0,
+                max: 2,
+                startAngle: 315,
+                endAngle: 225,
+                splitNumber: 2,
+                axisLine: {            // 鍧愭爣杞寸嚎
+                    lineStyle: {       // 灞炴�ineStyle鎺у埗绾挎潯鏍峰紡
+                        color: [[0.2, '#0fe507'], [0.8, '#1e90ff'], [1, '#ff4500']],
+                        width: 2,
+                        shadowColor: '#fff', //榛樿閫忔槑
+                        shadowBlur: 10
+                    }
+                },
+                axisTick: {            // 鍧愭爣杞村皬鏍囪
+                    show: false
+                },
+                axisLabel: {
+                    fontWeight: 'bolder',
+                    color: '#fff',
+                    shadowColor: '#fff', //榛樿閫忔槑
+                    shadowBlur: 10,
+                    formatter: function(v){
+                        switch (v + '') {
+                            case '0': return '鍙�';
+                            case '1': return '涓�';
+                            case '2': return '宸�';
+                        }
+                    }
+                },
+                splitLine: {           // 鍒嗛殧绾�
+                    length: 15,         // 灞炴�ength鎺у埗绾块暱
+                    lineStyle: {       // 灞炴�ineStyle锛堣瑙乴ineStyle锛夋帶鍒剁嚎鏉℃牱寮�
+                        width: 3,
+                        color: '#fff',
+                        shadowColor: '#fff', //榛樿閫忔槑
+                        shadowBlur: 10
+                    }
+                },
+                pointer: {
+                    width: 2,
+                    shadowColor: '#fff', //榛樿閫忔槑
+                    shadowBlur: 5
+                },
+                title: {
+                    show: false
+                },
+                detail: {
+                    show: false
+                },
+                data:[{value: 0.5, name: 'gas'}]
+            }
+        ]
+    };
 
 
     /***********************************************************************************/
@@ -393,7 +718,7 @@
         xAxis: {
             type: 'category',
             boundaryGap: false,
-            data: ['1', '2', '3', '4', '5', '6', '7'],
+            data:  ['1', '2', '3', '4', '5', '6', '7'],
             axisLabel: {
                 textStyle:{
                     color:'#aaa',  //鍧愭爣鐨勫瓧浣撻鑹�
@@ -427,45 +752,57 @@
             }
 
         },
-        series: [{
-            data: [820, 932, 901, 934, 1290, 1330, 1320],
-            type: 'line',
-            areaStyle: {
-                color: '#7494ae' // 鎶樼嚎鍖哄煙棰滆壊
+        series: [
+            {
+                data: [820, 932, 901, 934, 1290, 1330, 1320],
+                type: 'line',
+                // areaStyle: {
+                //     color: '#7494ae' // 鎶樼嚎鍖哄煙棰滆壊
+                // },
+                itemStyle:{
+                    normal:{
+                        color:'#3590ac', //鎶樼偣棰滆壊
+                        lineStyle:{
+                            color:'#3590ac' //鎶樼嚎棰滆壊
+                        }
+                    }
+                }
             },
-            itemStyle:{
-                normal:{
-                    color:'#3590ac', //鎶樼偣棰滆壊
-                    lineStyle:{
-                        color:'#3590ac' //鎶樼嚎棰滆壊
+            {
+                data: [820, 932, 901, 934, 1290, 1330, 1320],
+                type: 'line',
+                // areaStyle: {
+                //     color: '#d55b35' // 鎶樼嚎鍖哄煙棰滆壊
+                // },
+                itemStyle:{
+                    normal:{
+                        color:'#ef550e', //鎶樼偣棰滆壊
+                        lineStyle:{
+                            color:'#ec670f' //鎶樼嚎棰滆壊
+                        }
                     }
                 }
             }
-        }]
+        ]
     };
 
-    // 璁块棶閲忔姤琛ㄥ姞杞�
-    function initlinChart() {
+    function initlineChart() {
         var reportView = lineChartOption;
-        var xAxisDate = [];
-        var seriesDate=[];
         $.ajax({
-            url: baseUrl+"/monitor/pakin/rep",
+            url: baseUrl+"/monitor/line/charts",
             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;
+                    var json = res.data.rows;
+                    reportView.xAxis.data=[getDateFormat(-11), getDateFormat(-10), getDateFormat(-9), getDateFormat(-8), getDateFormat(-7), getDateFormat(-6),
+                        getDateFormat(-5), getDateFormat(-4), getDateFormat(-3), getDateFormat(-2), getDateFormat(-1), getDateFormat(-0)];
+                    reportView.series[0].data=res.data.rows[0].data;
+                    reportView.series[1].data=res.data.rows[1].data;
                     lineCharts.setOption(reportView)
                 } else if (res.code === 403){
                     top.location.href = "/";
                 } else {
-                    layer.msg(res.msg);
+                    console.log(res.msg);
                 }
             }
         });
@@ -566,5 +903,13 @@
         });
     }
 
+    // eCharts 璺熼殢绐楀彛鏀瑰彉
+    window.onresize = function(){
+        crnChart.resize();
+        lineCharts.resize();
+        pieCharts.resize();
+    }
+
+
 </script>
 </html>

--
Gitblit v1.9.1