|  |  | 
 |  |  |             <div class="body-head">输送线状态</div> | 
 |  |  |             <div class="state states"> | 
 |  |  |                 <span>运输线总数</span> | 
 |  |  |                 <span class="line-ss">45</span> | 
 |  |  |                 <span class="line-ss">48</span> | 
 |  |  |             </div> | 
 |  |  |             <div class="button"><span>所有状态</span></div> | 
 |  |  |             <div class="button item-group"> | 
 |  |  | 
 |  |  | </body> | 
 |  |  | </html> | 
 |  |  | <script> | 
 |  |  |     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 | 
 |  |  |     } 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) | 
 |  |  |     var tData = [] | 
 |  |  |     var tData1 = [] | 
 |  |  |     var tData2 = [] | 
 |  |  |     var tData3 = [] | 
 |  |  |     function getCodeData(){ | 
 |  |  |         $.ajax({ | 
 |  |  |             url:baseUrl +'/console/barcode/output/site', | 
 |  |  |             method:'GET', | 
 |  |  |             success:function (res) { | 
 |  |  |                 if(res.code === 200){ | 
 |  |  |                     tData = eval(res.data); | 
 |  |  |                     if(tData.length<=5){ | 
 |  |  |                         tData1 = tData | 
 |  |  |                     } else if (tData.length<=10){ | 
 |  |  |                         tData1 = tData.slice(0,5) | 
 |  |  |                         tData.splice(0,5) | 
 |  |  |                         tData2 = tData | 
 |  |  |                     } else if(tData.length<=15){ | 
 |  |  |                         tData1 = tData.slice(0,5) | 
 |  |  |                         tData2 = tData.slice(6,10) | 
 |  |  |                         tData.splice(0,10) | 
 |  |  |                         tData3 = tData | 
 |  |  |                     } else { | 
 |  |  |                         tData = tData.slice(-15) | 
 |  |  |                         tData1 = tData.slice(-15) | 
 |  |  |                         tData2 = tData.slice(-10) | 
 |  |  |                         tData3 = tData.slice(-5) | 
 |  |  |  | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |         }) | 
 |  |  |     } | 
 |  |  |     setInterval(function () { | 
 |  |  |         getCodeData(); | 
 |  |  |         renderBarCode(); | 
 |  |  |     }, 1000) | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     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>' | 
 |  |  |         for (var i = 0;i<tData1.length;i++){ | 
 |  |  |             var str1 = '<li><span>' + tData1[i].barcode + '</span><span class="right">' + tData1[i].time + '</span></li>' | 
 |  |  |             $('#barcode1').append(str1) | 
 |  |  |         } | 
 |  |  |         for(var j = 0;j<tDate2.length;j++){ | 
 |  |  |             var str2 = '<li><span>' + tDate2[j].barcode + '</span><span class="right">' + tDate2[j].time + '</span></li>' | 
 |  |  |         for(var j = 0;j<tData2.length;j++){ | 
 |  |  |             var str2 = '<li><span>' + tData2[j].barcode + '</span><span class="right">' + tData2[j].time + '</span></li>' | 
 |  |  |             $('#barcode2').append(str2) | 
 |  |  |         } | 
 |  |  |         for(var k = 0;k<tDate3.length;k++){ | 
 |  |  |             var str3 = '<li><span>' + tDate3[k].barcode + '</span><span class="right">' + tDate3[k].time + '</span></li>' | 
 |  |  |         for(var k = 0;k<tData3.length;k++){ | 
 |  |  |             var str3 = '<li><span>' + tData3[k].barcode + '</span><span class="right">' + tData3[k].time + '</span></li>' | 
 |  |  |             $('#barcode3').append(str3) | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |     setInterval(renderBarCode(),1000) | 
 |  |  | </script> | 
 |  |  | <script type="text/javascript"> | 
 |  |  |     // 弹窗站点信息 | 
 |  |  | 
 |  |  |                 for (var val in res.data) { | 
 |  |  |                     var find = $("#siteWindow").find(":input[name='" + val + "']"); | 
 |  |  |                     if (find[0].type==='text') { | 
 |  |  |                         find.val(data[val]); | 
 |  |  |                         find.val(res.data[val]); | 
 |  |  |                     } else if (find[0].type === 'checkbox') { | 
 |  |  |                         find.attr("checked", data[val] === 'Y'); | 
 |  |  |                         find.attr("checked", res.data[val] === 'Y'); | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  |             } |