From 890c164aaf39c9ca28de044d8ac55bd4fe8cbc3e Mon Sep 17 00:00:00 2001
From: vincent <1341870251@qq.com>
Date: 星期二, 02 六月 2020 11:05:44 +0800
Subject: [PATCH] #
---
src/main/webapp/views/console.html | 92 +++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 86 insertions(+), 6 deletions(-)
diff --git a/src/main/webapp/views/console.html b/src/main/webapp/views/console.html
index e2383b2..90a7739 100644
--- a/src/main/webapp/views/console.html
+++ b/src/main/webapp/views/console.html
@@ -11,6 +11,7 @@
<link rel="stylesheet" type="text/css" href="../static/css/common.css">
<link rel="stylesheet" type="text/css" href="../static/css/console.css">
<script type="text/javascript" src="../static/js/jquery/jquery-3.3.1.min.js"></script>
+ <script type="text/javascript" src="../static/js/common.js"></script>
<script type="text/javascript" src="../static/js/layer/layer.js"></script>
<style>
@@ -58,9 +59,18 @@
</div>
<!--鍒嗗壊绾�-->
- <hr class="header-hr">
+ <!--<hr class="header-hr">-->
</header>
<main>
+
+ <!----------- 宸ュ叿鏍� ---------->
+ <!-- 鍏ュ簱鍙� -->
+ <div class="cargo-put"></div>
+ <!-- 鎵爜鍣� -->
+ <div id="code-decoder-1" class="code-decoder">
+ <span id="code-decoder-data-1" class="code-decoder-data">0</span>
+ </div>
+
<!-- 宸﹁緭閫佺嚎 -->
<!-- 绗竴鍒楋紙瀹藉害 100px锛�-->
@@ -79,7 +89,7 @@
<div class="site-row site-row-2">
<div id="site-32" class="site" style="width: 80px; height: 50px;line-height: 50px">32</div>
<div id="site-31" class="site" >31</div>
- <div id="site-30" class="site" style="width: 80px; height: 30px;line-height: 30px; background-color: red;">30</div>
+ <div id="site-30" class="site" style="width: 80px; height: 30px;line-height: 30px;">30</div>
<div id="site-23" class="site" >23</div>
<div id="site-22" class="site" style="width: 80px; height: 50px;line-height: 50px">22</div>
<div id="site-20" class="site" >20</div>
@@ -396,11 +406,77 @@
</main>
</body>
<script>
+
var crn1Position = 0;
var crn2Position = 0;
- $('#animate').click(function () {
- crnAnimate(1, $('#val').val());
- });
+ // 鍒濆鍖�
+ getSitesInfo();
+ getCrnInfo();
+ // 瀹炴椂璁块棶
+ setInterval(function () {
+ getSitesInfo();
+ getCrnInfo();
+ }, 500);
+
+ // 杈撻�佽澶囧疄鏃舵暟鎹幏鍙�
+ function getSitesInfo(){
+ $.ajax({
+ url: baseUrl+ "/console/latest/data/site",
+ headers: {'token': localStorage.getItem('token')},
+ method: 'POST',
+ success: function (res) {
+ if (res.code === 200){
+ var sites = res.data;
+ for (var i = 0; i < sites.length; i++){
+ $("#site-"+sites[i].siteId).attr("class", "site " + sites[i].siteStatus);
+ }
+ } else if (res.code === 403){
+ top.location.href = baseUrl+"/login";
+ } else {
+ alert(res.msg);
+ }
+ }
+ });
+ }
+
+ // 鍫嗗灈鏈哄疄鏃舵暟鎹幏鍙�
+ function getCrnInfo(){
+ $.ajax({
+ url: baseUrl+ "/console/latest/data/crn",
+ headers: {'token': localStorage.getItem('token')},
+ method: 'POST',
+ success: function (res) {
+ if (res.code === 200){
+ var crns = res.data;
+ for (var i = 0; i < crns.length; i++){
+ crnAnimate(crns[i].crnId, crns[i].offset);
+ }
+ } else if (res.code === 403){
+ top.location.href = baseUrl+"/login";
+ } else {
+ alert(res.msg);
+ }
+ }
+ });
+ }
+
+ // 鎵爜鍣ㄥ疄鏃舵暟鎹幏鍙�
+ function getBarcodeInfo(){
+ $.ajax({
+ url: baseUrl+ "/console/latest/data/barcode",
+ headers: {'token': localStorage.getItem('token')},
+ method: 'POST',
+ success: function (res) {
+ if (res.code === 200){
+
+ } else if (res.code === 403){
+ top.location.href = baseUrl+"/login";
+ } else {
+ alert(res.msg);
+ }
+ }
+ });
+ }
// 鍫嗗灈鏈哄亸绉诲姩鐢�
function crnAnimate(id, leftVal) {
@@ -418,13 +494,17 @@
}
}
+
$('.item').on('click', function () {
layer.open({
type: 1,
shadeClose: true, //鐐瑰嚮閬僵鍏抽棴灞�
content: 'text'
});
- })
+ });
+ $('#animate').click(function () {
+ crnAnimate(1, $('#val').val());
+ });
</script>
</html>
\ No newline at end of file
--
Gitblit v1.9.1