From 1c95a184f83f180414e0ec93dc6af8380ac20732 Mon Sep 17 00:00:00 2001
From: Junjie <DELL@qq.com>
Date: 星期二, 02 十二月 2025 13:51:47 +0800
Subject: [PATCH] #

---
 src/main/webapp/views/watch/console2.html |   90 ++++++++++++++++++++++++++++++++++----------
 1 files changed, 69 insertions(+), 21 deletions(-)

diff --git a/src/main/webapp/views/watch/console2.html b/src/main/webapp/views/watch/console2.html
index 1d4560d..5657f1c 100644
--- a/src/main/webapp/views/watch/console2.html
+++ b/src/main/webapp/views/watch/console2.html
@@ -86,6 +86,7 @@
     let pixiCrnMap = new Map();
     let pixiShelfMap = new Map();
     let pixiTrackMap = new Map();
+    let crnList = [];
     let objectsContainer;
     let objectsContainer2;
     let graphicsShelf;
@@ -349,6 +350,47 @@
             }
           })
 
+          map.forEach((item, index) => {
+            for(let idx = 0;idx < item.length;idx++){
+              let val = item[idx];
+              let cellWidth = val.cellWidth / 40;
+              let cellHeight = val.cellHeight / 8;
+
+              val.width = cellWidth;
+              val.height = cellHeight;
+
+              let mergeHeight = cellHeight;
+              if(val.rowSpan  > 1) {
+                for(let i = 1;i < val.rowSpan;i++){
+                  let nextMerge = map[index + i][idx];
+                  if(nextMerge.type != 'merge'){
+                    continue;
+                  }
+                  
+                  let mergeCellHeight = nextMerge.cellHeight / 8;
+                  mergeHeight += mergeCellHeight;
+                }
+                
+                val.height = mergeHeight;
+              }
+
+              let mergeWidth = cellWidth;
+              if(val.colSpan  > 1) {
+                for(let i = 1;i < val.colSpan;i++){
+                  let nextMerge = map[index][idx + i];
+                  if(nextMerge.type != 'merge'){
+                    continue;
+                  }
+                  
+                  let mergeCellWidth = nextMerge.cellWidth / 40;
+                  mergeWidth += mergeCellWidth;
+                }
+                
+                val.width = mergeWidth;
+              }
+            }
+          })
+
           const rowHeightScaled = bayHeightList.map(h => (h != null && h !== -1) ? (h / 8) : (height));
           let yOffsets = [];
           let yCursor = 0;
@@ -361,11 +403,8 @@
             let xCursor = 0;
             for (let colIndex = 0; colIndex < row.length; colIndex++) {
               let val = row[colIndex];
-              let cellWidth = val.cellWidth / 40;
-              let cellHeight = val.cellHeight / 8;
-
-              val.width = cellWidth;
-              val.height = cellHeight;
+              let cellWidth = val.width;
+              let cellHeight = val.height;
 
               val.posX = xCursor;
               val.posY = yOffsets[rowIndex];
@@ -408,6 +447,26 @@
             }
           });
 
+          crnList.forEach((item) => {
+              let sprite = new PIXI.Sprite(graphicsCrn);
+              const deviceNo = getDeviceNo(item.value);
+              const taskNo = getTaskNo(item.value);
+              const style = new PIXI.TextStyle({ fontFamily: 'Arial', fontSize: 12, fill: '#ffffff', stroke: '#000000', strokeThickness: 2 });
+              const txt = taskNo > 0 ? (deviceNo + "(" + taskNo + ")") : String(deviceNo);
+              const text = new PIXI.Text(txt, style);
+              text.anchor.set(0.5);
+              text.position.set(sprite.width / 2, sprite.height / 2);
+              sprite.addChild(text);
+              sprite.textObj = text;
+              sprite.zIndex = 1;
+
+              sprite.position.set(item.posX, item.posY);
+              sprite.interactive = true; // 蹇呴』瑕佽缃墠鑳芥帴鏀朵簨浠�
+              sprite.buttonMode = true; // 璁╁厜鏍囧湪hover鏃跺彉涓烘墜鍨嬫寚閽�
+
+              pixiCrnMap.set(parseInt(deviceNo), sprite);
+              objectsContainer2.addChild(sprite);
+          })
           
 
           //瑙嗚灞呬腑
@@ -796,22 +855,11 @@
           pixiStaMap.set(parseInt(siteId), sprite);
         }
       } else if (item.type == 'crn') {
-        if (getDeviceNo(value) == -1) {
-          sprite = createTrackSprite(item.width, item.height);
-          sprite.zIndex = 0;
-        } else {
-          sprite = new PIXI.Sprite(graphicsCrn);
-          const deviceNo = getDeviceNo(value);
-          const taskNo = getTaskNo(value);
-          const style = new PIXI.TextStyle({ fontFamily: 'Arial', fontSize: 12, fill: '#ffffff', stroke: '#000000', strokeThickness: 2 });
-          const txt = taskNo > 0 ? (deviceNo + "(" + taskNo + ")") : String(deviceNo);
-          const text = new PIXI.Text(txt, style);
-          text.anchor.set(0.5);
-          text.position.set(sprite.width / 2, sprite.height / 2);
-          sprite.addChild(text);
-          sprite.textObj = text;
-          pixiCrnMap.set(parseInt(deviceNo), sprite);
-          sprite.zIndex = 1;
+        sprite = createTrackSprite(item.width, item.height);
+        sprite.zIndex = 0;
+
+        if(getDeviceNo(value) > 0){
+          crnList.push(item);
         }
       } else {
         return null;

--
Gitblit v1.9.1