From a699b98fbbd52eec1a125425fea4de1babf837c3 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期三, 18 十一月 2020 16:56:26 +0800
Subject: [PATCH] #
---
src/main/webapp/views/monitor/monitor.html | 481 +++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 429 insertions(+), 52 deletions(-)
diff --git a/src/main/webapp/views/monitor/monitor.html b/src/main/webapp/views/monitor/monitor.html
index c1817e6..6c0748d 100644
--- a/src/main/webapp/views/monitor/monitor.html
+++ b/src/main/webapp/views/monitor/monitor.html
@@ -5,37 +5,51 @@
<title>ASRS鐩戞帶</title>
<link href="css/monitor.css" rel="stylesheet">
<link href="css/Pacifico.css" rel="stylesheet">
+ <link href="../../static/layui/css/layui.css" rel="stylesheet">
+ <link href="css/lunbo.css" rel="stylesheet">
<script src="js/jquery-3.3.1.min.js"></script>
<script src="js/vincent.js"></script>
<script src="js/echarts/echarts.min.js"></script>
<script src="js/jquery.countup.min.js"></script>
<script src="js/jquery.waypoints.min.js"></script>
+ <script src="../../static/layui/layui.js"></script>
+ <script src="../../static/js/common.js"></script>
+ <script src="js/monitor.js"></script>
<style>
.crn-speed {
width: 100%;
- height: 20%;
+ 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);*/
}
.crn-speed span {
display:inline-block;
margin:20px auto;
- font-size:64px;
+ font-size:56px;
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: 80%;
+ height: 58%;
}
-
.scroll-bar {
float: left;
width: 50%;
@@ -66,6 +80,7 @@
}
}
+
</style>
</head>
<body class="monitor-bg">
@@ -88,7 +103,7 @@
<div class="button-left"></div>
<div class="button-right"></div>
<div class="time-tools">
- 2019-04-27 10:30:01 鏄熸湡涓�
+ <span id="bar-year"></span>-<span id="bar-month"></span>-<span id="bar-day"></span> <span id="bar-hour"></span>:<span id="bar-minute"></span>:<span id="bar-second"></span> <span id="bar-week"></span>
</div>
<div class="title">
鑷姩浠撳簱WCS鐩戞帶骞冲彴
@@ -119,40 +134,40 @@
<img src="img/a.png">
<div class="info-detail">
<div class="real-data">
- <i class="count">7777</i>
- <span class="unit">涓�</span>
+ <i class="count" id="xDistance">0</i>
+ <span class="unit">km</span>
</div>
- <div class="content">搴撲綅鎬绘暟(涓�)</div>
+ <div class="content">绱璧拌璺濈(鍗冪背)</div>
</div>
</div>
<div class="charge-info-elem">
<img src="img/b.png">
<div class="info-detail">
<div class="real-data">
- <i class="count">777</i>
- <span class="unit">涓�</span>
+ <i class="count" id="yDistance">0</i>
+ <span class="unit">km</span>
</div>
- <div class="content">浣跨敤涓簱浣�(涓�)</div>
+ <div class="content">绱鍗囬檷璺濈(鍗冪背)</div>
</div>
</div>
<div class="charge-info-elem">
<img src="img/c.png">
<div class="info-detail">
<div class="real-data">
- <i class="count">33</i>
- <span class="unit">鎵�</span>
+ <i class="count" id="xDuration">0</i>
+ <span class="unit">h</span>
</div>
- <div class="content">浠婃棩鍏ュ簱(鎵�)</div>
+ <div class="content">绱璧拌鏃堕暱(灏忔椂)</div>
</div>
</div>
<div class="charge-info-elem">
<img src="img/d.png">
<div class="info-detail">
<div class="real-data">
- <i class="count">14296</i>
- <span class="unit">鍗冪摝鏃�</span>
+ <i class="count" id="yDuration">0</i>
+ <span class="unit">h</span>
</div>
- <div class="content">浠婃棩鐢垫�婚噺(鍗冪摝鏃�)</div>
+ <div class="content">绱鍗囬檷鏃堕暱(灏忔椂)</div>
</div>
</div>
</div>
@@ -161,7 +176,7 @@
<div class="image-border image-border2"></div>
<div class="image-border image-border3"></div>
<div class="image-border image-border4"></div>
- <span>涓壃鐗╂祦瀹㈡埛鏈嶅姟涓績</span>
+ <span>娴欐睙涓壃鐗╂祦瑁呭鏈夐檺鍏徃</span>
<img src="img/wxCode.jpg">
</div>
</div>
@@ -178,14 +193,28 @@
<!-- 涓笂 -->
<div class="crn-speed">
<div class="speed-content">
- <span>鍫嗗灈鏈洪�熷害锛�</span><span class="counter">5.00</span><span>绫�/绉�</span>
+ <div id="crn-chart" class="speed-chart">
+ </div>
+<!-- <div id="xSpeed-chart" class="speed-chart">-->
+<!--<!– <span>鍫嗗灈鏈鸿蛋琛岄�熷害锛�</span><span id="xSpeed" class="counter">5.00</span><span>绫�/绉�</span>–>-->
+<!-- </div>-->
+<!-- <div id="ySpeed-chart" class="speed-chart">-->
+<!--<!– <span>鍫嗗灈鏈哄崌闄嶉�熷害锛�</span><span id="ySpeed" class="counter">5.00</span><span>绫�/绉�</span>–>-->
+<!-- </div>-->
</div>
</div>
+ <!-- 涓笅 -->
<div class="scroll-pane">
-
- <!-- 杞挱鍥� -->
- <img src="img/banner/banner1.jpg" alt="">
+ <div class="layui-carousel" id="test1">
+ <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>
+ <div class="item-img" id="img-3" style="background-color: green"></div>
+ <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 class="scroll-bar left-bar">-->
@@ -228,9 +257,9 @@
<!-- </div>-->
<!-- </div>-->
+ </div>
</div>
-
</div>
<!--鍙�-->
@@ -279,7 +308,7 @@
鍦ㄥ簱
</div>
<div class="elem-footer">
- 3,300
+ <span id="stock-count">0</span>
</div>
</div>
<div class="top-footer-elem">
@@ -289,17 +318,17 @@
绌哄簱
</div>
<div class="elem-footer">
- 161
+ <span id="empty-count">0</span>
</div>
</div>
<div class="top-footer-elem">
<div class="elem-header" id="elem-header-third">
</div>
<div class="elem-main">
- 浣跨敤涓�
+ 绂佺敤
</div>
<div class="elem-footer">
- 666
+ <span id="none-count">0</span>
</div>
</div>
</div>
@@ -312,7 +341,7 @@
<div class="progress-bar">
<div class="usage-rate">
<span class="usage-rate-left" >搴撲綅浣跨敤鐜�</span>
- <span class="usage-rate-right">60%</span>
+ <span class="usage-rate-right"><span id="usedPr">0</span>%</span>
</div>
<div class="usage-rate-english english">
<span class="usage-rate-left">EQUIPMENT USAGE THIS MONTH</span>
@@ -320,10 +349,13 @@
</div>
</div>
<div class="progress-bar-modal">
- <div class="bar-container">
- <div class="bar-proportion"><span>瀹為檯浣跨敤</span></div>
+ <div class="layui-progress layui-progress-big" lay-filter="used-progress" style="background-color: #233751;width: 80%;display: inline-block">
+ <div class="layui-progress-bar layui-bg-red" lay-percent="0%"></div>
</div>
- <i class="bar-container-count">7777<span>涓�</span></i>
+<!-- <div class="bar-container">-->
+<!-- <div class="bar-proportion"><span>瀹為檯浣跨敤</span></div>-->
+<!-- </div>-->
+ <i class="bar-container-count"><span id="used">0</span></i>
</div>
</div>
</div>
@@ -331,18 +363,309 @@
</div>
</body>
<script>
- $('.counter').countUp();
- // 閬僵
- let closeBtn = document.getElementById('closeBtn');
- let detailModal = document.getElementById('detail-modal');
- closeBtn.onclick = function () {
- detailModal.style.display = 'none';
- };
- var data = [];
+ layui.use(['element', 'carousel'], function(){
+ var carousel = layui.carousel;
+ var element = layui.element;
+ //寤洪�犲疄渚�
+ carousel.render({
+ elem: '#test1'
+ ,width: '100%' //璁剧疆瀹瑰櫒瀹藉害
+ ,arrow: 'always' //濮嬬粓鏄剧ず绠ご
+ //,anim: 'updown' //鍒囨崲鍔ㄧ敾鏂瑰紡
+ });
+ });
-// 鎶樼嚎鍥�
- let lineCharts = echarts.init(document.getElementById('line-charts'));
- lineChartOption = {
+ /***********************************************************************************/
+ /************************************ 鍫嗗灈鏈洪�熷害 *************************************/
+ /***********************************************************************************/
+
+ 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: 110,
+ splitNumber: 11,
+ radius: '50%',
+ axisLine: { // 鍧愭爣杞寸嚎
+ lineStyle: { // 灞炴�ineStyle鎺у埗绾挎潯鏍峰紡
+ color: [[0.09, 'lime'], [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: 'm/min'}]
+ },
+ {
+ name: '鍗囬檷閫熷害',
+ type: 'gauge',
+ center: ['25%', '55%'], // 榛樿鍏ㄥ眬灞呬腑
+ radius: '30%',
+ min: 0,
+ max: 30,
+ endAngle: 30,
+ splitNumber: 6,
+ axisLine: { // 鍧愭爣杞寸嚎
+ lineStyle: { // 灞炴�ineStyle鎺у埗绾挎潯鏍峰紡
+ color: [[0.29, 'lime'], [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: [25, '20%'], // x, y锛屽崟浣峱x
+ textStyle: { // 鍏朵綑灞炴�ч粯璁や娇鐢ㄥ叏灞�鏂囨湰鏍峰紡锛岃瑙乀EXTSTYLE
+ fontWeight: 'bolder',
+ color: '#fff'
+ }
+ },
+ data: [{value: 1.5, name: 'm/min'}]
+ },
+ // 璐у弶鏈�澶ч�熷害锛�3.鍑犵背
+ {
+ name: '璐у弶閫熷害',
+ type: 'gauge',
+ center: ['75%', '50%'], // 榛樿鍏ㄥ眬灞呬腑
+ radius: '30%',
+ min: 0,
+ max: 4,
+ startAngle: 135,
+ endAngle: 45,
+ splitNumber: 2,
+ axisLine: { // 鍧愭爣杞寸嚎
+ lineStyle: { // 灞炴�ineStyle鎺у埗绾挎潯鏍峰紡
+ color: [[0.2, 'lime'], [0.8, '#1e90ff'], [1, '#ff4500']],
+ width: 2,
+ 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: {
+ show: false
+ },
+ detail: {
+ show: false
+ },
+ data: [{value: 0.5, name: 'gas'}]
+ },
+ {
+ name: '姘磋〃',
+ type: 'gauge',
+ center: ['75%', '50%'], // 榛樿鍏ㄥ眬灞呬腑
+ radius: '30%',
+ min: 0,
+ max: 2,
+ startAngle: 315,
+ endAngle: 225,
+ splitNumber: 2,
+ axisLine: { // 鍧愭爣杞寸嚎
+ lineStyle: { // 灞炴�ineStyle鎺у埗绾挎潯鏍峰紡
+ color: [[0.2, 'lime'], [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 'H';
+ case '1': return 'Water';
+ case '2': return 'C';
+ }
+ }
+ },
+ 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'}]
+ }
+ ]
+ };
+ setInterval(function (){
+ 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);
+ }, 1000);
+
+
+ /***********************************************************************************/
+ /************************************* 鎶樼嚎鍥� ***************************************/
+ /***********************************************************************************/
+
+ var lineCharts = echarts.init(document.getElementById('line-charts'));
+ var lineChartOption = {
// animation: false,
grid: {
top: '0%',
@@ -407,11 +730,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%',
@@ -427,7 +778,7 @@
legend: {
orient: 'vertical',
left: 10,
- data: ['1', '2', '3']
+ data: ['鍦ㄥ簱', '绌�']
},
series: [
{
@@ -450,9 +801,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: {
@@ -473,7 +825,32 @@
}
]
};
- 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.pie;
+ pieCharts.setOption(pieChartOption);
+
+ $('#stock-count').text(res.data.stockCunt);
+ $('#empty-count').text(res.data.emptyCount);
+ $('#none-count').text(res.data.noneCount);
+
+ $('#usedPr').text(res.data.usedPr);
+ $('#used').text(res.data.used);
+
+ layui.element.progress('used-progress', res.data.usedPr + '%');
+ } else if (res.code === 403){
+ top.location.href = "/";
+ } else {
+ layer.msg(res.msg);
+ }
+ }
+ });
+ }
</script>
</html>
--
Gitblit v1.9.1