#
luxiaotao1123
2022-03-09 8fc757864f420c2cd57adb046dfe3e621a363978
src/main/webapp/views/console.html
@@ -1219,53 +1219,67 @@
</body>
</html>
<script>
    var tData = []
    var tData = [
        {"time":"2022-02-22 14:24:53","barcode":"80000009"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
        {"time":"2022-02-22 14:24:53","barcode":"80000019"},
    ]
    var tDate1 = []
    var tDate2 = []
    var tDate3 = []
    function getCodeData(){
        $.ajax({
            url:baseUrl +'/console/barcode/output/site',
            method:'GET',
            success:function (res) {
                if(res.code === 200){
                    tData = eval(res.data);
                    console.log(tData)
                    if(tData.length<=5){
                        tData1 = tData
                    } else if (tData.length<=10){
                        tDate1 = tData.slice(0,5)
                        tData.splice(0,5)
                        tDate2 = tData
                        console.log(tDate2)
                    } else if(tData.length<=15){
                        tDate1 = tData.slice(0,5)
                        tDate2 = tData.slice(6,10)
                        tData.splice(0,10)
                        tDate3 = tData
                        console.log(tDate3)
                    } else {
                        tData = tData.slice(-15)
                        tDate1 = tData.slice(-15)
                        tDate2 = tData.slice(-10)
                        tDate3 = tData.slice(-5)
                    }
                }
            }
        })
    // function getCodeData(){
    //    $.ajax({
    //       url:baseUrl +'/xgmwcs/console/barcode/output/site',
    //       method:'GET',
    //       success:function (res) {
    //          if(res.code === 200){
    //             tData = res.data
    //          }
    //       }
    //    })
    // }
    // setInterval(getCodeData(),1000)
    if(tData.length<=5){
        tData1 = tData
    } else if (tData.length<=10){
        tDate1 = tData.slice(0,5)
        tData.splice(0,5)
        tDate2 = tData
    } else if(tData.length<=15){
        tDate1 = tData.slice(0,5)
        tDate2 = tData.slice(6,10)
        tData.splice(0,10)
        tDate3 = tData
    } else {
        tData = tData.slice(-15)
        tDate1 = tData.slice(-15)
        tDate2 = tData.slice(-10)
        tDate3 = tData.slice(-5)
    }
    setInterval(function () {
        getCodeData();
        renderBarCode();
    }, 1000)
    function renderBarCode() {
        for (var i = 0;i<tDate1.length;i++){
            console.log(tDate1[i])
            var str1 = '<li><span>' + tDate1[i].barcode + '</span><span class="right">' + tDate1[i].time + '</span></li>'
            $('#barcode1').append(str1)
        }
@@ -1278,6 +1292,7 @@
            $('#barcode3').append(str3)
        }
    }
    setInterval(renderBarCode(),1000)
</script>
<script type="text/javascript">
    // 弹窗站点信息
@@ -1399,7 +1414,6 @@
            },
            method: 'POST',
            success: function (res) {
                console.log(res)
                layer.close(index);
                if (res.code === 200){
                    if (res.data.status) {