From 3fc96f06985fe61b51aa200a6821f795ee9671c0 Mon Sep 17 00:00:00 2001 From: 18516761980 <56479841@qq.com> Date: 星期三, 22 六月 2022 12:50:43 +0800 Subject: [PATCH] # --- src/main/webapp/views/render.js | 161 +++++++++++++++++++++++++++++++---------------------- 1 files changed, 93 insertions(+), 68 deletions(-) diff --git a/src/main/webapp/views/render.js b/src/main/webapp/views/render.js index e59bfc5..aca6084 100644 --- a/src/main/webapp/views/render.js +++ b/src/main/webapp/views/render.js @@ -2,7 +2,7 @@ "mapName": "HYLYWCS", "rackCount": 16, "crnCount": 4, - "stbCount": 14, + "stbCount": 16, "hpPosition": 0, "minBayNo": 2, "floors": 1, @@ -347,82 +347,90 @@ }], "stns": [{ "type": "stn", - "id": "site-112", - "text": "112", + "id": "site-306", + "text": "306", "top": 458, - "left": 311, - "width": 100, + "left": 211, + "width": 66, "height": 24 }, { "type": "stn", - "id": "site-111", - "text": "111", - "top": 458, - "left": 209, - "width": 100, - "height": 24 - }, { - "type": "stn", - "id": "site-114", - "text": "114", - "top": 568, - "left": 311, - "width": 100, - "height": 24 - }, { - "type": "stn", - "id": "site-113", - "text": "113", - "top": 568, - "left": 209, - "width": 100, - "height": 24 - }, { - "type": "stn", - "id": "site-105", - "text": "105", - "top": 262, - "left": 201, - "width": 100, - "height": 24 - }, { - "type": "stn", - "id": "site-109", - "text": "109", + "id": "site-303", + "text": "303", "top": 399, - "left": 208, + "left": 211, + "width": 66, + "height": 24 + }, { + "type": "stn", + "id": "site-304", + "text": "304", + "top": 458, + "left": 345, + "width": 66, + "height": 24 + }, { + "type": "stn", + "id": "site-305", + "text": "305", + "top": 458, + "left": 278, + "width": 66, + "height": 24 + }, { + "type": "stn", + "id": "site-401", + "text": "401", + "top": 568, + "left": 311, "width": 100, "height": 24 }, { "type": "stn", - "id": "site-108", - "text": "108", + "id": "site-402", + "text": "402", + "top": 568, + "left": 209, + "width": 100, + "height": 24 + }, { + "type": "stn", + "id": "site-202", + "text": "202", + "top": 262, + "left": 202, + "width": 100, + "height": 24 + }, { + "type": "stn", + "id": "site-302", + "text": "302", + "top": 399, + "left": 278, + "width": 66, + "height": 24 + }, { + "type": "stn", + "id": "site-203", + "text": "203", "top": 318, "left": 303, "width": 100, "height": 24 }, { "type": "stn", - "id": "site-107", - "text": "107", + "id": "site-204", + "text": "204", "top": 318, - "left": 201, + "left": 202, "width": 100, "height": 24 }, { "type": "stn", - "id": "site-106", - "text": "106", + "id": "site-201", + "text": "201", "top": 262, "left": 303, - "width": 100, - "height": 24 - }, { - "type": "stn", - "id": "site-104", - "text": "104", - "top": 180, - "left": 255, "width": 100, "height": 24 }, { @@ -430,14 +438,6 @@ "id": "site-103", "text": "103", "top": 180, - "left": 153, - "width": 100, - "height": 24 - }, { - "type": "stn", - "id": "site-102", - "text": "102", - "top": 122, "left": 255, "width": 100, "height": 24 @@ -446,15 +446,31 @@ "id": "site-101", "text": "101", "top": 122, - "left": 153, + "left": 255, "width": 100, "height": 24 }, { "type": "stn", - "id": "site-110", - "text": "110", + "id": "site-301", + "text": "301", "top": 399, - "left": 310, + "left": 345, + "width": 66, + "height": 24 + }, { + "type": "stn", + "id": "site-102", + "text": "102", + "top": 122, + "left": 154, + "width": 100, + "height": 24 + }, { + "type": "stn", + "id": "site-104", + "text": "104", + "top": 180, + "left": 154, "width": 100, "height": 24 }] @@ -466,6 +482,7 @@ let rack = '', racks = '', rackDesc = '', rackDescs = '', crn = '', crns = '',track = '', tracks = '', stn = '', stns = ''; + let stnCount = 0; let rackss = data.racks, rackDescss = data.rackDescs, crnss = data.crns, @@ -494,8 +511,13 @@ // maxBayNo = maxBayNo - minBayNo; } }else { + // if(i===13) debugger for (let j = 0;j < bLen; j++) { - btn = "<button class='item' style='width: " + width + "px'>" + bayNo + "</button>" + if(bayNo >= maxBayNo){ + btn = "<button class='item' style='width: " + width/2 + "px'>" + bayNo + "</button>" + } else { + btn = "<button class='item' style='width: " + width + "px'>" + bayNo + "</button>" + } btns = btns + btn bayNo = bayNo + 2; if(bayNo > maxBayNo) { @@ -554,7 +576,10 @@ "px;left: "+ stnss[i].left + "px'>" + stnss[i].text + "</div>" stns = stns + stn + stnCount++; } let whycq = racks + stns + rackDescs + crns + tracks $(".main-part").append(whycq) + $("#line-total").empty() + $("#line-total").html(stnCount) }; \ No newline at end of file -- Gitblit v1.9.1