#
luxiaotao1123
2021-12-13 9233b9a9c7c2e760d519d4ca0ccf0868b57fb1cd
#
4个文件已修改
35 ■■■■■ 已修改文件
static/js/app.js 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/js/data/Task.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/js/utils.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
views/index.html 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/js/app.js
@@ -31,7 +31,6 @@
            this.initLight();
            this.initFloor();
            this.initModel();
            this.queryTask();
            this.initStoreObjects(this);
        }
        this.animate = function () {
@@ -39,7 +38,8 @@
            this.stats.begin();
            this.renderer.render(this.scene, this.camera);
            this.stats.end();
            this.modelMove();
            this.queryTask();
            // this.modelMove();
        }
        this.initScene = function () {
            this.scene = new THREE.Scene();
@@ -263,9 +263,13 @@
            }
        }
        this.queryTask = function () {
            if (this.firstTime === 1) {
                queryTaskCurrent();
                this.wrkTasks = TaskData;
            if (TaskDatas !== null) {
                for (let TaskData of TaskDatas) {
                    let wrkTask = getArrVal(this.wrkTasks, "wrkNo", TaskData.wrkNo);
                    if (null == wrkTask) {
                        this.wrkTasks.push(TaskData);
                    }
                }
            }
        }
        this.getExistedGoodType=function(state){
@@ -353,8 +357,10 @@
                });
        }
        this.initModelMove = function () {
            console.log(this.wrkTasks)
            for (var wrkMast of this.wrkTasks) {
                let crnBody = getArrVal(this.objects, "name", wrkMast.crnNo + "-body");
                console.log(crnBody)
                // 取货点定位
                let sourceLocPosition = getBinPosition(wrkMast.sourceLocNo);
                let points = [crnBody.position, sourceLocPosition];
@@ -378,7 +384,6 @@
            }
        }
    },
};
static/js/data/Task.js
@@ -1,5 +1,5 @@
setInterval("queryTaskCurrent()",1000);
function queryTaskCurrent() {
    $.ajax({
        // url: 'http://47.97.1.152:58080/jkwcs/three/init/store/v1',
@@ -8,9 +8,9 @@
        data: {},
        async: false,
        success: function (res) {
            TaskData = res.data;
            TaskDatas = res.data;
        }
    })
}
var TaskData;
var TaskDatas = null;
static/js/utils.js
@@ -4,10 +4,12 @@
    if (!arrObj instanceof Array) {
        return null;
    }
    for (var i = 0;i<arrObj.length;i++) {
        let element = arrObj[i];
        if (element[key] === condition) {
            return element;
    if (arrObj == null || arrObj.length === 0) {
        return null;
    }
    for (let obj of arrObj) {
        if (obj[key] === condition) {
            return obj;
        }
    }
    return null;
views/index.html
@@ -82,7 +82,7 @@
            document.getElementById("print").addEventListener('click', function () {
                console.log(player.objects);
                player.modelMove();
                player.initModelMove();
            }, false);
        </script>