From e67a0bc6b3b61ad3ac5f26063bb9b64d88180494 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期五, 14 五月 2021 14:23:56 +0800
Subject: [PATCH] #

---
 src/main/webapp/views/console.html |   33 +++++++++++++++++++++++++++++++--
 1 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/src/main/webapp/views/console.html b/src/main/webapp/views/console.html
index 3e3c4ee..7c7048f 100644
--- a/src/main/webapp/views/console.html
+++ b/src/main/webapp/views/console.html
@@ -89,6 +89,10 @@
     <div id="code-decoder-2" class="code-decoder">
         <span id="code-decoder-data-2" class="code-decoder-data">0</span>
     </div>
+    <!--  纾呯Г  -->
+    <div class="scale" id="scale-1">
+        <button id="scale-data-1">纾呯Г</button>
+    </div>
 
 
     <!----------- 宸﹁緭閫佺嚎 ---------->
@@ -528,11 +532,13 @@
     getCrnInfo();
     getSystemRunningStatus();
     getBarcodeInfo();
+    getScaleInfo();
     // 瀹炴椂璁块棶
     setInterval(function () {
         getCrnInfo();
         getSystemRunningStatus();
-        getBarcodeInfo()
+        getBarcodeInfo();
+        getScaleInfo();
     }, 1000);
     setInterval(function () {
         getSitesInfo();
@@ -657,7 +663,7 @@
                         var crnEl = $("#crn-"+crns[i].crnId);
                         crnEl.attr("class", "machine " + crns[i].crnStatus);
                         var unit = ($('.item').eq(0).width()+4)/2;
-                        crnEl.animate({left: (crns[i].bay * unit) +'px'}, 1000);
+                        crnEl.animate({left: (crns[i].bay * unit + 25) +'px'}, 1000);
                     }
                 } else if (res.code === 403){
                     parent.location.href = baseUrl+"/login";
@@ -689,6 +695,29 @@
         });
     }
 
+    // 纾呯Г瀹炴椂鏁版嵁鑾峰彇
+    function getScaleInfo(){
+        $.ajax({
+            url: baseUrl+ "/console/latest/data/scale",
+            headers: {'token': localStorage.getItem('token')},
+            method: 'POST',
+            success: function (res) {
+
+                if (res.code === 200){
+                    var sclaes = res.data;
+                    for (var i = 0; i < sclaes.length; i++){
+                        console.log(sclaes[i].scaleId + ":" + sclaes[i].value)
+                        $("#scale-data-"+sclaes[i].scaleId).text(sclaes[i].value);
+                    }
+                } else if (res.code === 403){
+                    parent.location.href = baseUrl+"/login";
+                }  else {
+                    console.log(res.msg);
+                }
+            }
+        });
+    }
+
     // 鍫嗗灈鏈哄亸绉诲姩鐢�
     function crnAnimate(id, leftVal) {
         switch (id) {

--
Gitblit v1.9.1