#
luxiaotao1123
2022-03-09 8fc757864f420c2cd57adb046dfe3e621a363978
src/main/webapp/views/console.html
@@ -1219,44 +1219,65 @@
</body>
</html>
<script>
    function getCodeData(){
        $.ajax({
            url:baseUrl +'/xgmwcs/console/barcode/output/site',
            method:'GET',
            success:function (res) {
                console.log(res)
                if(res.code === 200){
                    tData = res.data
                }
            }
        })
    }
    setInterval(getCodeData(),1000)
    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 +'/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
        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 renderBarCode() {
        for (var i = 0;i<tDate1.length;i++){
            var str1 = '<li><span>' + tDate1[i].barcode + '</span><span class="right">' + tDate1[i].time + '</span></li>'
@@ -1393,7 +1414,6 @@
            },
            method: 'POST',
            success: function (res) {
                console.log(res)
                layer.close(index);
                if (res.code === 200){
                    if (res.data.status) {