From 4c7e3f113b80e37c52163c30b80b9256f0bee5e3 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期一, 17 十一月 2025 13:34:39 +0800
Subject: [PATCH] #

---
 src/main/webapp/views/locMap/locMap.html |  110 +++++++-----------------------------------------------
 1 files changed, 15 insertions(+), 95 deletions(-)

diff --git a/src/main/webapp/views/locMap/locMap.html b/src/main/webapp/views/locMap/locMap.html
index bf5fa32..a8a34d1 100644
--- a/src/main/webapp/views/locMap/locMap.html
+++ b/src/main/webapp/views/locMap/locMap.html
@@ -238,101 +238,22 @@
           }
         });
       },
-      getShuttleStateInfo() {
-        this.sendWs(JSON.stringify({
-          "url": "/shuttle/table/shuttle/state",
-          "data": {}
-        }))
-      },
-      setShuttleStateInfo(res) {
-        // 鍥涘悜绌挎杞︿俊鎭〃鑾峰彇
-        let that = this
-        if (res.code == 200) {
-          let currentLevShuttle = []//褰撳墠妤煎眰灏忚溅闆嗗悎
-          res.data.forEach((item,idx) => {
-            if (item != null && item.point != undefined && item.point != null) {
-              if (item.point.z == that.currentLev) {
-                currentLevShuttle.push(item);
-              }
-            }
-          })
-          that.shuttleList = res.data
-          if (that.shuttleColorList.length == 0) {
-            let colorList = []//闅忔満灏忚溅棰滆壊
-            res.data.forEach((item,idx) => {
-              colorList[item.shuttleNo] = that.colorRGB()
-            })
-            that.shuttleColorList = colorList
-          }
-
-          const result = this.findShuttleDiffList(this.currentLevShuttleList, currentLevShuttle);
-          if (!result) {
-            //灏忚溅瀛樺湪鍙樺姩锛岄噸鏂版覆鏌撳叏閮ㄥ皬杞�
-            pixiShuttleMap.forEach((shuttle,index) => {
-              pixiApp.stage.removeChild(shuttle)
-              pixiShuttleMap.delete(index)
-            })
-
-            currentLevShuttle.forEach((item,index) => {
-              pixiApp.loader.load((loader, resources) => {
-                // 绾圭悊鍒涘缓灏忚溅
-                const shuttle = new PIXI.Sprite(resources.shuttle.texture);
-                shuttle.width = width
-                shuttle.height = height
-                shuttle.x = (item.wcsPoint.y - 0) * width;//鏇存柊鍧愭爣x
-                shuttle.y = (item.wcsPoint.x - 1) * height;//鏇存柊鍧愭爣y
-                shuttle.updateMoveStatus = true;//鍔ㄧ敾鎵ц瀹屾垚
-                shuttle.interactive = true; // 蹇呴』瑕佽缃墠鑳芥帴鏀朵簨浠�
-                shuttle.buttonMode = true; // 璁╁厜鏍囧湪hover鏃跺彉涓烘墜鍨嬫寚閽�
-                shuttle.on('pointerdown', (e) => {
-                  this.drawerShuttle = true;
-                  this.drawerShuttleData = item;
-                })
-                pixiApp.stage.addChild(shuttle);
-                pixiShuttleMap.set(item.shuttleNo, shuttle);
-              })
-
-              if (item.moveAdvancePath != null && item.moveAdvancePath.length > 0) {//瀛樺湪棰勮璺緞锛岃繘琛屾覆鏌�
-                this.addMoveAdvancePath(item.moveAdvancePath, item.shuttleNo);//娣诲姞棰勮璺緞
-              }
-
-            })
-          }else {
-            //灏忚溅涓嶅瓨鍦ㄥ彉鍔紝娓叉煋灏忚溅浣嶇疆
-            currentLevShuttle.forEach((item,index) => {
-              this.updateShuttleXY(item)
-            })
-
-            const resultPath = this.findShuttlePathDiffList(JSON.parse(JSON.stringify(this.currentLevShuttleList)), JSON.parse(JSON.stringify(currentLevShuttle)));
-            if (!resultPath) {
-              //棰勮璺緞瀛樺湪鍙樺姩锛屾覆鏌撹矾寰�
-              currentLevShuttle.forEach((item,index) => {
-                //鍒犻櫎棰勮璺緞
-                this.removeMoveAdvancePath(item.shuttleNo);
-                if (item.moveAdvancePath != null && item.moveAdvancePath.length > 0) {//瀛樺湪棰勮璺緞锛岃繘琛屾覆鏌�
-                  this.addMoveAdvancePath(item.moveAdvancePath, item.shuttleNo);//娣诲姞棰勮璺緞
-                }
-              })
-            }
-          }
-          that.currentLevShuttleList = currentLevShuttle;
-        }
-      },
       //鑾峰彇鍦板浘鏁版嵁
       getMap(lev) {
-        this.sendWs(JSON.stringify({
-          "url": "/console/locMap/auth",
-          "data": lev
-        }))
-      },
-      setMap(res) {
-        //鑾峰彇鍦板浘鏁版嵁
-        let data = res.data
-        let tmp = []
-        for (let i = 1; i < data.length - 1; i++) {
-          tmp.push(data[i])
-        }
-        this.createMapData(tmp)
+        let that = this;
+          $.ajax({
+              url: baseUrl + "/console/map/" + lev + "/auth",
+              headers: {
+                  'token': localStorage.getItem('token')
+              },
+              data: {},
+              method: 'get',
+              success: function(res) {
+                //鑾峰彇鍦板浘鏁版嵁
+                let data = res.data
+                that.createMapData(data)
+              }
+          })
       },
       changeFloor(lev) {
         this.currentLev = lev
@@ -365,7 +286,7 @@
         pixiApp.loader.add('shuttle', '../static/images/sxcar.png');
 
         // 浠嶨raphics瀵硅薄鍒涘缓涓�涓汗鐞�
-		graphicsF = pixiApp.renderer.generateTexture(getContainer(1000));
+		    graphicsF = pixiApp.renderer.generateTexture(getContainer(1000));
         graphics0 = pixiApp.renderer.generateTexture(getContainer(0));
         graphics3 = pixiApp.renderer.generateTexture(getContainer(3));
         graphics4 = pixiApp.renderer.generateTexture(getContainer(4));
@@ -478,7 +399,6 @@
           this.reloadMap = false
           pixiStageList = [map.length]//鍒濆鍖栧垪琛�
           pixiStaMap = new Map();//閲嶇疆
-
           objectsContainer.removeChildren()
           map.forEach((item,index) => {
             pixiStageList[index] = [item.length]

--
Gitblit v1.9.1