From ab0db76dc627a63699380dc65e2773c47d12f449 Mon Sep 17 00:00:00 2001
From: qlsxk <qlsxk@qq.com>
Date: 星期二, 14 十月 2025 15:22:59 +0800
Subject: [PATCH] #
---
src/main/webapp/views/console4.html | 315 +++++++++++++++++++++++++---------------------------
1 files changed, 152 insertions(+), 163 deletions(-)
diff --git a/src/main/webapp/views/console4.html b/src/main/webapp/views/console4.html
index ada2d4e..dabc9ac 100644
--- a/src/main/webapp/views/console4.html
+++ b/src/main/webapp/views/console4.html
@@ -43,12 +43,6 @@
<div class="floorBtnBox" v-for="(lev,idx) in floorList">
<el-button :style="{background:currentLev === lev ? '#7DCDFF':''}" @click="changeFloor(lev)">{{lev}}F</el-button>
</div>
- <div>
- <el-button @click="testMove()">娴嬭瘯绉诲姩杞�</el-button>
- </div>
- <div style="margin-top: 10px;">
- <el-button @click="resetMap()">閲嶇疆鍦板浘</el-button>
- </div>
</el-drawer>
<el-drawer
@@ -63,6 +57,8 @@
<div style="margin-top: 5px;">Y锛歿{drawerLocNoData.y}}</div>
<div style="margin-top: 5px;">Z锛歿{drawerLocNoData.z}}</div>
<div style="margin-top: 5px;">搴撲綅鍙凤細{{drawerLocNoData.locNo}}</div>
+ <div style="margin-top: 5px;">棰勮璺緞杞﹁締锛歿{drawerLocNoData.moveAdvancePath}}</div>
+ <div style="margin-top: 5px;">璺緞閿佸畾杞﹁締锛歿{drawerLocNoData.lockPathShuttleNo}}</div>
</div>
</div>
</el-drawer>
@@ -130,10 +126,12 @@
let pixiStageList = [];
let pixiShuttleMap = new Map();
let pixiShuttleMoveAdvancePathMap = new Map();
- let pixiShuttleMoveAdvancePathList = [];
+ let pixiShuttleLockPathMap = new Map();
let pixiStaMap = new Map();
+ let lockPathInfoMap = new Map();
let objectsContainer;
let objectsContainer2;
+ let objectsContainer3;
let graphics0;
let graphics3;
let graphics4;
@@ -148,7 +146,7 @@
data: {
map: [],
currentLev: 1,
- floorList: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], //褰撳墠椤圭洰妤煎眰
+ floorList: [], //褰撳墠椤圭洰妤煎眰
currentLevShuttleList: [],//褰撳墠妤煎眰鍥涘悜绌挎杞﹂泦鍚�
shuttleColorList: [],//鍥涘悜绌挎杞﹂鑹查泦鍚�
drawer: false,
@@ -182,7 +180,7 @@
deep: true,
handler(val) {
if (!val) {
- var sprite = pixiStageList[this.drawerLocNoData.x][this.drawerLocNoData.y];
+ var sprite = pixiStageList[this.drawerLocNoData.x - 1][this.drawerLocNoData.y];
updateColor(sprite, 0xFFFFFF);//鎭㈠棰滆壊
}
}
@@ -197,14 +195,16 @@
ws.onclose = this.webSocketClose
this.getMap(this.currentLev)
+ this.initLev()//鍒濆鍖栨ゼ灞備俊鎭�
// this.getSystemRunningStatus() //鑾峰彇绯荤粺杩愯鐘舵��
this.consoleInterval = setInterval(() => {
+ this.getMap(this.currentLev) //鑾峰彇瀹炴椂鍦板浘鏁版嵁
this.getShuttleStateInfo() //鑾峰彇鍥涘悜绌挎杞︿俊鎭�
this.getLiftStateInfo() //鑾峰彇鎻愬崌鏈轰俊鎭�
this.getSiteInfo() //鑾峰彇杈撻�佺珯鐐规暟鎹�
- this.getMap(this.currentLev) //鑾峰彇瀹炴椂鍦板浘鏁版嵁
- // this.getCodeData()//鑾峰彇鏉$爜
+ this.getMoveAdvancePath(this.currentLev)
+ this.getLockPath(this.currentLev)
}, 1000)
},
@@ -249,8 +249,8 @@
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.x = (item.point.y - 0) * width;//鏇存柊鍧愭爣x
+ shuttle.y = (item.point.x - 1) * height;//鏇存柊鍧愭爣y
shuttle.updateMoveStatus = true;//鍔ㄧ敾鎵ц瀹屾垚
shuttle.interactive = true; // 蹇呴』瑕佽缃墠鑳芥帴鏀朵簨浠�
shuttle.buttonMode = true; // 璁╁厜鏍囧湪hover鏃跺彉涓烘墜鍨嬫寚閽�
@@ -262,28 +262,12 @@
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;
}
@@ -310,6 +294,14 @@
this.reloadMap = true
this.reloadSta = true
this.getMap(lev)
+
+ //娓呯┖鍗犵敤璺緞
+ objectsContainer3.removeChildren();
+ pixiShuttleLockPathMap = new Map();
+
+ //娓呯┖棰勮璺緞
+ objectsContainer2.removeChildren();
+ pixiShuttleMoveAdvancePathMap = new Map();
},
createMap(){
//Create a Pixi Application
@@ -341,6 +333,10 @@
// 鍒涘缓涓�涓鍣ㄦ潵绠$悊澶ф壒閲忕殑鏄剧ず瀵硅薄
objectsContainer2 = new PIXI.Container();
pixiApp.stage.addChild(objectsContainer2);
+
+ // 鍒涘缓涓�涓鍣ㄦ潵绠$悊澶ф壒閲忕殑鏄剧ず瀵硅薄
+ objectsContainer3 = new PIXI.Container();
+ pixiApp.stage.addChild(objectsContainer3);
//*******************鎷栧姩鐢诲竷*******************
let stageOriginalPos;
@@ -453,7 +449,7 @@
this.openDrawerLift(val)
}else{
//搴撲綅
- this.rightEvent(index, idx, e);
+ this.rightEvent(index + 1, idx, e);
updateColor(sprite, 0x9900ff);
}
});
@@ -488,24 +484,45 @@
pixiStaMap.set(parseInt(val.data), sprite);//绔欑偣鏁版嵁娣诲姞鍒癿ap涓�
}
- objectsContainer.addChild(sprite);
+ if (val.value == -999) {
+ pixiShuttleLockPathMap.set(this.getLocNoByXYZ(val.row, val.bay, this.currentLev), sprite);
+ objectsContainer3.addChild(sprite);
+ }else {
+ objectsContainer.addChild(sprite);
+ }
pixiStageList[index][idx] = sprite
}
});
+
+ //瑙嗚灞呬腑
+ let containerWidth = (pixiApp.view.width - objectsContainer.width) / 2;
+ let containerHeight = (pixiApp.view.height - objectsContainer.height) / 2;
+ pixiApp.stage.position.set(containerWidth, containerHeight);
}else {
let diff = this.findDiffList(this.map, map);
diff.forEach((item, index) => {
//鑾峰彇old鍏冪礌
let oldSprite = pixiStageList[item.x][item.y]
- //绉婚櫎old鍏冪礌
- objectsContainer.removeChild(oldSprite)
+ if (item.originData == -999) {
+ //绉婚櫎old璺緞鍏冪礌
+ objectsContainer3.removeChild(oldSprite);
+ }else {
+ //绉婚櫎old鍏冪礌
+ objectsContainer.removeChild(oldSprite);
+ }
let sprite = getSprite(item.data, item.y * width, item.x * height, (e) => {
- this.rightEvent(item.x, item.y, e);
+ this.rightEvent(item.x + 1, item.y, e);
updateColor(sprite, 0x9900ff);
});
- objectsContainer.addChild(sprite);
+ if (item.data == -999) {
+ //娣诲姞璺緞鍏冪礌
+ objectsContainer3.addChild(sprite);
+ }else {
+ //娣诲姞鍏冪礌
+ objectsContainer.addChild(sprite);
+ }
//淇濆瓨鏂板厓绱�
pixiStageList[item.x][item.y] = sprite
@@ -514,11 +531,32 @@
this.map = map;
},
- rightEvent(x, y, e) {
- this.drawerLocNo = true
- let locNo = this.getLocNoByXYZ(x, y, this.currentLev);
- this.drawerLocNoData = {x:x, y: y, z: this.currentLev, locNo: locNo};
- },
+ rightEvent(x, y, e) {
+ this.drawerLocNo = true
+ let locNo = this.getLocNoByXYZ(x, y, this.currentLev);
+ let tmpData = {
+ x: x,
+ y: y,
+ z: this.currentLev,
+ locNo: locNo
+ };
+
+ let moveAdvancePath = pixiShuttleMoveAdvancePathMap.get(locNo)
+ if (moveAdvancePath == null || moveAdvancePath == undefined) {
+ moveAdvancePath = "";
+ }else {
+ moveAdvancePath = JSON.stringify(moveAdvancePath.shuttleNos);
+ }
+ tmpData.moveAdvancePath = moveAdvancePath;
+
+ let lockPathShuttleNo = lockPathInfoMap.get(locNo)
+ if (lockPathShuttleNo == null || lockPathShuttleNo == undefined) {
+ lockPathShuttleNo = "";
+ }
+ tmpData.lockPathShuttleNo = lockPathShuttleNo;
+
+ this.drawerLocNoData = tmpData;
+ },
findDiffList(arr1, arr2) {
let diff = []
arr1.forEach((item,index) => {
@@ -527,7 +565,8 @@
diff.push({
x: index,
y: idx,
- data: arr2[index][idx].value
+ data: arr2[index][idx].value,
+ originData: val.value
})
}
})
@@ -555,37 +594,6 @@
});
return flag;
- },
- findShuttlePathDiffList(list1, list2) {
- //妫�娴嬮泦鍚�1閲岄潰鐨勫皬杞﹂璁¤矾寰勬槸鍚﹀湪闆嗗悎2涓湁鍙樺姩
- if (list1.length == 0) {
- return false;//闆嗗悎涓虹┖
- }
- if (list1.length != list2.length) {
- return false;//涓や釜闆嗗悎闀垮害涓嶄竴鑷�
- }
-
- for (var index = 0; index < list1.length; index++) {
- let item = list1[index];
- for (var i = 0; i < list2.length; i++) {
- if (item.shuttleNo != list2[i].shuttleNo) {
- continue;//鎵句笉鍒板皬杞﹀彿
- }
-
- if (item.moveAdvancePath == null) {
- item.moveAdvancePath = [];
- }
-
- if (list2[i].moveAdvancePath == null) {
- list2[i].moveAdvancePath = [];
- }
-
- if (!(item.moveAdvancePath.length == list2[i].moveAdvancePath.length)) {
- return false;//灏忚溅棰勮璺緞闀垮害涓嶄竴鑷�
- }
- }
- }
- return true;
},
checkStaInListDiff(sta, list) {
//妫�娴嬬珯鐐规槸鍚﹀湪闆嗗悎涓湁鍙樺姩
@@ -631,9 +639,36 @@
this.setSiteInfo(JSON.parse(result.data))
}else if (result.url == "/console/map/auth") {
this.setMap(JSON.parse(result.data))
- }else if (result.url == "/console/barcode/output/site") {
- this.setCodeData(JSON.parse(result.data))
+ }else if (result.url == "/console/getMoveAdvancePath/auth") {
+ this.setMoveAdvancePath(JSON.parse(result.data))
+ }else if (result.url == "/console/getLockPath/auth") {
+ this.setLockPath(JSON.parse(result.data))
}
+ },
+ getMoveAdvancePath(lev) {
+ this.sendWs(JSON.stringify({
+ "url": "/console/getMoveAdvancePath/auth",
+ "data": lev
+ }))
+ },
+ setMoveAdvancePath(res) {
+ let data = res.data;
+ this.addMoveAdvancePath(data)
+ },
+ getLockPath(lev) {
+ this.sendWs(JSON.stringify({
+ "url": "/console/getLockPath/auth",
+ "data": lev
+ }))
+ },
+ setLockPath(res) {
+ let data = res.data;
+ let tmpMap = new Map();
+ data.forEach((item) => {
+ let locNo = this.getLocNoByXYZ(item.x,item.y,item.z)
+ tmpMap.set(locNo, item.shuttleNo);
+ })
+ lockPathInfoMap = tmpMap;
},
webSocketClose(e) {
console.log("close");
@@ -655,11 +690,11 @@
if (shuttle.updateMoveStatus) {//鍔ㄧ敾鎵ц瀹屾垚鎵嶅彲缁х画鎵ц鍔ㄧ敾
shuttle.updateMoveStatus = false;//鍔ㄧ敾鎵ц涓�
// 璁$畻涓ょ偣涔嬮棿鐨勮窛绂�1
- const distance = Math.sqrt(Math.pow((item.wcsPoint.x * width) - shuttle.x, 2) + Math.pow((item.wcsPoint.y * height) - shuttle.y, 2));
+ const distance = Math.sqrt(Math.pow((item.point.x * width) - shuttle.x, 2) + Math.pow((item.point.y * height) - shuttle.y, 2));
gsap.killTweensOf(shuttle); // 鏉�姝绘墍鏈夐拡瀵�".class"鐨勫姩鐢�
gsap.to(shuttle, {
- x: (item.wcsPoint.y - 0) * width, // 鐩爣浣嶇疆
- y: (item.wcsPoint.x - 1) * height, // 鐩爣浣嶇疆
+ x: (item.point.y - 0) * width, // 鐩爣浣嶇疆
+ y: (item.point.x - 1) * height, // 鐩爣浣嶇疆
duration: 0.2, // 鍔ㄧ敾鎸佺画鏃堕棿锛堢锛�
ease: "power1.inOut", // 缂撳姩绫诲瀷
onComplete: () => {
@@ -676,10 +711,8 @@
}))
},
setSiteInfo(res) {
-
- var test = "{\"msg\":\"鎿嶄綔鎴愬姛\",\"code\":200,\"data\":[{\"siteId\":\"300\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"301\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"302\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"303\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"304\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"305\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"306\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"307\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"308\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"309\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"310\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"311\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"312\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"313\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"314\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"315\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"316\",\"siteStatus\":\"site-auto-run\",\"workNo\":0},{\"siteId\":\"317\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"318\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"319\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"320\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"321\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"322\",\"siteStatus\":\"site-auto-run\",\"workNo\":0},{\"siteId\":\"323\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"324\",\"siteStatus\":\"site-auto-run\",\"workNo\":0},{\"siteId\":\"325\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"326\",\"siteStatus\":\"site-auto-id\",\"workNo\":5451},{\"siteId\":\"327\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"200\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"328\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"201\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"329\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"202\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"330\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"203\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"331\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"204\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"332\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"205\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"333\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"334\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"335\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"336\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"337\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"338\",\"siteStatus\":\"site-auto-run\",\"workNo\":0},{\"siteId\":\"339\",\"siteStatus\":\"site-auto-run-id\",\"workNo\":5447},{\"siteId\":\"340\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"341\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"342\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"343\",\"siteStatus\":\"site-auto-run\",\"workNo\":0},{\"siteId\":\"344\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"345\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"346\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"100\",\"siteStatus\":\"site-auto-run-id\",\"workNo\":8851},{\"siteId\":\"101\",\"siteStatus\":\"site-auto-run-id\",\"workNo\":8855},{\"siteId\":\"102\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"103\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"104\",\"siteStatus\":\"site-auto-run\",\"workNo\":0},{\"siteId\":\"105\",\"siteStatus\":\"site-auto\",\"workNo\":0}]}";
- res = JSON.parse(test)
-
+ // var test = "{\"msg\":\"鎿嶄綔鎴愬姛\",\"code\":200,\"data\":[{\"siteId\":\"300\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"301\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"302\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"303\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"304\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"305\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"306\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"307\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"308\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"309\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"310\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"311\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"312\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"313\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"314\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"315\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"316\",\"siteStatus\":\"site-auto-run\",\"workNo\":0},{\"siteId\":\"317\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"318\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"319\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"320\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"321\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"322\",\"siteStatus\":\"site-auto-run\",\"workNo\":0},{\"siteId\":\"323\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"324\",\"siteStatus\":\"site-auto-run\",\"workNo\":0},{\"siteId\":\"325\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"326\",\"siteStatus\":\"site-auto-id\",\"workNo\":5451},{\"siteId\":\"327\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"200\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"328\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"201\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"329\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"202\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"330\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"203\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"331\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"204\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"332\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"205\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"333\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"334\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"335\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"336\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"337\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"338\",\"siteStatus\":\"site-auto-run\",\"workNo\":0},{\"siteId\":\"339\",\"siteStatus\":\"site-auto-run-id\",\"workNo\":5447},{\"siteId\":\"340\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"341\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"342\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"343\",\"siteStatus\":\"site-auto-run\",\"workNo\":0},{\"siteId\":\"344\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"345\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"346\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"100\",\"siteStatus\":\"site-auto-run-id\",\"workNo\":8851},{\"siteId\":\"101\",\"siteStatus\":\"site-auto-run-id\",\"workNo\":8855},{\"siteId\":\"102\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"103\",\"siteStatus\":\"site-auto\",\"workNo\":0},{\"siteId\":\"104\",\"siteStatus\":\"site-auto-run\",\"workNo\":0},{\"siteId\":\"105\",\"siteStatus\":\"site-auto\",\"workNo\":0}]}";
+ // res = JSON.parse(test)
//鑾峰彇杈撻�佺珯鐐规暟鎹�
if (res.code === 200){
var sites = res.data;
@@ -701,7 +734,7 @@
objectsContainer.removeChild(sta.statusObj)
sta.statusObj = null;
}
- }else if (item.siteStatus == "site-auto-run") {
+ }else if (item.siteStatus == "site-auto-run" || item.siteStatus == "site-auto-run-id") {
//鑷姩鏈夌墿
let graphics = getGraphics(0xfa51f6, width, height, sta.x, sta.y);
graphics.addChild(sta.textObj);//缁ф壙鏂囧瓧淇℃伅
@@ -797,40 +830,23 @@
}
},
getLocNoByXYZ(x, y, z) {
- let locNo = "";
- if (x < 10) {
- locNo += "0" + x;
- }else {
- locNo += x;
- }
-
- if (y < 100) {
- locNo += "0" + y;
- }else if (y < 10) {
- locNo += "00" + y;
- }else {
- locNo += y;
- }
-
- if (z < 10) {
- locNo += "0" + z;
- }else {
- locNo += z;
- }
- return locNo;
+ let locNo = x + "-" + y + "-" + z;
+ return locNo;
},
- addMoveAdvancePath(moveAdvancePath, shuttleNo) {//娣诲姞棰勮璺緞
- let that = this;
+ addMoveAdvancePath(moveAdvancePath) {//娣诲姞棰勮璺緞
+ //娓呯┖棰勮璺緞
+ objectsContainer2.removeChildren();
+ pixiShuttleMoveAdvancePathMap = new Map();
moveAdvancePath.forEach((path, idx) => {
- let locNo = that.getLocNoByXYZ(path.x, path.y, path.z);
- if (!pixiShuttleMoveAdvancePathMap.has(locNo)) {
+ let locNo = this.getLocNoByXYZ(path.x, path.y, path.z);
+ let shuttleNos = path.shuttleNoList;
let graphics = getGraphics(0x9966ff, width, height, path.y * width, (path.x - 1) * height);
- let shuttleNos = [shuttleNo];
+
// 鍒涘缓鏂囨湰瀵硅薄
const style = new PIXI.TextStyle({
- fontFamily: 'Arial',
- fontSize: 10,
- fill: '#000000',
+ fontFamily: 'Arial',
+ fontSize: 10,
+ fill: '#000000',
});
const text = new PIXI.Text(JSON.stringify(shuttleNos), style);
text.anchor.set(0.5); // 璁剧疆鏂囨湰閿氱偣涓轰腑蹇冪偣
@@ -840,62 +856,35 @@
graphics.textObj = text;
objectsContainer2.addChild(graphics)
pixiShuttleMoveAdvancePathMap.set(locNo, {
- path: path,
- sprite: graphics,
- textObj: text,
- shuttleNos: shuttleNos
+ path: path,
+ sprite: graphics,
+ textObj: text,
+ shuttleNos: shuttleNos
})
-
- if (pixiShuttleMoveAdvancePathList[shuttleNo] == null) {
- 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];
- 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);
+ initLev(){
+ let that = this
+ $.ajax({
+ url: baseUrl + "/console/map/lev/list",
+ headers: {
+ 'token': localStorage.getItem('token')
+ },
+ data: {},
+ method: 'get',
+ success: function(res) {
+ if (res.code === 200) {
+ that.floorList = res.data;
+ } else if (res.code === 403) {
+ parent.location.href = baseUrl + "/login";
+ } else {
+ that.$message({
+ message: res.msg,
+ type: 'error'
+ });
+ }
}
- });
-
- 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