From 4bd338d1b8a81061c279ba718db5fa0420272a97 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@63.com> Date: 星期二, 05 七月 2022 14:05:37 +0800 Subject: [PATCH] # --- static/js/object/StaTask.js | 6 ++++-- static/js/object/StoreGoods.js | 40 ++++++++++++++++++++++++++++------------ 2 files changed, 32 insertions(+), 14 deletions(-) diff --git a/static/js/object/StaTask.js b/static/js/object/StaTask.js index 9367156..4c72efc 100644 --- a/static/js/object/StaTask.js +++ b/static/js/object/StaTask.js @@ -7,6 +7,7 @@ that.object = object; that.no = 0; + that.objectType = null; that.isDel = false; that.readyIn = false; that.run = false; @@ -25,6 +26,7 @@ let item = getArrVal(conveyObjects.objects, "no", that.no+""); if (!that.position && item) { + that.objectType = item.objectType; that.position = item.position; } if (!item) { @@ -47,8 +49,8 @@ that.object.removeObject(that.wrkNo + "-Goods"); } - InitPallet(that.object, [{wrkNo: staData.wrkNo}], {position: that.position}, 2); - InitGoods(that.object, [{wrkNo: staData.wrkNo}], {position: that.position}, 2); + InitPallet(that.object, [{wrkNo: staData.wrkNo}], {position: that.position, objectType: that.objectType}, 2); + InitGoods(that.object, [{wrkNo: staData.wrkNo}], {position: that.position, objectType: that.objectType}, 2); } } diff --git a/static/js/object/StoreGoods.js b/static/js/object/StoreGoods.js index 05b3394..cd62075 100644 --- a/static/js/object/StoreGoods.js +++ b/static/js/object/StoreGoods.js @@ -63,13 +63,21 @@ clone.name = item.loc_no + "-" + "Pallet"; break; case 2: - positionX = ref.position.x || 0; - positionY = ref.position.y || 0; - positionZ = ref.position.z || 0; + switch (ref.objectType) { + case 'chain': + positionX = ref.position.x || 0; + positionY = ref.position.y || 0; + positionZ = ref.position.z || 0; - positionX -= 48 - 1; - positionY += 20; - positionZ -= 138 + 20; + positionX -= 48 - 1; + positionY += 20; + positionZ -= 138 + 20; + break + case 'roller': + break + default: + break + } clone.name = item.wrkNo + "-" + "Pallet"; break; @@ -114,13 +122,21 @@ clone.name = item.loc_no + "-" + "Goods"; break; case 2: - positionX = ref.position.x || 0; - positionY = ref.position.y || 0; - positionZ = ref.position.z || 0; + switch (ref.objectType) { + case 'chain': + positionX = ref.position.x || 0; + positionY = ref.position.y || 0; + positionZ = ref.position.z || 0; - positionX -= 48 - 1; - positionY += 20; - positionZ -= 138 + 20; + positionX -= 48 - 1; + positionY += 20; + positionZ -= 138 + 20; + break + case 'roller': + break + default: + break + } clone.name = item.wrkNo + "-" + "Goods"; break; -- Gitblit v1.9.1