From f83e9ca0c3b3429c6ec85d31ff30db37c4218ae3 Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期一, 18 十二月 2023 16:26:43 +0800
Subject: [PATCH] #map latest test
---
src/main/webapp/views/console4.html | 79 ++++++++++++++++++++++++---------------
1 files changed, 49 insertions(+), 30 deletions(-)
diff --git a/src/main/webapp/views/console4.html b/src/main/webapp/views/console4.html
index d6737c5..877439f 100644
--- a/src/main/webapp/views/console4.html
+++ b/src/main/webapp/views/console4.html
@@ -14,7 +14,7 @@
<script type="text/javascript" src="../static/vue/js/vue.min.js"></script>
<script type="text/javascript" src="../static/vue/element/element.js"></script>
<script src="../static/js/gsap.min.js"></script>
- <script src="../static/js/pixi.min.js"></script>
+ <script src="../static/js/pixi-legacy.min.js"></script>
<style>
*{
margin: 0;
@@ -544,15 +544,17 @@
return false;//涓や釜闆嗗悎闀垮害涓嶄竴鑷�
}
+ let flag = false;
list1.forEach((item,index) => {
for (var i = 0; i < list2.length; i++) {
- if (item.shuttleNo != list2[i].shuttleNo) {
- return false;//鎵句笉鍒板皬杞﹀彿
+ if (item.shuttleNo == list2[i].shuttleNo) {
+ flag = true;
+ break;
}
}
});
- return true;
+ return flag;
},
findShuttlePathDiffList(list1, list2) {
//妫�娴嬮泦鍚�1閲岄潰鐨勫皬杞﹂璁¤矾寰勬槸鍚﹀湪闆嗗悎2涓湁鍙樺姩
@@ -567,7 +569,7 @@
let item = list1[index];
for (var i = 0; i < list2.length; i++) {
if (item.shuttleNo != list2[i].shuttleNo) {
- return false;//鎵句笉鍒板皬杞﹀彿
+ continue;//鎵句笉鍒板皬杞﹀彿
}
if (item.moveAdvancePath == null) {
@@ -578,7 +580,7 @@
list2[i].moveAdvancePath = [];
}
- if (item.moveAdvancePath.length != list2[i].moveAdvancePath.length) {
+ if (!(item.moveAdvancePath.length == list2[i].moveAdvancePath.length)) {
return false;//灏忚溅棰勮璺緞闀垮害涓嶄竴鑷�
}
}
@@ -845,38 +847,55 @@
})
if (pixiShuttleMoveAdvancePathList[shuttleNo] == null) {
- pixiShuttleMoveAdvancePathList[shuttleNo] = [locNo];
- } else {
- pixiShuttleMoveAdvancePathList[shuttleNo].push(locNo);
+ let locNos = new Set()
+ locNos.add(locNo);
+ pixiShuttleMoveAdvancePathList[shuttleNo] = locNos;
+ }else {
+ pixiShuttleMoveAdvancePathList[shuttleNo].add(locNo);
+ }
+ }else {
+ let pathMap = pixiShuttleMoveAdvancePathMap.get(locNo)
+ let shuttleNos = pathMap.shuttleNos;
+ shuttleNos.push(shuttleNo);
+ pathMap.textObj.text = JSON.stringify(shuttleNos);
+ pixiShuttleMoveAdvancePathMap.set(locNo, pathMap);
+ if (pixiShuttleMoveAdvancePathList[shuttleNo] == null) {
+ let locNos = new Set()
+ locNos.add(locNo);
+ pixiShuttleMoveAdvancePathList[shuttleNo] = locNos;
+ }else {
+ pixiShuttleMoveAdvancePathList[shuttleNo].add(locNo);
}
}
});
},
removeMoveAdvancePath(shuttleNo) {//鍒犻櫎棰勮璺緞
let locNos = pixiShuttleMoveAdvancePathList[shuttleNo];
- locNos.forEach((locNo,index) => {
- let pathMap = pixiShuttleMoveAdvancePathMap.get(locNo);
- if (pathMap != null) {
- let shuttleNos = pathMap.shuttleNos;
- let shuttleNosNew = [];
- shuttleNos.forEach((shuttle, idx) => {
- if (shuttle != shuttleNo) {
- shuttleNosNew.push(shuttle);
- }
- });
+ if (locNos != null) {
+ locNos.forEach((locNo,index) => {
+ let pathMap = pixiShuttleMoveAdvancePathMap.get(locNo);
+ if (pathMap != null) {
+ let shuttleNos = pathMap.shuttleNos;
+ let shuttleNosNew = [];
+ shuttleNos.forEach((shuttle, idx) => {
+ if (shuttle != shuttleNo) {
+ shuttleNosNew.push(shuttle);
+ }
+ });
- if (shuttleNosNew.length === 0) {
- //棰勮璺緞娌℃湁灏忚溅锛岀洿鎺ュ垹闄よ矾寰�
- objectsContainer2.removeChild(pathMap.sprite);
- pixiShuttleMoveAdvancePathMap.delete(locNo)
- }else {
- //棰勮璺緞瀛樺湪鍏朵粬灏忚溅锛屾洿鏂版枃瀛椾俊鎭�
- pathMap.textObj.text = JSON.stringify(shuttleNosNew);
- pathMap.shuttleNos = shuttleNosNew;
- pixiShuttleMoveAdvancePathMap.set(locNo, pathMap);
+ if (shuttleNosNew.length === 0) {
+ //棰勮璺緞娌℃湁灏忚溅锛岀洿鎺ュ垹闄よ矾寰�
+ objectsContainer2.removeChild(pathMap.sprite);
+ pixiShuttleMoveAdvancePathMap.delete(locNo)
+ }else {
+ //棰勮璺緞瀛樺湪鍏朵粬灏忚溅锛屾洿鏂版枃瀛椾俊鎭�
+ pathMap.textObj.text = JSON.stringify(shuttleNosNew);
+ pathMap.shuttleNos = shuttleNosNew;
+ pixiShuttleMoveAdvancePathMap.set(locNo, pathMap);
+ }
}
- }
- })
+ })
+ }
},
}
})
--
Gitblit v1.9.1