From b0d2ceeb7ddf65fd5a1bf9ce99ff012e1e3c7ade Mon Sep 17 00:00:00 2001 From: whycq <10027870+whycq@user.noreply.gitee.com> Date: 星期一, 27 三月 2023 09:09:15 +0800 Subject: [PATCH] # --- src/main/webapp/views/monitor/js/monitor.js | 47 ++++++++++++++++++++++- src/main/webapp/views/monitor/monitor.html | 2 src/main/webapp/views/monitor.html | 36 +++++++++++++++-- 3 files changed, 76 insertions(+), 9 deletions(-) diff --git a/src/main/webapp/views/monitor.html b/src/main/webapp/views/monitor.html index f00f584..0c36dea 100644 --- a/src/main/webapp/views/monitor.html +++ b/src/main/webapp/views/monitor.html @@ -33,22 +33,25 @@ <div style="padding: 10px;height: 100%"> <div style="width: 100%;height: 100%;"> <div class="head"> - <label for="" class="label ">TV1</label> - <label for="" class="label">TV2</label> - <label for="" class="label">TV3</label> + <label id="lcd-1" class="label lcd">LCD1</label> + <label id="lcd-2" class="label lcd">LCD2</label> + <label id="lcd-3" class="label lcd">LCD3</label> </div> <div class="body"> <!--<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: 30%;height: 100%;font-size: 30px;display: flex;flex-direction: column;justify-content: space-around"> + <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: 70%;height: 100%;display: flex;flex-direction: column;align-items: center;justify-content: center"> + <div 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: 80%;height: 40%"> <div id="line-charts"></div> </div> @@ -419,7 +422,30 @@ full(); }); + var crnId = 1; + var lcdId = 110; + $('.lcd').click(function () { + var id = this.id.split("-")[1]; + switch (id) { + case 1: + crnId = 1; + lcdId = 113; + break; + case 2: + crnId = 2; + lcdId = 110; + break; + } + getOther2(crnId,lcdId) + }) + + setInterval(function () { + setDate(); + initlineChart(); + initPieChart(); + getOther2(crnId,lcdId) + }, 1000); /***********************************************************************************/ /************************************ 鍫嗗灈鏈洪�熷害 *************************************/ diff --git a/src/main/webapp/views/monitor/js/monitor.js b/src/main/webapp/views/monitor/js/monitor.js index c99b0f8..8dae67e 100644 --- a/src/main/webapp/views/monitor/js/monitor.js +++ b/src/main/webapp/views/monitor/js/monitor.js @@ -12,9 +12,9 @@ initPieChart(); }, 1000); -setInterval(function () { - getOther(); -}, 500); +//setInterval(function () { +// getOther(); +//}, 500); function setDate() { getDate(); @@ -93,6 +93,47 @@ } +function getOther2(crnId,ledId) { + http.get(baseUrl+"/monitor/other", {crnId: crnId, ledId: ledId}, 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 = res.data.xSpeed - 0; // 璧拌 + crnChartOption.series[1].data[0].value = res.data.ySpeed - 0; // 鍗囬檷 + crnChartOption.series[2].data[0].value = res.data.zSpeed - 0; // 鍙夌墮 + crnChartOption.series[3].data[0].value = res.data.forkPos - 0; // 璐у弶浣嶇疆 + // 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); + + // 涓笅 + if (res.data.isShow) { + $('#banner').hide(); + $('#led-content').show(); + $('#led-p-content').text(res.data.content); + } else { + $('#led-content').hide(); + $('#banner').show(); + $('#led-p-content').text(""); + } + + } else if (res.code === 403){ + parent.location.href = baseUrl+"/login"; + } else { + layer.msg("杩炴帴鏈嶅姟鍣ㄥけ璐�", {icon: 2}); + } + }) + +} + // 鍏ㄥ睆 ----------------------------------------------------------------------- //寮�濮嬪叏灞� diff --git a/src/main/webapp/views/monitor/monitor.html b/src/main/webapp/views/monitor/monitor.html index a2d8d81..783a3b7 100644 --- a/src/main/webapp/views/monitor/monitor.html +++ b/src/main/webapp/views/monitor/monitor.html @@ -187,7 +187,7 @@ <div class="image-border image-border3"></div> <div class="image-border image-border4"></div> <span>娴欐睙涓壃绔嬪簱鎶�鏈湁闄愬叕鍙�</span> - <img src="../../static/image/barcode.png"> + <img src="../../static/images/barcode.png"> </div> </div> </div> -- Gitblit v1.9.1