From aa33e56e37cd19b88ae8eea69c5ebc7c6da8b1d2 Mon Sep 17 00:00:00 2001
From: Administrator <pjb>
Date: 星期四, 05 六月 2025 17:59:47 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/glccwcs' into glccwcs

---
 src/main/webapp/static/wcs/js/console.js |   86 +++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 82 insertions(+), 4 deletions(-)

diff --git a/src/main/webapp/static/wcs/js/console.js b/src/main/webapp/static/wcs/js/console.js
index 71073e8..0764818 100644
--- a/src/main/webapp/static/wcs/js/console.js
+++ b/src/main/webapp/static/wcs/js/console.js
@@ -40,10 +40,16 @@
             }
         }else {
             bNum = minBayNo
+            let hiddenArr = [];
+            if (rackss[i].hiddenArr != undefined) {
+                hiddenArr = rackss[i].hiddenArr
+            }
             for (let j = 0; j < bLen; j++) {
-
-                bay = "<button class='item' style='width: "+ bayWidth +"px'>" + bNum + "</button>"
-                bays = bays + bay
+                bay = "<button class='item' style='width: "+ bayWidth +"px'>" + bNum + "</button>";
+                if (hiddenArr.indexOf(bNum) != -1) {
+                    bay = "<button class='item' style='width: "+ bayWidth +"px;visibility: hidden'>" + bNum + "</button>";
+                }
+                bays = bays + bay;
                 bNum = bNum + minBayNo;
             }
         }
@@ -148,4 +154,76 @@
     $("#line-total").empty()
     $("#line-total").html(total[e])
     // listenChange();
-}
\ No newline at end of file
+}
+
+
+layui.config({
+    base: baseUrl + "/static/wms/layui/lay/modules/"
+}).use(['table', 'form'], function () {
+    var table = layui.table;
+    var $ = layui.jquery;
+    var cache;
+
+    // 鏁版嵁娓叉煋
+    tableIns = table.render({
+        elem: '#deviceInfo',
+        headers: {token: localStorage.getItem('token')},
+        url: baseUrl + '/console/deviceInfo',
+        page: false,
+        limit: 16,
+        limits: [16, 30, 50, 100, 200, 500],
+        even: true,
+        cellMinWidth: 50,
+        cols: [[
+            {field: 'device', align: 'center', title: '璁惧'}
+            , {field: 'deviceId', align: 'center', title: '缂栧彿'}
+            , {field: 'battery', align: 'center', title: '鐢甸噺'}
+            , {field: 'error', align: 'center', title: '寮傚父', templet: '#errorTpl'}
+            , {field: 'status', align: 'center', title: '鐘舵��', width: 150}
+        ]],
+        request: {
+            pageName: 'curr',
+            pageSize: 'limit'
+        },
+        parseData: function (res) {
+            return {
+                'code': res.code,
+                'msg': res.msg,
+                'count': res.data.total,
+                'data': res.data.records
+            }
+        },
+        response: {
+            statusCode: 200
+        },
+        done: function (res, curr, count) {
+            $(".layui-table-tool").hide()
+            $(".layui-table-view").css({"margin":"0px"})
+            $(".layui-table-box").css({"padding-bottom":"0px"})
+
+            cache = table.cache['deviceInfo'];
+        }
+    });
+
+    setInterval(() => {
+        tableReload()
+    },10000)
+
+    function tableReload() {
+        $.ajax({
+            url: baseUrl + "/console/deviceInfo",
+            headers: {'token': localStorage.getItem('token')},
+            contentType: 'application/json;charset=UTF-8',
+            method: 'GET',
+            traditional: true,
+            success: function (res) {
+                cache = res.data.records
+                table.reload('deviceInfo',{
+                    data: cache
+                })
+            }
+        })
+    }
+
+});
+

--
Gitblit v1.9.1