自动化立体仓库 - WCS系统
#
vincent
2020-06-02 92e25bfb1a5bb7212984ce0d08e94c9f6ecad666
src/main/webapp/views/pipeline.html
@@ -11,7 +11,6 @@
    <link rel="stylesheet" type="text/css" href="../static/css/pipeline.css">
    <script type="text/javascript" src="../static/js/jquery/jquery-3.3.1.min.js"></script>
    <script type="text/javascript" src="../static/js/common.js"></script>
    <script type="text/javascript" src="../static/js/handlebars/handlebars-v4.5.3.js"></script>
    <style>
    </style>
@@ -414,22 +413,14 @@
    <textarea id="output"></textarea>
</footer>
</body>
<script type="text/template" id="plcErrorTable">
    {{#each data}}
    <tr>
        <td>{{no}}</td>
        <td>{{plcDesc}}</td>
        <td>{{error}}</td>
    </tr>
    {{/each}}
</script>
<script>
    // 初始化
    var plcErrorTableFieldCount = 0;
    var outputDom = document.getElementById("output");
    // 实时访问
    setInterval(function () {
        getPlcError();
    }, 500);
    }, 1000);
    // 空白表格渲染
    $(document).ready(function() {
@@ -437,6 +428,7 @@
        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" +
@@ -452,16 +444,21 @@
    // plc异常信息表获取
    function getPlcError() {
        var tableEl = $('#plc-error-table');
        tableEl.children("tr").children("td").html("");
        $.ajax({
            url: baseUrl+ "/site/table/plc/errors",
            headers: {'token': localStorage.getItem('token')},
            method: 'POST',
            success: function (res) {
                if (res.code === 200){
                    var tpl = $("#plcErrorTable").html();
                    var template = Handlebars.compile(tpl);
                    var html = template(res);
                    $('#plc-error-table').append(html);
                    var table = res.data;
                    for (var i=1;i<=table.length;i++){
                        var tr = tableEl.find("tr").eq(i);
                        tr.children("td").eq(0).html(table[i-1].no);
                        tr.children("td").eq(1).html(table[i-1].plcDesc);
                        tr.children("td").eq(2).html(table[i-1].error);
                    }
                } else if (res.code === 403){
                    top.location.href = baseUrl+"/login";
                }  else {