luxiaotao1123
2022-07-08 7923c73fd7910957114024c76b356c378fc0e60e
Merge branches 'local' and 'master' of http://47.97.1.152:5880/r/ASRS-3D into local
2个文件已添加
8个文件已修改
656 ■■■■ 已修改文件
static/js/app.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/js/data/BuildingData.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/js/data/ConveyData.js 199 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/js/object/CrnTask.js 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/js/object/ObjectSelect.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/js/object/StaTask.js 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/js/object/StaTask0.js 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/js/object/StoreGoods.js 52 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/js/object/StoreGoods_Copy.js 182 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/js/object/StoreShelf.js 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/js/app.js
@@ -73,7 +73,6 @@
            this.queryCrn();
            this.crnMove();
            this.querySta();
            this.staChange();
        }
        this.initScene = function () {
            this.scene = new THREE.Scene();
@@ -370,16 +369,11 @@
                    if (null == staTask) {
                        this.staTasks.push(new StaTask(staData, this));
                    } else {
                        if(!staTask.run) {
                        if(!staTask.run && !staTask.isDel) {
                            staTask.modify(staData);
                        }
                    }
                }
            }
        }
        this.staChange = function () {
            for (let staTask of this.staTasks) {
                staTask.change();
            }
        }
static/js/data/BuildingData.js
@@ -29,7 +29,7 @@
            style:{
                color: 0x5F7480,
                transparent:1,
                opacity:0.8
                opacity:0.35
            }
        }
    ]
