| | |
| | | // 初始化 |
| | | var plcErrorTableFieldCount = 0; |
| | | var outputDom = document.getElementById("output"); |
| | | $(document).ready(function() { |
| | | initPlcErrorTable(); |
| | | getPlcError(); |
| | | }); |
| | | // 实时访问 |
| | | setInterval(function () { |
| | | getPlcError(); |
| | | }, 1000); |
| | | setInterval(function () { |
| | | output("\n" +new Date().toLocaleString() + "【2020-5-29 13:14:22】扫描plcA 目标站--27328372372832763643234323432342"); |
| | | },500); |
| | | |
| | | // 空白表格渲染 |
| | | $(document).ready(function() { |
| | | var one = $('#plc-error-table thead').height(); |
| | | var total = $('.plc-log-body').height(); |
| | | var count = total / one; |
| | | count = parseInt(count); |
| | | plcErrorTableFieldCount = count - 1; |
| | | var html = ""; |
| | | for (var i = 0; i < count-1; i ++){ |
| | | html += " <tr>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " </tr>\n"; |
| | | } |
| | | $('#plc-error-table tbody').after(html); |
| | | |
| | | getPlcError(); |
| | | }); |
| | | |
| | | // plc异常信息表获取 |
| | | function getPlcError() { |
| | |
| | | outputDom.value += content; |
| | | outputDom.scrollTop = outputDom.scrollHeight; |
| | | } |
| | | setInterval(function () { |
| | | output("\n" +new Date().toLocaleString() + "【2020-5-29 13:14:22】扫描plcA 目标站--27328372372832763643234323432342"); |
| | | },500); |
| | | |
| | | // ------------------------------------------------------------------------------------------------ |
| | | |
| | | // plc异常空白表格渲染 |
| | | function initPlcErrorTable() { |
| | | var one = $('#plc-error-table thead').height(); |
| | | var total = $('.plc-log-body').height(); |
| | | var count = total / one; |
| | | count = parseInt(count); |
| | | plcErrorTableFieldCount = count - 1; |
| | | var html = ""; |
| | | for (var i = 0; i < count-1; i ++){ |
| | | html += " <tr>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " <td></td>\n" + |
| | | " </tr>\n"; |
| | | } |
| | | $('#plc-error-table tbody').after(html); |
| | | } |
| | | |
| | | </script> |
| | | </html> |