From 12a66f19229f25054c145f17e03711fcca50fa77 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期三, 05 六月 2024 15:58:21 +0800
Subject: [PATCH] #地图初始化

---
 src/main/webapp/views/console.html       |    2 
 src/main/webapp/static/js/console.js     |   19 ++++++++-
 src/main/webapp/static/css/render.css    |    9 ++++
 src/main/webapp/static/js/console.map.js |   46 ++++++++++++++--------
 4 files changed, 56 insertions(+), 20 deletions(-)

diff --git a/src/main/webapp/static/css/render.css b/src/main/webapp/static/css/render.css
index 808914a..c397e0e 100644
--- a/src/main/webapp/static/css/render.css
+++ b/src/main/webapp/static/css/render.css
@@ -80,6 +80,15 @@
     height: 100%;
     width: 100%;
 }
+.barcode {
+    position: absolute;
+    color: #a19c9c;
+    border: 1px solid rgb(108,167,168);
+    cursor: pointer;
+    text-align: center;
+    background-color: rgb(157, 217, 162);
+    font-size: 10px;
+}
 
 .floorBtn {
     position: absolute;
diff --git a/src/main/webapp/static/js/console.js b/src/main/webapp/static/js/console.js
index f731681..7523ae8 100644
--- a/src/main/webapp/static/js/console.js
+++ b/src/main/webapp/static/js/console.js
@@ -9,6 +9,8 @@
     track = '',
     tracks = '',
     stn = '',
+    barcode = '',
+    barcodeArr = [],
     stns = '',
     stnArr = [],
     floorBtn = '',
@@ -125,6 +127,7 @@
 
         let stnss = areas[i].stns
         let floor = areas[i].text
+        let barcodes = areas[i].barcode
         floorId = areas[i].id
         var position = (i+1)*100
         floorBtn =
@@ -139,6 +142,7 @@
         var n = 1
         stnArr[index] = ''
         total[index] = ''
+        barcodeArr[index] = ''
         for (let j = 0; j < stnss.length; j++) {
             if (stnss[j].type == "stn") {
                 stn = "<div class='site' id='" + stnss[j].id +
@@ -161,10 +165,21 @@
                 stnArr[i] = stnArr[i] + stn
             }
 
+
+
+        }
+        for (let k = 0; k < barcodes.length; k++) {
+            barcode = "<div class='barcode' id='" + barcodes[k].id +
+                "'style='width:" + barcodes[k].width +
+                "px;height: " + barcodes[k].height +
+                "px;line-height: " + barcodes[k].height +
+                "px;top: "+ barcodes[k].top +
+                "px;left: "+ barcodes[k].left + "px'>" + "</div>"
+            barcodeArr[i] = barcodeArr[i] + barcode
         }
 
     }
-    floorInfo = racks + rackDescs + tracks + crns + stnArr[0] + floorBtnss
+    floorInfo = racks + rackDescs + tracks + crns + stnArr[0] + floorBtnss+ barcodeArr[0]
 
     $(".main-part").append(floorInfo)
     $("#line-total").html(total[0])
@@ -173,7 +188,7 @@
 }
 function changFloor(e) {
     $(".main-part").empty()  // 娓呯┖鑺傜偣
-    floorInfo = racks  + stnArr[e] +rackDescs + crns + tracks + floorBtnss
+    floorInfo = racks  + stnArr[e] +rackDescs + crns + tracks + floorBtnss + barcodeArr[e]
     $(".main-part").append(floorInfo)
     $("#line-total").empty()
     $("#line-total").html(total[e])
diff --git a/src/main/webapp/static/js/console.map.js b/src/main/webapp/static/js/console.map.js
index 03e71cf..52c142d 100644
--- a/src/main/webapp/static/js/console.map.js
+++ b/src/main/webapp/static/js/console.map.js
@@ -3,7 +3,7 @@
     "rackCount": 6,
     "crnCount": 6,
     "stbCount": 40,
-    "hpPosition": 0,
+    "hpPosition": 1,
     "minBayNo": 2,
     "floors": 1,
     "racks": [{
@@ -63,29 +63,21 @@
     }],
     "rackDescs": [{
         "type": "rackDescs",
-        "id": "lb_desc8",
-        "text": "#8",
-        "top": 357,
-        "left": 1881,
+        "id": "lb_desc6",
+        "text": "#6",
+        "top": 180,
+        "left": 1300,
         "width": 33,
         "height": 23
     }, {
         "type": "rackDescs",
         "id": "lb_desc1",
         "text": "#1",
-        "top": 93,
-        "left": 1884,
+        "top": 425,
+        "left": 1300,
         "width": 30,
         "height": 23
-    }, {
-        "type": "rackDescs",
-        "id": "lb_desc9",
-        "text": "#9",
-        "top": 384,
-        "left": 1735,
-        "width": 33,
-        "height": 23
-    }, {"type": "rackDescs", "id": "lb_desc18", "text": "#18", "top": 663, "left": 1733, "width": 41, "height": 23}],
+    }],
     "crns": [{
         "type": "track",
         "id": "lb_track3",
@@ -471,7 +463,27 @@
                 "left": 1417,
                 "width": 63,
                 "height": 24
-            }, {"type": "stn", "id": "site-105", "text": "105", "top": 351, "left": 1417, "width": 63, "height": 24}]
+            }, {"type": "stn", "id": "site-105", "text": "105", "top": 351, "left": 1417, "width": 63, "height": 24}],
+            "barcode":[
+                {
+                    "type": "barcode",
+                    "id": "barcode-1",
+                    "text": "",
+                    "top": 422,
+                    "left": 1335,
+                    "width": 80,
+                    "height": 20
+                },
+                {
+                    "type": "barcode",
+                    "id": "barcode-2",
+                    "text": "",
+                    "top": 422,
+                    "left": 422,
+                    "width": 80,
+                    "height": 20
+                }
+            ]
         }]
     }]
 }
diff --git a/src/main/webapp/views/console.html b/src/main/webapp/views/console.html
index 91ea99a..fcc160d 100644
--- a/src/main/webapp/views/console.html
+++ b/src/main/webapp/views/console.html
@@ -648,7 +648,7 @@
                 if (res.code === 200) {
                     var barcodes = res.data;
                     for (var i = 0; i < barcodes.length; i++) {
-                        $("#code-decoder-data-" + barcodes[i].barcodeId).html(barcodes[i].codeValue);
+                        $("#barcode-"+barcodes[i].barcodeId).html(barcodes[i].codeValue ? barcodes[i].codeValue : "--");
                     }
                 } else if (res.code === 403) {
                     parent.location.href = baseUrl + "/login";

--
Gitblit v1.9.1