static/js/data/ConveyData.js
@@ -195,7 +195,7 @@
        },
        // 链条输送机 1F 第2列 --------------------------------------------------------------------------------------------
        {
            no: '1',
            no: '172',
            objectType: 'chain',
            position: {
                x: 48 + 57,
@@ -203,7 +203,7 @@
            }
        },
        {
            no: '1',
            no: '170',
            objectType: 'chain',
            position: {
                x: 48 + 146,
@@ -211,7 +211,7 @@
            }
        },
        {
            no: '1',
            no: '168',
            objectType: 'chain',
            position: {
                x: 48 + 287,
@@ -219,7 +219,7 @@
            }
        },
        {
            no: '1',
            no: '166',
            objectType: 'chain',
            position: {
                x: 48 + 376,
@@ -227,7 +227,7 @@
            }
        },
        {
            no: '1',
            no: '164',
            objectType: 'chain',
            position: {
                x: 48 + 517,
@@ -235,7 +235,7 @@
            }
        },
        {
            no: '1',
            no: '162',
            objectType: 'chain',
            position: {
                x: 48 + 606,
@@ -243,7 +243,7 @@
            }
        },
        {
            no: '1',
            no: '160',
            objectType: 'chain',
            position: {
                x: 48 + 747,
@@ -251,7 +251,7 @@
            }
        },
        {
            no: '1',
            no: '158',
            objectType: 'chain',
            position: {
                x: 48 + 836,
@@ -259,7 +259,7 @@
            }
        },
        {
            no: '1',
            no: '155',
            objectType: 'chain',
            position: {
                x: 48 + 977,
@@ -267,7 +267,7 @@
            }
        },
        {
            no: '1',
            no: '153',
            objectType: 'chain',
            position: {
                x: 48 + 1066,
@@ -275,7 +275,7 @@
            }
        },
        {
            no: '1',
            no: '151',
            objectType: 'chain',
            position: {
                x: 48 + 1207,
@@ -283,7 +283,7 @@
            }
        },
        {
            no: '1',
            no: '149',
            objectType: 'chain',
            position: {
                x: 48 + 1296,
@@ -291,7 +291,7 @@
            }
        },
        {
            no: '1',
            no: '147',
            objectType: 'chain',
            position: {
                x: 48 + 1437,
@@ -299,7 +299,7 @@
            }
        },
        {
            no: '1',
            no: '145',
            objectType: 'chain',
            position: {
                x: 48 + 1526,
@@ -307,7 +307,7 @@
            }
        },
        {
            no: '1',
            no: '143',
            objectType: 'chain',
            position: {
                x: 48 + 1667,
@@ -315,7 +315,7 @@
            }
        },
        {
            no: '1',
            no: '141',
            objectType: 'chain',
            position: {
                x: 48 + 1756,
@@ -323,7 +323,7 @@
            }
        },
        {
            no: '1',
            no: '138',
            objectType: 'chain',
            position: {
                x: 48 + 1897,
@@ -331,7 +331,7 @@
            }
        },
        {
            no: '1',
            no: '136',
            objectType: 'chain',
            position: {
                x: 48 + 1986,
@@ -339,7 +339,7 @@
            }
        },
        {
            no: '1',
            no: '134',
            objectType: 'chain',
            position: {
                x: 48 + 2127,
@@ -347,7 +347,7 @@
            }
        },
        {
            no: '1',
            no: '132',
            objectType: 'chain',
            position: {
                x: 48 + 2216,
@@ -355,7 +355,7 @@
            }
        },
        {
            no: '1',
            no: '130',
            objectType: 'chain',
            position: {
                x: 48 + 2357,
@@ -363,7 +363,7 @@
            }
        },
        {
            no: '1',
            no: '128',
            objectType: 'chain',
            position: {
                x: 48 + 2446,
@@ -371,7 +371,7 @@
            }
        },
        {
            no: '1',
            no: '126',
            objectType: 'chain',
            position: {
                x: 48 + 2587,
@@ -379,7 +379,7 @@
            }
        },
        {
            no: '1',
            no: '124',
            objectType: 'chain',
            position: {
                x: 48 + 2676,
@@ -388,7 +388,7 @@
        },
        // 链条输送机 1F 第3列 --------------------------------------------------------------------------------------------
        {
            no: '1',
            no: '174',
            objectType: 'chain',
            position: {
                x: 48 + 146,
@@ -396,7 +396,7 @@
            }
        },
        {
            no: '1',
            no: '177',
            objectType: 'chain',
            position: {
                x: 48 + 287,
@@ -404,7 +404,7 @@
            }
        },
        {
            no: '1',
            no: '181',
            objectType: 'chain',
            position: {
                x: 48 + 517,
@@ -412,7 +412,7 @@
            }
        },
        {
            no: '1',
            no: '186',
            objectType: 'chain',
            position: {
                x: 48 + 836,
@@ -420,7 +420,7 @@
            }
        },
        {
            no: '1',
            no: '190',
            objectType: 'chain',
            position: {
                x: 48 + 977,
@@ -428,7 +428,7 @@
            }
        },
        {
            no: '1',
            no: '195',
            objectType: 'chain',
            position: {
                x: 48 + 1296,
@@ -436,7 +436,7 @@
            }
        },
        {
            no: '1',
            no: '199',
            objectType: 'chain',
            position: {
                x: 48 + 1526,
@@ -444,7 +444,7 @@
            }
        },
        {
            no: '1',
            no: '203',
            objectType: 'chain',
            position: {
                x: 48 + 1756,
@@ -452,7 +452,7 @@
            }
        },
        {
            no: '1',
            no: '207',
            objectType: 'chain',
            position: {
                x: 48 + 1897,
@@ -460,7 +460,7 @@
            }
        },
        {
            no: '1',
            no: '212',
            objectType: 'chain',
            position: {
                x: 48 + 2127,
@@ -468,7 +468,7 @@
            }
        },
        {
            no: '1',
            no: '216',
            objectType: 'chain',
            position: {
                x: 48 + 2216,
@@ -476,7 +476,7 @@
            }
        },
        {
            no: '1',
            no: '220',
            objectType: 'chain',
            position: {
                x: 48 + 2357,
@@ -484,7 +484,7 @@
            }
        },
        {
            no: '1',
            no: '224',
            objectType: 'chain',
            position: {
                x: 48 + 2446,
@@ -492,7 +492,7 @@
            }
        },
        {
            no: '1',
            no: '227',
            objectType: 'chain',
            position: {
                x: 48 + 2587,
@@ -501,7 +501,7 @@
        },
        // 链条输送机 2F 第1列 --------------------------------------------------------------------------------------------
        {
            no: '1',
            no: '321',
            objectType: 'chain',
            position: {
                x: 48 + 146,
@@ -510,7 +510,7 @@
            }
        },
        {
            no: '1',
            no: '320',
            objectType: 'chain',
            position: {
                x: 48 + 287,
@@ -520,7 +520,7 @@
        },
        {
            no: '1',
            no: '319',
            objectType: 'chain',
            position: {
                x: 48 + 606,
@@ -529,7 +529,7 @@
            }
        },
        {
            no: '1',
            no: '318',
            objectType: 'chain',
            position: {
                x: 48 + 747,
@@ -539,7 +539,7 @@
        },
        {
            no: '1',
            no: '317',
            objectType: 'chain',
            position: {
                x: 48 + 1066,
@@ -548,7 +548,7 @@
            }
        },
        {
            no: '1',
            no: '316',
            objectType: 'chain',
            position: {
                x: 48 + 1207,
@@ -558,7 +558,7 @@
        },
        {
            no: '1',
            no: '315',
            objectType: 'chain',
            position: {
                x: 48 + 1526,
@@ -567,7 +567,7 @@
            }
        },
        {
            no: '1',
            no: '314',
            objectType: 'chain',
            position: {
                x: 48 + 1667,
@@ -576,7 +576,7 @@
            }
        },
        {
            no: '1',
            no: '313',
            objectType: 'chain',
            position: {
                x: 48 + 1897,
@@ -585,7 +585,7 @@
            }
        },
        {
            no: '1',
            no: '312',
            objectType: 'chain',
            position: {
                x: 48 + 1986,
@@ -594,7 +594,7 @@
            }
        },
        {
            no: '1',
            no: '311',
            objectType: 'chain',
            position: {
                x: 48 + 2127,
@@ -603,7 +603,7 @@
            }
        },
        {
            no: '1',
            no: '310',
            objectType: 'chain',
            position: {
                x: 48 + 2216,
@@ -612,7 +612,7 @@
            }
        },
        {
            no: '1',
            no: '309',
            objectType: 'chain',
            position: {
                x: 48 + 2357,
@@ -621,7 +621,7 @@
            }
        },
        {
            no: '1',
            no: '308',
            objectType: 'chain',
            position: {
                x: 48 + 2446,
@@ -630,7 +630,7 @@
            }
        },
        {
            no: '1',
            no: '307',
            objectType: 'chain',
            position: {
                x: 48 + 2587,
@@ -639,7 +639,7 @@
            }
        },
        {
            no: '1',
            no: '306',
            objectType: 'chain',
            position: {
                x: 48 + 2676,
@@ -649,7 +649,7 @@
        },
        // 滚筒输送机 1F 第1列 --------------------------------------------------------------------------------------------
        {
            no: '1',
            no: '171',
            objectType: 'roller',
            position: {
                x: -2 + 100,
@@ -662,7 +662,7 @@
            }
        },
        {
            no: '1',
            no: '169',
            objectType: 'roller',
            position: {
                x: -2 + 213,
@@ -675,7 +675,7 @@
            }
        },
        {
            no: '1',
            no: '167',
            objectType: 'roller',
            position: {
                x: -2 + 330,
@@ -688,7 +688,7 @@
            }
        },
        {
            no: '1',
            no: '165',
            objectType: 'roller',
            position: {
                x: -2 + 442,
@@ -702,7 +702,7 @@
        },
        {
            no: '1',
            no: '163',
            objectType: 'roller',
            position: {
                x: -2 + 560,
@@ -715,7 +715,7 @@
            }
        },
        {
            no: '1',
            no: '161',
            objectType: 'roller',
            position: {
                x: -2 + 673,
@@ -728,7 +728,7 @@
            }
        },
        {
            no: '1',
            no: '159',
            objectType: 'roller',
            position: {
                x: -2 + 790,
@@ -740,8 +740,9 @@
                }
            }
        },
        // 157
        {
            no: '1',
            no: '156',
            objectType: 'roller',
            position: {
                x: -2 + 902,
@@ -754,8 +755,9 @@
            }
        },
        {
            no: '1',
            no: '154',
            objectType: 'roller',
            position: {
                x: -2 + 1020,
@@ -768,7 +770,7 @@
            }
        },
        {
            no: '1',
            no: '152',
            objectType: 'roller',
            position: {
                x: -2 + 1133,
@@ -781,7 +783,7 @@
            }
        },
        {
            no: '1',
            no: '150',
            objectType: 'roller',
            position: {
                x: -2 + 1250,
@@ -794,7 +796,7 @@
            }
        },
        {
            no: '1',
            no: '148',
            objectType: 'roller',
            position: {
                x: -2 + 1362,
@@ -808,7 +810,7 @@
        },
        {
            no: '1',
            no: '146',
            objectType: 'roller',
            position: {
                x: -2 + 1480,
@@ -821,7 +823,7 @@
            }
        },
        {
            no: '1',
            no: '144',
            objectType: 'roller',
            position: {
                x: -2 + 1593,
@@ -834,7 +836,7 @@
            }
        },
        {
            no: '1',
            no: '142',
            objectType: 'roller',
            position: {
                x: -2 + 1710,
@@ -846,8 +848,9 @@
                }
            }
        },
        // 140
        {
            no: '1',
            no: '139',
            objectType: 'roller',
            position: {
                x: -2 + 1822,
@@ -861,7 +864,7 @@
        },
        {
            no: '1',
            no: '137',
            objectType: 'roller',
            position: {
                x: -2 + 1940,
@@ -874,7 +877,7 @@
            }
        },
        {
            no: '1',
            no: '135',
            objectType: 'roller',
            position: {
                x: -2 + 2053,
@@ -887,7 +890,7 @@
            }
        },
        {
            no: '1',
            no: '133',
            objectType: 'roller',
            position: {
                x: -2 + 2170,
@@ -900,7 +903,7 @@
            }
        },
        {
            no: '1',
            no: '131',
            objectType: 'roller',
            position: {
                x: -2 + 2282,
@@ -914,7 +917,7 @@
        },
        {
            no: '1',
            no: '129',
            objectType: 'roller',
            position: {
                x: -2 + 2400,
@@ -927,7 +930,7 @@
            }
        },
        {
            no: '1',
            no: '127',
            objectType: 'roller',
            position: {
                x: -2 + 2513,
@@ -940,7 +943,7 @@
            }
        },
        {
            no: '1',
            no: '125',
            objectType: 'roller',
            position: {
                x: -2 + 2630,
@@ -954,7 +957,7 @@
        },
        // 滚筒输送机 1F 第2列 --------------------------------------------------------------------------------------------
        {
            no: '1',
            no: '175',
            objectType: 'roller',
            position: {
                x: -2 + 212,
@@ -968,7 +971,7 @@
        },
        {
            no: '1',
            no: '178',
            objectType: 'roller',
            position: {
                x: -2 + 349,
@@ -981,7 +984,7 @@
            }
        },
        {
            no: '1',
            no: '179',
            objectType: 'roller',
            position: {
                x: -2 + 450,
@@ -995,7 +998,7 @@
        },
        {
            no: '1',
            no: '182',
            objectType: 'roller',
            position: {
                x: -2 + 598,
@@ -1007,8 +1010,9 @@
                }
            }
        },
        // 183
        {
            no: '1',
            no: '184',
            objectType: 'roller',
            position: {
                x: -2 + 744,
@@ -1022,7 +1026,7 @@
        },
        {
            no: '1',
            no: '187',
            objectType: 'roller',
            position: {
                x: -2 + 903,
@@ -1034,9 +1038,10 @@
                }
            }
        },
        // 188
        {
            no: '1',
            no: '191',
            objectType: 'roller',
            position: {
                x: -2 + 1058,
@@ -1048,8 +1053,9 @@
                }
            }
        },
        // 192
        {
            no: '1',
            no: '193',
            objectType: 'roller',
            position: {
                x: -2 + 1204,
@@ -1063,7 +1069,7 @@
        },
        {
            no: '1',
            no: '196',
            objectType: 'roller',
            position: {
                x: -2 + 1357,
@@ -1076,7 +1082,7 @@
            }
        },
        {
            no: '1',
            no: '197',
            objectType: 'roller',
            position: {
                x: -2 + 1458,
@@ -1090,7 +1096,7 @@
        },
        {
            no: '1',
            no: '200',
            objectType: 'roller',
            position: {
                x: -2 + 1587,
@@ -1103,7 +1109,7 @@
            }
        },
        {
            no: '1',
            no: '201',
            objectType: 'roller',
            position: {
                x: -2 + 1688,
@@ -1117,7 +1123,7 @@
        },
        {
            no: '1',
            no: '204',
            objectType: 'roller',
            position: {
                x: -2 + 1822,
@@ -1129,9 +1135,10 @@
                }
            }
        },
        // 205
        {
            no: '1',
            no: '208',
            objectType: 'roller',
            position: {
                x: -2 + 1958,
@@ -1144,7 +1151,7 @@
            }
        },
        {
            no: '1',
            no: '209',
            objectType: 'roller',
            position: {
                x: -2 + 2059,
@@ -1158,7 +1165,7 @@
        },
        {
            no: '1',
            no: '213',
            objectType: 'roller',
            position: {
                x: -2 + 2170,
@@ -1172,7 +1179,7 @@
        },
        {
            no: '1',
            no: '217',
            objectType: 'roller',
            position: {
                x: -2 + 2282,
@@ -1186,7 +1193,7 @@
        },
        {
            no: '1',
            no: '221',
            objectType: 'roller',
            position: {
                x: -2 + 2400,
@@ -1201,7 +1208,7 @@
        {
            no: '1',
            no: '225',
            objectType: 'roller',
            position: {
                x: -2 + 2512,
static/js/object/CrnTask.js
@@ -11,13 +11,13 @@
const yOffset1 = -116;
const zOffset1 = -475;
const palletX = -18;
const palletY = 2;
const palletZ = -46;
const palletX = -2;
const palletY = 0;
const palletZ = -25;
const goodsX = -17;
const goodsY = 5;
const goodsZ = -6;
const goodsX = -2;
const goodsY = 22;
const goodsZ = -25;
// 堆垛机当前运行状态对象
function CrnTask(crnData, object) {
static/js/object/ObjectSelect.js
@@ -29,7 +29,7 @@
            $("#label").attr("style", "display:none;");
            return;
        }
        console.log(intersects[0].object)
        let objName = intersects[0].object.name;
        if (objName) {
            let dest = objName.split("-")[0];
static/js/object/StaTask.js
@@ -7,6 +7,9 @@
    that.object = object;
    that.no = 0;
    that.objectType = null;
    that.isDel = false;
    that.readyIn = false;
    that.run = false;
    that.loaded = 0;
    that.wrkNo = null;
@@ -23,58 +26,46 @@
        let item = getArrVal(conveyObjects.objects, "no", that.no+"");
        if (!that.position && item) {
            that.objectType = item.objectType;
            that.position = item.position;
        }
        if (!item) {
            that.isDel = true;
        }
    }
    init();
    that.modify = function (staData) {
        if (that.run || that.no === 0) {
            console.error(staData.no + "号输送线更新失败");
        if (that.no === 0) {
            return;
        }
        if (that.loaded === 0 && staData.loaded === 1) {
            // 无货 ===>> 有货
            // 1.入库第一站 【新增】
            if (that.inlet === 1) {
                InitPallet(that.object, [{wrkNo: staData.wrkNo}], {position: that.position}, 2);
                InitGoods(that.object, [{wrkNo: staData.wrkNo}], {position: that.position}, 2);
            // 2.来自其他站点的货物 【移动】
            } else {
            }
        }
        if (that.loaded === 1 && staData.loaded === 0) {
            // 有货 ===>> 无货
            // 1.出库最后一站 【移除】
            if (that.outlet === 1) {
                let pallet = getArrVal(that.object.objects, "name", that.wrkNo + "-Pallet");
                if (pallet != null) {
        // 添加
        if (staData.loaded === 1 && staData.wrkNo && staData.wrkNo !== '0' && that.wrkNo !== staData.wrkNo) {
            if (that.outlet !== 1) {     // 由堆垛机出库,不需要添加model
                if (that.loaded === 1) {
                    console.log("sta_" + that.no + " remove:" + that.wrkNo + "-Pallet; " + that.wrkNo + "-Goods");
                    that.object.removeObject(that.wrkNo + "-Pallet");
                    that.object.removeObject(that.wrkNo + "-Goods");
                }
                let goods = getArrVal(that.object.objects, "name", that.wrkNo + "-Goods");
                if (goods != null) {
                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);
            }
        }
        // 移除
        if (staData.loaded === 0) {
            if (that.loaded === 1 && that.wrkNo && that.wrkNo !== '0') {
                if (that.inlet !== 1) {     // 堆垛机需要搬运,不能直接移除
                    that.object.removeObject(that.wrkNo + "-Pallet");
                    that.object.removeObject(that.wrkNo + "-Goods");
                }
            }
        }
        // 实时更新
        that.loaded = staData.loaded;
        that.wrkNo = staData.wrkNo;
        // that.run = true;
    }
    that.change = function () {
    }
}
static/js/object/StaTask0.js
New file
@@ -0,0 +1,99 @@
import {InitPallet, InitGoods} from './StoreGoods.js';
// 输送线当前运行状态对象
function StaTask(staData, object) {
    let that = this;
    that.object = object;
    that.no = 0;
    that.readyIn = false;
    that.run = false;
    that.loaded = 0;
    that.wrkNo = null;
    that.inlet = -1;
    that.outlet = -1;
    that.position = null;
    let init = function () {
        that.no = staData.no;
        that.inlet = staData.inlet;
        that.outlet = staData.outlet;
        let item = getArrVal(conveyObjects.objects, "no", that.no+"");
        if (!that.position && item) {
            that.position = item.position;
        }
    }
    init();
    that.modify = function (staData) {
        if (that.run || that.no === 0) {
            console.error(staData.no + "号输送线更新失败");
            return;
        }
        // 页面切换导致货物覆盖
        if (that.loaded === 1 && staData.loaded === 1 && staData.wrkNo > 0 && that.wrkNo > 0 && that.wrkNo !== staData.wrkNo) {
            if (that.inlet === 1) {
                // remove
                console.log("sta_" + that.no + " remove:" + that.wrkNo + "-Pallet; " + that.wrkNo + "-Goods");
                that.object.removeObject(that.wrkNo + "-Pallet");
                that.object.removeObject(that.wrkNo + "-Goods");
                // add
                console.log("sta_" + that.no + " add:" + staData.wrkNo + "-Pallet + Goods; [up]");
                InitPallet(that.object, [{wrkNo: staData.wrkNo}], {position: that.position}, 2);
                InitGoods(that.object, [{wrkNo: staData.wrkNo}], {position: that.position}, 2);
            }
            that.readyIn = false;
        }
        if (that.loaded === 0 && staData.loaded === 1) {
            that.readyIn = true;
        }
        if (that.readyIn && staData.wrkNo && staData.wrkNo !== '0') {
            // 无货 ===>> 有货
            // 1.入库第一站 【新增】
            if (that.inlet === 1) {
                console.log("sta_" + that.no + " add:" + staData.wrkNo + "-Pallet + Goods; [down]");
                InitPallet(that.object, [{wrkNo: staData.wrkNo}], {position: that.position}, 2);
                InitGoods(that.object, [{wrkNo: staData.wrkNo}], {position: that.position}, 2);
            // 2.来自其他站点的货物 【移动】
            } else {
            }
            that.readyIn = false;
        }
        if (that.loaded === 1 && staData.loaded === 0) {
            // 有货 ===>> 无货
            // 1.出库最后一站 【移除】
            if (that.outlet === 1) {
                let pallet = getArrVal(that.object.objects, "name", that.wrkNo + "-Pallet");
                if (pallet != null) {
                    that.object.removeObject(that.wrkNo + "-Pallet");
                }
                let goods = getArrVal(that.object.objects, "name", that.wrkNo + "-Goods");
                if (goods != null) {
                    that.object.removeObject(that.wrkNo + "-Goods");
                }
            }
            that.readyIn = false;
        }
        // 实时更新
        that.loaded = staData.loaded;
        that.wrkNo = staData.wrkNo;
        // that.run = true;
    }
}
export {StaTask}
static/js/object/StoreGoods.js
@@ -1,14 +1,12 @@
import {MTLLoader} from "../lib/MTLLoader.js";
import {OBJLoader} from "../lib/OBJLoader.js";
import * as THREE from '../three.module.js';
import * as BufferGeometryUtils from '../utils/BufferGeometryUtils.js';
const palletX = -2;
const palletY = 23 - 20 - 3;
const palletY = 0;
const palletZ = -25;
const goodsX = -2;
const goodsY = 40 - 18;
const goodsY = 22;
const goodsZ = -25;
/**
@@ -63,13 +61,10 @@
                positionZ = (item.bay1-1)*-ref.binHeight || 0;
                clone.name = item.loc_no + "-" + "Pallet";
                clone.traverse (function (child) {
                    if (child instanceof THREE.Mesh) {
                        child.name = item.loc_no + "-" + child.name;
                    }
                })
                break;
            case 2:
                switch (ref.objectType) {
                    case 'chain':
                positionX = ref.position.x || 0;
                positionY = ref.position.y || 0;
                positionZ = ref.position.z || 0;
@@ -77,13 +72,19 @@
                positionX -= 48 - 1;
                positionY += 20;
                positionZ -= 138 + 20;
                        break
                    case 'roller':
                        positionX = ref.position.x || 0;
                        positionY = ref.position.y || 0;
                        positionZ = ref.position.z || 0;
                        positionY += 20;
                        break
                    default:
                        break
                }
                clone.name = item.wrkNo + "-" + "Pallet";
                clone.traverse (function (child) {
                    if (child instanceof THREE.Mesh) {
                        child.name = item.wrkNo + "-" + child.name;
                    }
                })
                break;
            default:
                console.error("InitPallet param[type] error ===>> " + type);
@@ -124,13 +125,10 @@
                positionZ = (item.bay1-1)*-ref.binHeight || 0;
                clone.name = item.loc_no + "-" + "Goods";
                clone.traverse (function (child) {
                    if (child instanceof THREE.Mesh) {
                        child.name = item.loc_no + "-" + child.name;
                    }
                })
                break;
            case 2:
                switch (ref.objectType) {
                    case 'chain':
                positionX = ref.position.x || 0;
                positionY = ref.position.y || 0;
                positionZ = ref.position.z || 0;
@@ -138,13 +136,19 @@
                positionX -= 48 - 1;
                positionY += 20;
                positionZ -= 138 + 20;
                        break
                    case 'roller':
                        positionX = ref.position.x || 0;
                        positionY = ref.position.y || 0;
                        positionZ = ref.position.z || 0;
                        positionY += 20;
                        break
                    default:
                        break
                }
                clone.name = item.wrkNo + "-" + "Goods";
                clone.traverse (function (child) {
                    if (child instanceof THREE.Mesh) {
                        child.name = item.wrkNo + "-" + child.name;
                    }
                })
                break;
            default:
                console.error("InitGoods param[type] error ===>> " + type);
static/js/object/StoreGoods_Copy.js
New file
@@ -0,0 +1,182 @@
import {MTLLoader} from "../lib/MTLLoader.js";
import {OBJLoader} from "../lib/OBJLoader.js";
import * as THREE from '../three.module.js';
const palletX = -18;
const palletY = 2;
const palletZ = -46;
const goodsX = -17;
const goodsY = 5;
const goodsZ = -6;
/**
 * 初始化托盘模型
 * @param scene 场景
 * @param palletList 托盘数据列表
 * @param ref 参照物
 * @param type 参照物类型:1 - 货架;    2 - 输送线
 */
function InitPallet(scene, palletList, ref, type) {
    const manager = new THREE.LoadingManager();
    new OBJLoader( manager )
        .setPath( '../static/model/obj/' )
        .load( 'pallet.obj', function ( obj ) {
            obj.traverse (function (child) {
                child.castShadow = true;
                if (child instanceof THREE.Mesh) {
                    child.material = new THREE.MeshLambertMaterial({
                        color: 0x708090
                    });
                }
            });
            obj.scale.set(4, 4, 3.5);
            palletList.map(item => {
                let clone = obj.clone();
                let positionX;
                let positionY;
                let positionZ;
                switch (type) {
                    case 1:
                        positionX = ref.positionX || 0;
                        positionY = ref.bottomHight + (item.lev1-1)*ref.binHeight || 0;
                        positionZ = (item.bay1-1)*-ref.binHeight || 0;
                        clone.name = item.loc_no + "-" + "Pallet";
                        clone.traverse (function (child) {
                            if (child instanceof THREE.Mesh) {
                                child.name = item.loc_no + "-" + child.name;
                            }
                        })
                        break;
                    case 2:
                        positionX = ref.position.x || 0;
                        positionY = ref.position.y || 0;
                        positionZ = ref.position.z || 0;
                        positionX -= 48 - 1;
                        positionY += 20;
                        positionZ -= 138 + 20;
                        clone.name = item.wrkNo + "-" + "Pallet";
                        clone.traverse (function (child) {
                            if (child instanceof THREE.Mesh) {
                                child.name = item.wrkNo + "-" + child.name;
                            }
                        })
                        break;
                    default:
                        console.error("InitPallet param[type] error ===>> " + type);
                }
                clone.position.x = palletX + positionX;
                clone.position.y = palletY + positionY;
                clone.position.z = palletZ + positionZ;
                scene.addObject(clone);
            })
        });
}
/**
 * 初始化货物模型
 * @param scene 场景
 * @param goodsList 货物数据列表
 * @param ref 参照物
 * @param type 参照物类型:1 - 货架;    2 - 输送线
 */
function InitGoods(scene, goodsList, ref, type) {
    const manager = new THREE.LoadingManager();
    const goodsWrapImg = new THREE.TextureLoader( manager ).load( '../static/img/goodsWrap.jpg' );
    const goodsImg = new THREE.TextureLoader( manager ).load( '../static/img/goods.jpg' );
    new OBJLoader( manager ).load( '../static/model/obj/goods.obj', function ( obj ) {
        obj.traverse (function (child) {
            child.castShadow = true;
            if (child instanceof THREE.Mesh) {
                if (child.name === 'goods') {
                    child.material.map = goodsImg;
                } else if (child.name === "goods_wrap") {
                    child.material.map = goodsWrapImg;
                }
            }
        });
        obj.scale.set(1, 1.2, 1.2);
        goodsList.map(item => {
            let clone = obj.clone();
            let positionX;
            let positionY;
            let positionZ;
            switch (type) {
                case 1:
                    positionX = ref.positionX || 0;
                    positionY = ref.bottomHight + (item.lev1-1)*ref.binHeight || 0;
                    positionZ = (item.bay1-1)*-ref.binHeight || 0;
                    clone.name = item.loc_no + "-" + "Goods";
                    clone.traverse (function (child) {
                        if (child instanceof THREE.Mesh) {
                            child.name = item.loc_no + "-" + child.name;
                        }
                    })
                    break;
                case 2:
                    positionX = ref.position.x || 0;
                    positionY = ref.position.y || 0;
                    positionZ = ref.position.z || 0;
                    positionX -= 48 - 1;
                    positionY += 20;
                    positionZ -= 138 + 20;
                    clone.name = item.wrkNo + "-" + "Goods";
                    clone.traverse (function (child) {
                        if (child instanceof THREE.Mesh) {
                            child.name = item.wrkNo + "-" + child.name;
                        }
                    })
                    break;
                default:
                    console.error("InitGoods param[type] error ===>> " + type);
            }
            clone.position.x = goodsX + positionX;
            clone.position.y = goodsY + positionY;
            clone.position.z = goodsZ + positionZ;
            scene.addObject(clone);
        })
    });
}
function StoreGoods(object, data, shelf) {
    let that = this;
    that.data = data;
    that.object = object;
    that.shelf = shelf;
    let palletList = [];
    let goodsList = [];
    let init = function () {
        for (let i=0;i<that.data.length;i++) {
            let obj = that.data[i];
            if (obj.loc_sts === 'D') {
                palletList.push(obj);
            } else if (obj.loc_sts === 'F') {
                palletList.push(obj);
                goodsList.push(obj);
            }
        }
        if (palletList.length > 0) {
            InitPallet(that.object, palletList, that.shelf, 1);
        }
        if (goodsList.length > 0) {
            InitGoods(that.object, goodsList, that.shelf, 1);
        }
    }
    init();
}
// export {StoreGoods, InitPallet, InitGoods}
static/js/object/StoreShelf.js
@@ -21,19 +21,14 @@
        transparent: false,
        opacity: 0.7
    });
    //定义一个组合体
    // let group = new THREE.Group();
    // 货架总高
    let shelfHeight=this.bottomHight+(this.binYNum)*this.binHeight;
    // 货架总宽
    let shelfWidth=this.binZNum*this.binWidth;
    // 支架模型 + 材质
    let rackBoxGeometry=new THREE.BoxGeometry(this.rackLengh,shelfHeight,this.rackWidth);
    let rackObject=new THREE.Mesh(rackBoxGeometry, shelfMat, 0);
    // 托板模型 + 材质
    let planeBoxGeometry = new THREE.BoxGeometry(this.binLength, 2, this.binWidth+this.rackWidth);  // 覆盖多一根支架宽度
    let planeObject=new THREE.Mesh(planeBoxGeometry, shelfMat, 0);
    let planeRackBoxGeometry = new THREE.BoxGeometry(3, 2, this.binWidth+this.rackWidth);
    // Y轴定位
    let positionY = this.positionY + shelfHeight / 2;
@@ -47,17 +42,6 @@
    let transform = new THREE.Object3D();
    // 初始化支架模型
    for(let i=0;i<=this.binZNum;i++) {
        // let leftRack = rackObject.clone();
        // let positionZ = - ( this.positionZ + i*this.binWidth );
        // leftRack.position.set(leftPositionX,positionY,positionZ);
        // leftRack.updateMatrix();
        // group.add(leftRack);
        //
        // let rightRack = rackObject.clone();
        // rightRack.position.set(rightPositionX,positionY,positionZ);
        // rightRack.updateMatrix();
        // group.add(rightRack);
        let positionZ = - ( this.positionZ + i*this.binWidth );
        // -----
        let leftClone = rackBoxGeometry.clone();
@@ -75,13 +59,23 @@
    // 初始化托板模型
    for(let i = 0;i < this.binZNum;i++) {
        for (let j = 0;j <= this.binYNum;j++) {
            // let plane = planeObject.clone();
            // let positionY= this.positionY + this.bottomHight + j*this.binHeight + 1;
            // let positionZ= - ( this.positionZ + i * this.binWidth + this.binWidth/2 );
            // plane.position.set(this.positionX-this.rackLengh/2,positionY,positionZ);
            // plane.updateMatrix();
            // group.add(plane);
            if (j !== this.binYNum) {
                let leftClone = planeRackBoxGeometry.clone();
                let positionY = this.positionY + this.bottomHight + j*this.binHeight + 1;
                let positionZ = - ( this.positionZ + i * this.binWidth + this.binWidth/2 );
                transform.position.set(this.positionX - 16, positionY, positionZ);
                transform.updateMatrix();
                leftClone.applyMatrix4(transform.matrix);
                geometries.push(leftClone);
                let rightClone = planeRackBoxGeometry.clone();
                positionY = this.positionY + this.bottomHight + j*this.binHeight + 1;
                positionZ = - ( this.positionZ + i * this.binWidth + this.binWidth/2 );
                transform.position.set(this.positionX + 13, positionY, positionZ);
                transform.updateMatrix();
                rightClone.applyMatrix4(transform.matrix);
                geometries.push(rightClone);
            } else {
            let clone = planeBoxGeometry.clone();
            let positionY= this.positionY + this.bottomHight + j*this.binHeight + 1;
            let positionZ= - ( this.positionZ + i * this.binWidth + this.binWidth/2 );
@@ -91,6 +85,7 @@
            geometries.push(clone);
        }
    }
    }
    let mergedGeometry = BufferGeometryUtils.mergeBufferGeometries(geometries);
    let mesh = new THREE.Mesh(mergedGeometry, shelfMat);