#
yxFwq
2024-07-18 bf7f18b252078aa07b7df4a2b51a36e320663730
src/main/webapp/views/console.html
@@ -21,7 +21,7 @@
                <h6>AUTOMATIC WAREHOUSE WCS MONITORING DIAGRAM</h6>
            </div>
            <div class="head-right">
                <img src="../static/images/zy-logo.png" alt="中扬" height="44" width="80">
<!--                <img src="../static/images/zy-logo.png" alt="徐工汉云" height="44" width="80">-->
            </div>
        </div>
        <!-- 货架 + 堆垛机 + 入库站点 -->
@@ -344,7 +344,6 @@
            url: baseUrl + '/console/barcode/output/site',
            method: 'GET',
            success: function (res) {
                console.log(res)
                if (res.code === 200) {
                    tData = eval(res.data);
                    if (tData.length <= 5) {
@@ -463,6 +462,8 @@
    getSystemRunningStatus();
    getBarcodeInfo();
    getScaleInfo();
    // carAnimate();
    carAnimate2();
    // 实时访问
    setInterval(function () {
        getCrnInfo();
@@ -516,8 +517,8 @@
                } else if (res.code === 403) {
                    parent.location.href = baseUrl + "/login";
                } else {
                    alert(res.msg);
                    console.log(res.msg);
                }
            }
        });
@@ -561,7 +562,9 @@
                    var sites = res.data;
                    for (var i = 0; i < sites.length; i++) {
                        var siteEl = $("#site-" + sites[i].siteId);
                        console.log(sites[i].siteId)
                        siteEl.attr("class", "site " + sites[i].siteStatus);
                        // siteEl.attr("class", "site site-auto-run-id");
                        if (sites[i].workNo != null && sites[i].workNo > 0) {
                            siteEl.html(sites[i].siteId + "[" + sites[i].workNo + "]");
                        } else {
@@ -743,5 +746,54 @@
        $("#site-0" + id).animate({top: targetTop + 'px'}, 1000);
    }
    //RGV车辆各站点距离数据
    let sitePosition = {
        101: '68px',
        102: '117px',
        122: '183px',
        104: '183px',
        105: '232px',
        118: '297px',
        107: '297px',
        108: '345px',
        119: '355px',
        110: '410px',
        120: '421px',
        111: '459px',
        121: '479px',
        113: '524px',
        123: '556px',
        114: '572px',
        1142: '600px',
        116: '639px',
        117: '687px',
    }
    //RGV车移动动画
    function moveSite(siteId, staNo) {
        $(siteId).animate({top: sitePosition[staNo]}, 1000);
    }
    // moveSite("#site-1", 117);//测试移动方法,可删除
    // Rgv实时数据获取
    function carAnimate2() {
        // console.log("1=============1")
        $.ajax({
            url: baseUrl + "/rgv/console/rgv/site/data",
            headers: {'token': localStorage.getItem('token')},
            method: 'POST',
            success: function (res) {
                if (res.code === 200) {
                    var rgvMap = res.data;
                    for (var i = 0; i < rgvMap.length; i++) {
                        moveSite("#site-"+rgvMap[i].id, rgvMap[i].title);
                    }
                } else {
                    console.log(res.msg);
                }
            }
        });
    }
</script>