From 44f10e71d146093d1a90afb13c0cb1af930349f4 Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期三, 29 三月 2023 09:10:14 +0800
Subject: [PATCH] #
---
src/main/webapp/views/monitor.html | 162 +++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 119 insertions(+), 43 deletions(-)
diff --git a/src/main/webapp/views/monitor.html b/src/main/webapp/views/monitor.html
index 0c36dea..4f4606c 100644
--- a/src/main/webapp/views/monitor.html
+++ b/src/main/webapp/views/monitor.html
@@ -41,22 +41,43 @@
<!--<div class="time-tools">-->
<!-- <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="canves1">
- <div style="width: 25%;height: 100%;font-size: 30px;display: flex;flex-direction: column;justify-content: space-around">
+ <div class="canves1 aData">
+ <div style="width: 25%;height: 100%;font-size: 30px;display: flex;flex-direction: column;justify-content: space-around;">
<div style="width: 100%;height: 100px;line-height: 100px;text-align: center">绱琛岃蛋锛�10869绫�</div>
<div style="width: 100%;height: 100px;line-height: 100px;text-align: center">绱琛岃蛋锛�10869绫�</div>
<div style="width: 100%;height: 100px;line-height: 100px;text-align: center">绱琛岃蛋锛�10869绫�</div>
<div style="width: 100%;height: 100px;line-height: 100px;text-align: center">绱琛岃蛋锛�10869绫�</div>
</div>
- <div style="width: 50%;height: 100%;font-size: 30px;display: flex;flex-direction: column;justify-content: space-around;background-color: #93D1FF;text-align: center">
+ <div id="ledData" style="width: 50%;height: 100%;font-size: 30px;display: flex;flex-direction: column;justify-content: space-around;background-color: #93D1FF;text-align: center;">
AUTOMATIC WAREHOUSE WCS MONITORING DIAGRAM
</div>
- <div style="width: 25%;height: 100%;display: flex;flex-direction: column;align-items: center;justify-content: center">
+ <div style="width: 25%;height: 100%;display: flex;flex-direction: column;align-items: center;justify-content: center;">
<div style="width: 80%;height: 40%">
<div id="line-charts"></div>
</div>
<div style="width: 80%;height: 40%">
<div id="pie-charts"></div>
+ </div>
+ </div>
+
+ </div>
+ <div class="canves1 bData">
+ <!--灞曠ず鍑哄簱淇℃伅-->
+ <div id="ledData4" style="width: 100%;height: 100%;font-size: 30px;display: flex;flex-direction: column;background-color: #93D1FF;display: none">
+ <div class="info-head">
+ <!--澶撮儴-->
+ <div style="flex: 2">鎵樼洏鐮�:80001289</div>
+ <div style="flex: 2">鍟嗗搧缂栧彿</div>
+ <div style="flex: 2">鍟嗗搧鍚嶇О</div>
+ <div style="flex: 2">瑙勬牸</div>
+ <div style="flex: 1">鏁伴噺</div>
+ </div>
+ <div class="info-context">
+ <div style="flex: 2">index</div>
+ <div style="flex: 2">77008945781523</div>
+ <div style="flex: 2">瑗跨摐</div>
+ <div style="flex: 2">500g</div>
+ <div style="flex: 1">30</div>
</div>
</div>
</div>
@@ -312,33 +333,13 @@
</div>
<div id="checked" style="overflow-y: scroll;height: 80%;border: 1px solid #888" >
<label for=""><input type="checkbox" name="monitor" checked="checked" value="1">1鍙锋樉绀哄櫒</label>
- <label for=""><input type="checkbox" name="monitor" >2鍙锋樉绀哄櫒</label>
- <label for=""><input type="checkbox" name="monitor">3鍙锋樉绀哄櫒</label>
- <label for=""><input type="checkbox" name="monitor">4鍙锋樉绀哄櫒</label>
- <label for=""><input type="checkbox" name="monitor">5鍙锋樉绀哄櫒</label>
- <label for=""><input type="checkbox" name="monitor">6鍙锋樉绀哄櫒</label>
- <label for=""><input type="checkbox" name="monitor">7鍙锋樉绀哄櫒</label>
- <label for=""><input type="checkbox" name="monitor">1鍙锋樉绀哄櫒</label>
- <label for=""><input type="checkbox" name="monitor">2鍙锋樉绀哄櫒</label>
- <label for=""><input type="checkbox">3鍙锋樉绀哄櫒</label>
- <label for=""><input type="checkbox">4鍙锋樉绀哄櫒</label>
- <label for=""><input type="checkbox">5鍙锋樉绀哄櫒</label>
- <label for=""><input type="checkbox">6鍙锋樉绀哄櫒</label>
- <label for=""><input type="checkbox">7鍙锋樉绀哄櫒</label>
- <label for=""><input type="checkbox">1鍙锋樉绀哄櫒</label>
- <label for=""><input type="checkbox">2鍙锋樉绀哄櫒</label>
- <label for=""><input type="checkbox">3鍙锋樉绀哄櫒</label>
- <label for=""><input type="checkbox">4鍙锋樉绀哄櫒</label>
- <label for=""><input type="checkbox">5鍙锋樉绀哄櫒</label>
- <label for=""><input type="checkbox">6鍙锋樉绀哄櫒</label>
- <label for=""><input type="checkbox">7鍙锋樉绀哄櫒</label>
- <label for=""><input type="checkbox">1鍙锋樉绀哄櫒</label>
- <label for=""><input type="checkbox">2鍙锋樉绀哄櫒</label>
- <label for=""><input type="checkbox">3鍙锋樉绀哄櫒</label>
- <label for=""><input type="checkbox">4鍙锋樉绀哄櫒</label>
- <label for=""><input type="checkbox">5鍙锋樉绀哄櫒</label>
- <label for=""><input type="checkbox">6鍙锋樉绀哄櫒</label>
- <label for=""><input type="checkbox">7鍙锋樉绀哄櫒</label>
+ <label for=""><input type="checkbox" name="monitor" value="2">2鍙锋樉绀哄櫒</label>
+ <label for=""><input type="checkbox" name="monitor" value="3">3鍙锋樉绀哄櫒</label>
+ <label for=""><input type="checkbox" name="monitor" value="4">4鍙锋樉绀哄櫒</label>
+ <label for=""><input type="checkbox" name="monitor" value="5">5鍙锋樉绀哄櫒</label>
+ <label for=""><input type="checkbox" name="monitor" value="6">6鍙锋樉绀哄櫒</label>
+ <label for=""><input type="checkbox" name="monitor" value="7">7鍙锋樉绀哄櫒</label>
+ <label for=""><input type="checkbox" name="monitor" value="8">8鍙锋樉绀哄櫒</label>
</div>
</div>
<!--鏂囨湰鍐呭-->
@@ -357,37 +358,48 @@
</body>
</html>
<script>
+ var inputValue = ''
+ // lcd鍒囨崲鎸夐挳
$(function() {
$(".label").click(function() {
$(this).addClass("abc").siblings().removeClass("abc");
});
});
+ // 鍏ㄩ�夋寜閽�
$("#selectAll").click(function(){
$('input:checkbox[name=monitor]').each(function () {
$(this).prop("checked",true);
})
});
+ // 鍙栨秷鍏ㄩ�夋寜閽�
$("#unSelectAll").click(function(){
$('input:checkbox[name=monitor]').each(function () {
$(this).prop("checked",false);
})
});
+ // 鍙戦�佽妭鐩寜閽�
$('#sendMessage').click(function () {
var sendMessage = $('#sendContent').val()
- $('input:checkbox[name=monitor]').each(function () {
- if ($(this).is(':checked')) {
- console.log(sendMessage)
- } else {
- console.log('m')
- }
+ inputValue = ''
+ $('input:checkbox[name=monitor]:checked').each(function () {
+ var ledId = parseInt($(this).val())
+ $.ajax({
+ url: baseUrl+"/monitor/led/add/program",
+ data: {ledId:ledId,msg:sendMessage},
+ method: 'GET',
+ success: function (res) {
+ console.log(res)
+ }
+ })
})
})
+ // 绉婚櫎鑺傜洰鎸夐挳
$('#removeMessage').click(function () {
var sendMessage = 'K'
$('input:checkbox[name=monitor]').each(function () {
if ($(this).is(':checked')) {
- console.log(sendMessage)
+ console.log($(this).find(':checked'))
} else {
console.log('m')
}
@@ -423,16 +435,17 @@
});
var crnId = 1;
- var lcdId = 110;
+ var lcdId = 100;
+ var lcdData = 'TEST DATA'
+ var lcdControll = 1;
$('.lcd').click(function () {
var id = this.id.split("-")[1];
-
switch (id) {
- case 1:
+ case '1':
crnId = 1;
- lcdId = 113;
+ lcdId = 100;
break;
- case 2:
+ case '2':
crnId = 2;
lcdId = 110;
break;
@@ -445,12 +458,75 @@
initlineChart();
initPieChart();
getOther2(crnId,lcdId)
+ getInfo(lcdId);
+ getError(lcdId);
+ getProgram(lcdId)
}, 1000);
+
+ // 鍑哄簱淇℃伅
+ function getInfo(ledId) {
+ console.log(ledId)
+ $.ajax({
+ url: baseUrl+"/monitor/led",
+ data: {ledId:ledId},
+ method: 'GET',
+ success: function (res) {
+ if (lcdControll < 3) {
+ $('.aData').attr('display','none')
+
+ }
+ }
+ });
+ }
+
+ // 寮傚父淇℃伅
+ function getError(ledId) {
+ $.ajax({
+ url: baseUrl+"/monitor/led/error",
+ data: {ledId:ledId},
+ method: 'GET',
+ success: function (res) {
+ if (lcdControll < 4) {
+ if (res.data == null) {
+ lcdControll = 0
+ } else {
+ lcdControll = 3
+ $('.bData').attr('display','none')
+ $('.aData').attr('display','flex')
+ $('#ledData').text(res.data)
+ console.log('**')
+ }
+ }
+ }
+ });
+ }
+ // 鑺傜洰淇℃伅
+ function getProgram(ledId) {
+ $.ajax({
+ url: baseUrl+"/monitor/led/program",
+ data: {ledId:ledId},
+ method: 'GET',
+ success: function (res) {
+ console.log(res)
+ if (res.data != '') {
+ lcdControll = 4
+ $('.bData').attr('display','none')
+ $('.aData').attr('display','flex')
+ $('#ledData').text(res.data)
+ } else {
+ lcdControll = 0
+ console.log("2222")
+ }
+ }
+ });
+ }
/***********************************************************************************/
/************************************ 鍫嗗灈鏈洪�熷害 *************************************/
/***********************************************************************************/
+
+
var crnChart = echarts.init(document.getElementById('crn-chart'));
crnChartOption = {
// backgroundColor: '#1b1b1b',
--
Gitblit v1.9.1