From 6a4928d4bfaa35999886f328630713642c4f6133 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期三, 11 六月 2025 12:39:32 +0800
Subject: [PATCH] #
---
src/main/webapp/static/js/console.js | 77 +++++++++++++++++++++++++++++++-------
1 files changed, 63 insertions(+), 14 deletions(-)
diff --git a/src/main/webapp/static/js/console.js b/src/main/webapp/static/js/console.js
index 7ddda45..570c792 100644
--- a/src/main/webapp/static/js/console.js
+++ b/src/main/webapp/static/js/console.js
@@ -10,6 +10,8 @@
tracks = '',
stn = '',
stns = '',
+ barcode = '',
+ barcodeArr = [],
stnArr = [],
floorBtn = '',
floorBtns = '',
@@ -25,27 +27,58 @@
for (let i = 0;i < rackss.length;i++) {
let bay ='' // 鍗曚釜搴撲綅
let bays = '' // 搴撲綅闆嗗悎
- let bayWidth = rackss[i].width / (rackss[i].maxBayNo / rackss[i].minBayNo)
- console.log(bayWidth)
let maxBayNo = rackss[i].maxBayNo // 鏈�澶у簱浣嶅彿
let minBayNo = rackss[i].minBayNo // 鏈�灏忓簱浣嶅彿
- let bLen = maxBayNo / minBayNo // 搴撲綅涓暟
+ let bLen
+ let interval // 闂撮殧鏁�
+
+ if (maxBayNo<35) {
+ interval = 1
+ bLen = maxBayNo / interval // 搴撲綅涓暟
+ } else {
+ interval = 2
+ bLen = maxBayNo / interval // 搴撲綅涓暟
+ }
+ let bayWidth // 鍗曚釜搴撲綅瀹藉害
let bNum // 搴撲綅鍙风爜
- // hpPosition 0 琛ㄧず璐ф灦搴忓彿 宸�->鍙� 1 琛ㄧず璐ф灦搴忓彿 鍙�->宸�
+
+ if (minBayNo % 2 == 0) { // 浠�2寮�濮�
+ if(interval == 1) {
+ bLen = bLen - 1
+ } else if (interval == 2) {
+ if (maxBayNo % 2 == 0) { // 鍋舵暟
+ bLen = bLen
+ } else { // 濂囨暟
+ maxBayNo = maxBayNo + 1
+ bLen = maxBayNo / interval // 搴撲綅涓暟
+ }
+ }
+ } else { // 浠�1寮�濮�
+ if(interval == 1) {
+ bLen = bLen
+ } else if (interval == 2) {
+ if (maxBayNo % 2 == 0) { // 鍋舵暟
+ bLen = bLen
+ } else { // 濂囨暟
+ bLen = bLen + 1
+ }
+ }
+ }
+ bayWidth = rackss[i].width / bLen
+ // hpPosition 0 琛ㄧず璐ф灦搴忓彿 宸�->鍙� 1 琛ㄧず璐ф灦搴忓彿 宸�<-鍙�
if (mapInfo.hpPosition == 1) {
bNum = maxBayNo
for (let j = bLen; j > 0; j--) {
bay = "<button class='item' style='width: "+ bayWidth +"px'>" + bNum + "</button>"
bays = bays + bay
- bNum = bNum - minBayNo;
+ bNum = bNum - interval;
}
}else {
bNum = minBayNo
for (let j = 0; j < bLen; j++) {
-
bay = "<button class='item' style='width: "+ bayWidth +"px'>" + bNum + "</button>"
bays = bays + bay
- bNum = bNum + minBayNo;
+ bNum = bNum + interval;
}
}
@@ -91,18 +124,25 @@
}
// 妤煎眰
for (let i = 0; i < areas.length;i++) {
+
let stnss = areas[i].stns
let floor = areas[i].text
+ let barcodes = areas[i].barcode
floorId = areas[i].id
- var position = (i+1)*100
+ var position = (i+1)*100 +400
floorBtn =
- "<button class='floorBtn btn-16' onclick='changFloor("+i+")' style='top: "+position+"px;'>" + floor +"</button>"
- floorBtnss = floorBtnss + floorBtn
+ "<button class='floorBtn btn-16' onclick='changFloor("+i+")' style='top: "+10+"px;left: "+position+"px;'>" + floor +"</button>"
+ if (mapInfo.areas[0].floors.length == 1) {
+ floorBtnss = ''
+ } else {
+ floorBtnss = floorBtnss + floorBtn
+ }
// 姣忓眰鐨� 杈撻�佺嚎绔欑偣
var index = i
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 +
@@ -126,20 +166,29 @@
}
}
+ 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])
- listenChange();
+ // listenChange();
}
function changFloor(e) {
$(".main-part").empty() // 娓呯┖鑺傜偣
- floorInfo = racks + stnArr[e] +rackDescs + crns + tracks + floorBtnss
+ floorInfo = racks + stnArr[e] +rackDescs + crns + tracks + floorBtnss+ barcodeArr[0]
$(".main-part").append(floorInfo)
$("#line-total").empty()
$("#line-total").html(total[e])
- listenChange();
+ // listenChange();
}
\ No newline at end of file
--
Gitblit v1.9.1