|  |  |  | 
|---|
|  |  |  | // 实际行数 | 
|---|
|  |  |  | var plcErrorTableFullRows = 0; | 
|---|
|  |  |  | var siteTableFullRows = 0; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | var outputDom = document.getElementById("output"); | 
|---|
|  |  |  | $(document).ready(function() { | 
|---|
|  |  |  | initPlcErrorTable(); | 
|---|
|  |  |  | 
|---|
|  |  |  | getSite(); | 
|---|
|  |  |  | }, 1000); | 
|---|
|  |  |  | setInterval(function () { | 
|---|
|  |  |  | output("\n" +new Date().toLocaleString() + "【2020-5-29 13:14:22】扫描plcA 目标站--27328372372832763643234323432342"); | 
|---|
|  |  |  | getSiteOutput(); | 
|---|
|  |  |  | },500); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | tr.children("td").eq(2).html(table[i-1].error); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else if (res.code === 403){ | 
|---|
|  |  |  | top.location.href = baseUrl+"/login"; | 
|---|
|  |  |  | window.location.href = baseUrl+"/login"; | 
|---|
|  |  |  | }  else { | 
|---|
|  |  |  | alert(res.msg); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | // 站点信息表获取 | 
|---|
|  |  |  | function getSite() { | 
|---|
|  |  |  | var tableEl = $('#site-table'); | 
|---|
|  |  |  | // tableEl.children("tr").children("td").html(""); | 
|---|
|  |  |  | $.ajax({ | 
|---|
|  |  |  | url: baseUrl+ "/site/table/site", | 
|---|
|  |  |  | headers: {'token': localStorage.getItem('token')}, | 
|---|
|  |  |  | 
|---|
|  |  |  | // tr.children("td").eq(9).html(table[i-1].staNo); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else if (res.code === 403){ | 
|---|
|  |  |  | top.location.href = baseUrl+"/login"; | 
|---|
|  |  |  | window.location.href = baseUrl+"/login"; | 
|---|
|  |  |  | }  else { | 
|---|
|  |  |  | alert(res.msg); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 输送设备日志输出 | 
|---|
|  |  |  | function getSiteOutput() { | 
|---|
|  |  |  | $.ajax({ | 
|---|
|  |  |  | url: baseUrl + "/site/output/site", | 
|---|
|  |  |  | headers: {'token': localStorage.getItem('token')}, | 
|---|
|  |  |  | method: 'POST', | 
|---|
|  |  |  | success: function (res) { | 
|---|
|  |  |  | if (res.code === 200) { | 
|---|
|  |  |  | output(res.data); | 
|---|
|  |  |  | } else if (res.code === 403) { | 
|---|
|  |  |  | window.location.href = baseUrl + "/login"; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | alert(res.msg); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 日志输出框 | 
|---|
|  |  |  | function output(content){ | 
|---|
|  |  |  | outputDom.value += content; | 
|---|