From f74f237e0179086fb19d08e80c31847ebc33f235 Mon Sep 17 00:00:00 2001 From: 18516761980 <4761516tqsxp> Date: 星期一, 13 六月 2022 15:22:49 +0800 Subject: [PATCH] # --- src/main/webapp/views/render.js | 259 ++++++++++++++++++++------------------------------- 1 files changed, 101 insertions(+), 158 deletions(-) diff --git a/src/main/webapp/views/render.js b/src/main/webapp/views/render.js index ff6158c..c09c091 100644 --- a/src/main/webapp/views/render.js +++ b/src/main/webapp/views/render.js @@ -1,13 +1,12 @@ data = { - "mapName": "鍏嬪姵鏂帥鑿瞁CS", + "mapName": "KLSWCS", "rackCount": 12, "crnCount": 3, "stbCount": 36, "hpPosition": 1, "minBayNo": 2, "floors": 1, - "racks": [ - { + "racks": [{ "type": "rack", "id": "rack12", "top": 646, @@ -16,8 +15,7 @@ "height": 30, "minBayNo": 2, "maxBayNo": 52 - }, - { + }, { "type": "rack", "id": "rack11", "top": 613, @@ -26,8 +24,7 @@ "height": 30, "minBayNo": 2, "maxBayNo": 52 - }, - { + }, { "type": "rack", "id": "rack10", "top": 516, @@ -36,8 +33,7 @@ "height": 30, "minBayNo": 2, "maxBayNo": 52 - }, - { + }, { "type": "rack", "id": "rack9", "top": 483, @@ -46,8 +42,7 @@ "height": 30, "minBayNo": 2, "maxBayNo": 52 - }, - { + }, { "type": "rack", "id": "rack8", "top": 451, @@ -56,8 +51,7 @@ "height": 30, "minBayNo": 2, "maxBayNo": 52 - }, - { + }, { "type": "rack", "id": "rack7", "top": 418, @@ -66,8 +60,7 @@ "height": 30, "minBayNo": 2, "maxBayNo": 52 - }, - { + }, { "type": "rack", "id": "rack6", "top": 323, @@ -76,8 +69,7 @@ "height": 30, "minBayNo": 2, "maxBayNo": 52 - }, - { + }, { "type": "rack", "id": "rack5", "top": 290, @@ -86,8 +78,7 @@ "height": 30, "minBayNo": 2, "maxBayNo": 52 - }, - { + }, { "type": "rack", "id": "rack3", "top": 225, @@ -96,8 +87,7 @@ "height": 30, "minBayNo": 2, "maxBayNo": 60 - }, - { + }, { "type": "rack", "id": "rack1", "top": 97, @@ -106,8 +96,7 @@ "height": 30, "minBayNo": 2, "maxBayNo": 60 - }, - { + }, { "type": "rack", "id": "rack4", "top": 257, @@ -116,8 +105,7 @@ "height": 30, "minBayNo": 2, "maxBayNo": 60 - }, - { + }, { "type": "rack", "id": "rack2", "top": 129, @@ -126,10 +114,8 @@ "height": 30, "minBayNo": 2, "maxBayNo": 60 - } -], - "rackDescs": [ - { + }], + "rackDescs": [{ "type": "rackDescs", "id": "lb_desc12", "text": "#12", @@ -137,8 +123,7 @@ "left": 260, "width": 47, "height": 27 - }, - { + }, { "type": "rackDescs", "id": "lb_desc11", "text": "#11", @@ -146,8 +131,7 @@ "left": 260, "width": 44, "height": 27 - }, - { + }, { "type": "rackDescs", "id": "lb_desc10", "text": "#10", @@ -155,8 +139,7 @@ "left": 257, "width": 49, "height": 27 - }, - { + }, { "type": "rackDescs", "id": "lb_desc9", "text": "#9", @@ -164,8 +147,7 @@ "left": 257, "width": 38, "height": 27 - }, - { + }, { "type": "rackDescs", "id": "lb_desc8", "text": "#8", @@ -173,8 +155,7 @@ "left": 260, "width": 39, "height": 27 - }, - { + }, { "type": "rackDescs", "id": "lb_desc7", "text": "#7", @@ -182,8 +163,7 @@ "left": 260, "width": 37, "height": 27 - }, - { + }, { "type": "rackDescs", "id": "lb_desc6", "text": "#6", @@ -191,8 +171,7 @@ "left": 260, "width": 38, "height": 27 - }, - { + }, { "type": "rackDescs", "id": "lb_desc5", "text": "#5", @@ -200,8 +179,7 @@ "left": 261, "width": 38, "height": 27 - }, - { + }, { "type": "rackDescs", "id": "lb_desc4", "text": "#4", @@ -209,8 +187,7 @@ "left": 145, "width": 38, "height": 27 - }, - { + }, { "type": "rackDescs", "id": "lb_desc3", "text": "#3", @@ -218,8 +195,7 @@ "left": 145, "width": 38, "height": 27 - }, - { + }, { "type": "rackDescs", "id": "lb_desc2", "text": "#2", @@ -227,8 +203,7 @@ "left": 145, "width": 38, "height": 27 - }, - { + }, { "type": "rackDescs", "id": "lb_desc1", "text": "#1", @@ -236,10 +211,8 @@ "left": 145, "width": 35, "height": 27 - } -], - "crns": [ - { + }], + "crns": [{ "type": "crane", "id": "crn-1", "text": "1", @@ -247,8 +220,7 @@ "left": 777, "width": 93, "height": 22 - }, - { + }, { "type": "crane", "id": "crn-2", "text": "2", @@ -256,8 +228,7 @@ "left": 777, "width": 93, "height": 22 - }, - { + }, { "type": "crane", "id": "crn-3", "text": "3", @@ -265,37 +236,32 @@ "left": 777, "width": 93, "height": 22 - }, - { + }, { "type": "track", "id": "lb_track2", "text": "", - "top": 390, - "left": 325, - "width": 1010, + "top": 387, + "left": 146, + "width": 1112, "height": 2 - }, - { + }, { "type": "track", "id": "lb_track3", "text": "", - "top": 584, - "left": 325, - "width": 1010, + "top": 582, + "left": 146, + "width": 1112, "height": 2 - }, - { + }, { "type": "track", "id": "lb_track1", "text": "", - "top": 197, - "left": 188, - "width": 1148, + "top": 195, + "left": 146, + "width": 1112, "height": 2 - } -], - "stns": [ - { + }], + "stns": [{ "type": "stn", "id": "site-132", "text": "132", @@ -303,8 +269,7 @@ "left": 1399, "width": 60, "height": 63 - }, - { + }, { "type": "stn", "id": "site-126", "text": "126", @@ -312,8 +277,7 @@ "left": 1461, "width": 60, "height": 63 - }, - { + }, { "type": "stn", "id": "site-125", "text": "125", @@ -321,8 +285,7 @@ "left": 1399, "width": 60, "height": 63 - }, - { + }, { "type": "stn", "id": "site-119", "text": "119", @@ -330,8 +293,7 @@ "left": 1461, "width": 60, "height": 63 - }, - { + }, { "type": "stn", "id": "site-118", "text": "118", @@ -339,8 +301,7 @@ "left": 1399, "width": 60, "height": 63 - }, - { + }, { "type": "stn", "id": "site-136", "text": "136", @@ -348,8 +309,7 @@ "left": 1461, "width": 120, "height": 30 - }, - { + }, { "type": "stn", "id": "site-135", "text": "135", @@ -357,8 +317,7 @@ "left": 1399, "width": 60, "height": 30 - }, - { + }, { "type": "stn", "id": "site-134", "text": "134", @@ -366,8 +325,7 @@ "left": 1337, "width": 60, "height": 30 - }, - { + }, { "type": "stn", "id": "site-133", "text": "133", @@ -375,8 +333,7 @@ "left": 1215, "width": 120, "height": 30 - }, - { + }, { "type": "stn", "id": "site-130", "text": "130", @@ -384,8 +341,7 @@ "left": 1461, "width": 60, "height": 30 - }, - { + }, { "type": "stn", "id": "site-129", "text": "129", @@ -393,8 +349,7 @@ "left": 1399, "width": 60, "height": 30 - }, - { + }, { "type": "stn", "id": "site-128", "text": "128", @@ -402,8 +357,7 @@ "left": 1337, "width": 60, "height": 30 - }, - { + }, { "type": "stn", "id": "site-127", "text": "127", @@ -411,8 +365,7 @@ "left": 1215, "width": 120, "height": 30 - }, - { + }, { "type": "stn", "id": "site-131", "text": "131", @@ -420,8 +373,7 @@ "left": 1522, "width": 60, "height": 30 - }, - { + }, { "type": "stn", "id": "site-123", "text": "123", @@ -429,8 +381,7 @@ "left": 1461, "width": 60, "height": 30 - }, - { + }, { "type": "stn", "id": "site-122", "text": "122", @@ -438,8 +389,7 @@ "left": 1399, "width": 60, "height": 30 - }, - { + }, { "type": "stn", "id": "site-121", "text": "121", @@ -447,8 +397,7 @@ "left": 1337, "width": 60, "height": 30 - }, - { + }, { "type": "stn", "id": "site-120", "text": "120", @@ -456,8 +405,7 @@ "left": 1215, "width": 120, "height": 30 - }, - { + }, { "type": "stn", "id": "site-124", "text": "124", @@ -465,8 +413,7 @@ "left": 1522, "width": 60, "height": 30 - }, - { + }, { "type": "stn", "id": "site-112", "text": "112", @@ -474,8 +421,7 @@ "left": 1461, "width": 60, "height": 63 - }, - { + }, { "type": "stn", "id": "site-111", "text": "111", @@ -483,8 +429,7 @@ "left": 1399, "width": 60, "height": 63 - }, - { + }, { "type": "stn", "id": "site-116", "text": "116", @@ -492,8 +437,7 @@ "left": 1461, "width": 60, "height": 30 - }, - { + }, { "type": "stn", "id": "site-115", "text": "115", @@ -501,8 +445,7 @@ "left": 1399, "width": 60, "height": 30 - }, - { + }, { "type": "stn", "id": "site-114", "text": "114", @@ -510,8 +453,7 @@ "left": 1337, "width": 60, "height": 30 - }, - { + }, { "type": "stn", "id": "site-113", "text": "113", @@ -519,8 +461,7 @@ "left": 1215, "width": 120, "height": 30 - }, - { + }, { "type": "stn", "id": "site-117", "text": "117", @@ -528,8 +469,7 @@ "left": 1522, "width": 60, "height": 30 - }, - { + }, { "type": "stn", "id": "site-105", "text": "105", @@ -537,8 +477,7 @@ "left": 1399, "width": 60, "height": 63 - }, - { + }, { "type": "stn", "id": "site-109", "text": "109", @@ -546,8 +485,7 @@ "left": 1461, "width": 60, "height": 30 - }, - { + }, { "type": "stn", "id": "site-108", "text": "108", @@ -555,8 +493,7 @@ "left": 1399, "width": 60, "height": 30 - }, - { + }, { "type": "stn", "id": "site-107", "text": "107", @@ -564,8 +501,7 @@ "left": 1337, "width": 60, "height": 30 - }, - { + }, { "type": "stn", "id": "site-106", "text": "106", @@ -573,8 +509,7 @@ "left": 1215, "width": 120, "height": 30 - }, - { + }, { "type": "stn", "id": "site-104", "text": "104", @@ -582,8 +517,7 @@ "left": 1461, "width": 120, "height": 30 - }, - { + }, { "type": "stn", "id": "site-103", "text": "103", @@ -591,8 +525,7 @@ "left": 1399, "width": 60, "height": 30 - }, - { + }, { "type": "stn", "id": "site-102", "text": "102", @@ -600,8 +533,7 @@ "left": 1337, "width": 60, "height": 30 - }, - { + }, { "type": "stn", "id": "site-101", "text": "101", @@ -609,8 +541,7 @@ "left": 1215, "width": 120, "height": 30 - }, - { + }, { "type": "stn", "id": "site-110", "text": "110", @@ -618,9 +549,9 @@ "left": 1522, "width": 60, "height": 30 - } -] + }] } + // 搴撲綅鍥� function getMap() { let mapName = "<div class='mapName'>" + data.mapName + "</div>" @@ -637,18 +568,32 @@ let btns = '' var maxBayNo = rackss[i].maxBayNo var minBayNo = rackss[i].minBayNo - let bLen = maxBayNo / minBayNo + var bayNo = minBayNo; + // let bLen = maxBayNo / minBayNo + // let bLen = Math.ceil((maxBayNo - minBayNo + 1) / 2); + // let bLen = Math.ceil(maxBayNo / 2); + let bLen = parseInt(maxBayNo / 2); + let width = rackss[i].width / bLen; + if (data.hpPosition == 1) { for (let j = bLen;j > 0; j--) { - btn = "<button class='item' style='width: 34px'>" + maxBayNo + "</button>" + btn = "<button class='item' style='width: " + width + "px'>" + maxBayNo + "</button>" btns = btns + btn - maxBayNo = maxBayNo - minBayNo; + maxBayNo = maxBayNo - 2; + if(maxBayNo < minBayNo) { + maxBayNo = minBayNo; + } + // maxBayNo = maxBayNo - minBayNo; } }else { for (let j = 0;j < bLen; j++) { - btn = "<button class='item' style='width: 34px'>" + minBayNo + "</button>" + btn = "<button class='item' style='width: " + width + "px'>" + bayNo + "</button>" btns = btns + btn - minBayNo = minBayNo + minBayNo; + bayNo = bayNo + 2; + if(bayNo > maxBayNo) { + bayNo = maxBayNo; + } + // bayNo = bayNo + minBayNo; } } @@ -704,6 +649,4 @@ } let whycq = racks + stns + rackDescs + crns + tracks $(".main-part").append(whycq) -}; - - +}; \ No newline at end of file -- Gitblit v1.9.1