From 2dd641969aa20b81156bd421acb777e8c3fc9725 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期二, 04 六月 2024 16:51:59 +0800
Subject: [PATCH] # 地图优化

---
 src/main/webapp/views/home/map2.html |   48 +++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 41 insertions(+), 7 deletions(-)

diff --git a/src/main/webapp/views/home/map2.html b/src/main/webapp/views/home/map2.html
index 23d9298..e8e0c00 100644
--- a/src/main/webapp/views/home/map2.html
+++ b/src/main/webapp/views/home/map2.html
@@ -487,7 +487,7 @@
 
                 <div class="hoverCard">
                     <div class="card-details">
-                        <p class="text-title" style="text-align: center;">妤煎眰 {{currentLev}}F</p>
+                        <p class="text-title" style="text-align: center;"> {{currentLev}}灞�</p>
                         <div class="text-body" style="display: flex;justify-content:space-between;flex-wrap: wrap;">
                             <div v-for="(lev,idx) in floorList">
                                 <el-button :style="{background:currentLev === lev ? '#7DCDFF':''}" @click="currentLev = lev">{{lev}}F</el-button>
@@ -495,6 +495,18 @@
                         </div>
                     </div>
                     <button class="card-button">妤煎眰 {{currentLev}}F</button>
+                </div>
+
+                <div class="hoverCard">
+                    <div class="card-details">
+                        <p class="text-title" style="text-align: center;">{{currentFloor}}妤�</p>
+                        <div class="text-body" style="display: flex;justify-content:space-between;flex-wrap: wrap;">
+                            <div v-for="(floor,idx) in currentFloorList">
+                                <el-button :style="{background:currentFloor === floor ? '#7DCDFF':''}" @click="currentFloor = floor">{{floor}}F</el-button>
+                            </div>
+                        </div>
+                    </div>
+                    <button class="card-button">妤煎眰 {{currentFloor}}F</button>
                 </div>
 
             </div>
@@ -524,6 +536,7 @@
     let height = 25;
     let pixiApp;
     let pixiStageMap = new Map();
+    let objectsContainer;
 
     var $layui = layui.config({
         base: baseUrl + "/static/layui/lay/modules/"
@@ -539,6 +552,7 @@
             endPosition: "0802501",
             pointContainerWidth: 0,
             currentLev: 1,
+            currentFloor: 1,
             crnList: null,
             crnBox: false,
             crnBoxTop: "0px",
@@ -558,7 +572,8 @@
             drawerLocNoData: null,
             drawerLocDetls: [],
             mapFps: 0,
-            floorList: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], //褰撳墠椤圭洰妤煎眰
+            floorList: [1, 2], //褰撳墠椤圭洰妤煎眰
+            currentFloorList: [1, 2, 3], //褰撳墠椤圭洰妤煎眰
         },
         created(){
             this.init()
@@ -574,6 +589,20 @@
                 }
             },
             currentLev: {
+                deep: true,
+                handler(val) {
+                    console.log(val)
+                    this.init()
+                    if (this.searchMatnr != ""
+                        || this.searchOrderNo != ""
+                        || this.searchSpecs != ""
+                        || this.searchMaktx != ""
+                        || this.searchLocNo != "") {
+                        this.searchLoc()
+                    }
+                }
+            },
+            currentFloor: {
                 deep: true,
                 handler(val) {
                     this.init()
@@ -600,7 +629,7 @@
             init(){
                 let that = this
                 $.ajax({
-                    url: baseUrl + "/map/getData/" + this.currentLev + "/auth",
+                    url: baseUrl + "/agv/map/getData/" + this.currentFloor + "/" +this.currentLev + "/auth",
                     headers: {'token': localStorage.getItem('token')},
                     method: "get",
                     success: (data) => {
@@ -651,6 +680,10 @@
                 });
                 //Add the canvas that Pixi automatically created for you to the HTML document
                 $("#pixiView").append(pixiApp.view)
+
+                // 鍒涘缓涓�涓鍣ㄦ潵绠$悊澶ф壒閲忕殑鏄剧ず瀵硅薄
+                objectsContainer = new PIXI.Container();
+                pixiApp.stage.addChild(objectsContainer);
 
                 //*******************鎷栧姩鐢诲竷*******************
                 let stageOriginalPos;
@@ -740,7 +773,7 @@
             },
             createMapData() {
                 let that = this
-                pixiApp.stage.removeChildren();
+                objectsContainer.removeChildren();
                 this.map.forEach((item,index) => {
                     for (let idx = 0; idx < item.length; idx++) {
                         let val = item[idx]
@@ -756,7 +789,7 @@
                         rectangle.locY = idx;
 
                         pixiStageMap.set(this.map[index][idx].locNo, rectangle);
-                        pixiApp.stage.addChild(rectangle);
+                        objectsContainer.addChild(rectangle);
                     }
                 })
 
@@ -787,6 +820,7 @@
                 this.drawerLocNoData =  data
             },
             openLocDetail(locNo) {
+                url = '/agv/locDetl/list/auth';
                 $layui.layer.open({
                     type: 2,
                     title: '搴撲綅鐗╂枡',
@@ -1061,7 +1095,7 @@
                 // }
                 let that = this;
                 $.ajax({
-                    url: baseUrl + "/map/searchData/auth",
+                    url: baseUrl + "/agv/map/searchData/auth",
                     headers: {'token': localStorage.getItem('token')},
                     dataType: 'json',
                     data: {
@@ -1126,7 +1160,7 @@
 
     function getContainer(value, x, y, locSts) {
         let rectangle = new PIXI.Graphics();
-        if (value === 0) {
+        if (value == 0) {
             if (locSts === "F") {
                 rectangle.beginFill(0xff0000);
                 rectangle.originColor = 0xff0000;

--
Gitblit v1.9.1