#
vincent
2020-06-02 38be704dd5027056e135a5613299163e861f89cf
src/main/webapp/views/console.html
@@ -21,8 +21,8 @@
<header>
    <!-- 系统运行状态 -->
    <div class="system-state">
        <div class="system-icon"></div>
        <span>系统运行中...</span>
        <div id="system-icon" class="system-icon-open" onclick="systemSwitch()"></div>
        <span id="system-run-desc">系统运行中...</span>
    </div>
    <!-- 信息展示 -->
@@ -406,7 +406,7 @@
</main>
</body>
<script>
    var systemRunning = true;
    var crn1Position = 0;
    var crn2Position = 0;
    // 初始化
@@ -414,9 +414,25 @@
    getCrnInfo();
    // 实时访问
    setInterval(function () {
        getSitesInfo();
        getCrnInfo();
    }, 1000);
    }, 500);
    setInterval(function () {
        getSitesInfo();
    }, 3000);
    // 系统运行开关
    function systemSwitch() {
        if (systemRunning){
            $('#system-icon').attr("class", "system-icon-close");
            $('#system-run-desc').html("系统已停止!");
            systemRunning = false;
        } else {
            $('#system-icon').attr("class", "system-icon-open");
            $('#system-run-desc').html("系统运行中...");
            systemRunning = true;
        }
    }
    // 输送设备实时数据获取
    function getSitesInfo(){
@@ -448,7 +464,6 @@
            success: function (res) {
                if (res.code === 200){
                    var crns = res.data;
                    console.log(crns);
                    for (var i = 0; i < crns.length; i++){
                        crnAnimate(crns[i].crnId, crns[i].offset);
                    }
@@ -461,6 +476,24 @@
        });
    }
    // 扫码器实时数据获取
    function getBarcodeInfo(){
        $.ajax({
            url: baseUrl+ "/console/latest/data/barcode",
            headers: {'token': localStorage.getItem('token')},
            method: 'POST',
            success: function (res) {
                if (res.code === 200){
                } else if (res.code === 403){
                    top.location.href = baseUrl+"/login";
                }  else {
                    alert(res.msg);
                }
            }
        });
    }
    // 堆垛机偏移动画
    function crnAnimate(id, leftVal) {
        switch (id) {