From 58dc3b44e29e52de145ca95569fa34c0ad48a06a Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期四, 26 二月 2026 11:13:21 +0800
Subject: [PATCH] #

---
 src/main/webapp/views/locMap/locMap.html |   81 ++++++++++++++++++++++++++++++++++++----
 1 files changed, 72 insertions(+), 9 deletions(-)

diff --git a/src/main/webapp/views/locMap/locMap.html b/src/main/webapp/views/locMap/locMap.html
index 89b413c..36fdee8 100644
--- a/src/main/webapp/views/locMap/locMap.html
+++ b/src/main/webapp/views/locMap/locMap.html
@@ -59,9 +59,9 @@
   >
     <div v-if="drawerLocNoData!=null">
       <div style="margin: 10px;">
-        <div style="margin-top: 5px;">鎺掞細{{drawerLocNoData.row}}</div>
-        <div style="margin-top: 5px;">鍒楋細{{drawerLocNoData.bay}}</div>
-        <div style="margin-top: 5px;">灞傦細{{drawerLocNoData.lev}}</div>
+<!--        <div style="margin-top: 5px;">鎺掞細{{drawerLocNoData.row}}</div>-->
+<!--        <div style="margin-top: 5px;">鍒楋細{{drawerLocNoData.bay}}</div>-->
+<!--        <div style="margin-top: 5px;">灞傦細{{drawerLocNoData.lev}}</div>-->
         <div style="margin-top: 5px;">搴撲綅鍙凤細{{drawerLocNoData.locNo}}</div>
         <div style="margin-top: 5px;">搴撲綅鐘舵�侊細{{drawerLocNoData.locSts}}</div>
       </div>
@@ -102,6 +102,7 @@
   let pixiStaMap = new Map();
   let objectsContainer;
   let objectsContainer3;
+  let tracksGraphics;
   let mapRoot;
   let mapContentSize = { width: 0, height: 0 };
   let graphics0;
@@ -247,6 +248,9 @@
         objectsContainer = new PIXI.Container();
         mapRoot.addChild(objectsContainer);
 
+        tracksGraphics = new PIXI.Graphics();
+        mapRoot.addChild(tracksGraphics);
+
         // 鍒涘缓涓�涓鍣ㄦ潵绠$悊澶ф壒閲忕殑鏄剧ず瀵硅薄
         objectsContainer3 = new PIXI.Container();
         mapRoot.addChild(objectsContainer3);
@@ -348,6 +352,7 @@
           pixiStageList = [map.length]//鍒濆鍖栧垪琛�
           pixiStaMap = new Map();//閲嶇疆
           objectsContainer.removeChildren()
+          if (tracksGraphics) { tracksGraphics.clear(); }
           map.forEach((item,index) => {
             pixiStageList[index] = [item.length]
             for (let idx = 0; idx < item.length; idx++) {
@@ -415,9 +420,63 @@
           const contentW = Math.max(0, maxX - minX);
           const contentH = Math.max(0, maxY - minY);
           mapContentSize = { width: contentW, height: contentH };
+          this.drawTracks(map);
           this.applyMapTransform(true);
         }
         this.map = map;
+      },
+      isTrackCell(cell) {
+        if (!cell) { return false; }
+        const type = cell.type ? String(cell.type).toLowerCase() : '';
+        if (type === 'track' || type === 'crn' || type === 'dualcrn' || type === 'rgv') { return true; }
+        if (cell.trackSiteNo != null) { return true; }
+        const v = parseInt(cell.value, 10);
+        if (v === 3 || v === 9) { return true; }
+        if (cell.value != null) {
+          try {
+            const obj = (typeof cell.value === 'string') ? JSON.parse(cell.value) : cell.value;
+            if (obj && (obj.trackSiteNo != null || (obj.deviceNo != null && (type === 'crn' || type === 'dualcrn' || type === 'rgv')))) {
+              return true;
+            }
+          } catch (e) {}
+        }
+        return false;
+      },
+      drawTracks(map) {
+        if (!tracksGraphics || !Array.isArray(map)) { return; }
+        tracksGraphics.clear();
+        const railColor = 0x6c727a;
+        const railWidth = Math.max(1, Math.round(Math.min(width, height) * 0.08));
+        tracksGraphics.lineStyle(railWidth, railColor, 1);
+
+        for (let r = 0; r < map.length; r++) {
+          const row = map[r];
+          if (!Array.isArray(row)) { continue; }
+          for (let c = 0; c < row.length; c++) {
+            const cell = row[c];
+            if (!this.isTrackCell(cell)) { continue; }
+            const cx = c * width + width / 2;
+            const cy = r * height + height / 2;
+            const up = (r - 1 >= 0 && Array.isArray(map[r - 1])) ? map[r - 1][c] : null;
+            const right = (c + 1 < row.length) ? row[c + 1] : null;
+            const down = (r + 1 < map.length && Array.isArray(map[r + 1])) ? map[r + 1][c] : null;
+            const left = (c - 1 >= 0) ? row[c - 1] : null;
+            const hasN = this.isTrackCell(up);
+            const hasE = this.isTrackCell(right);
+            const hasS = this.isTrackCell(down);
+            const hasW = this.isTrackCell(left);
+            const seg = Math.min(width, height) * 0.5;
+            let drew = false;
+            if (hasN) { tracksGraphics.moveTo(cx, cy); tracksGraphics.lineTo(cx, cy - seg); drew = true; }
+            if (hasE) { tracksGraphics.moveTo(cx, cy); tracksGraphics.lineTo(cx + seg, cy); drew = true; }
+            if (hasS) { tracksGraphics.moveTo(cx, cy); tracksGraphics.lineTo(cx, cy + seg); drew = true; }
+            if (hasW) { tracksGraphics.moveTo(cx, cy); tracksGraphics.lineTo(cx - seg, cy); drew = true; }
+            if (!drew) {
+              tracksGraphics.moveTo(cx - seg * 0.4, cy);
+              tracksGraphics.lineTo(cx + seg * 0.4, cy);
+            }
+          }
+        }
       },
       parseRotation(value) {
         const num = parseInt(value, 10);
@@ -625,12 +684,16 @@
       sprite = new PIXI.Sprite(graphics0);
     }
     sprite.position.set(x, y);
-    sprite.interactive = true; // 蹇呴』瑕佽缃墠鑳芥帴鏀朵簨浠�
-    sprite.buttonMode = true; // 璁╁厜鏍囧湪hover鏃跺彉涓烘墜鍨嬫寚閽�
-
-    sprite.on('pointerdown', (e) => {
-      pointerDownEvent(e)
-    })
+    const type = item && item.type ? String(item.type).toLowerCase() : '';
+    const numVal = parseInt(value, 10);
+    const isTrackCell = numVal === 3 || numVal === 9 || type === 'track' || type === 'crn' || type === 'dualcrn' || type === 'rgv';
+    if (!isTrackCell) {
+      sprite.interactive = true; // 蹇呴』瑕佽缃墠鑳芥帴鏀朵簨浠�
+      sprite.buttonMode = true; // 璁╁厜鏍囧湪hover鏃跺彉涓烘墜鍨嬫寚閽�
+      sprite.on('pointerdown', (e) => {
+        pointerDownEvent(e)
+      })
+    }
 
     return sprite;
   }

--
Gitblit v1.9.1