18516761980
2022-08-12 d250ca5d40e6b28c7f79c3d8ea724f039288dec3
src/main/webapp/views/pipeline.html
@@ -59,9 +59,10 @@
            <!-- 站点状态数据监控版 -->
            <div id="site-monitor" class="main-board">
                <!-- 表格 -->
                <table id="site-table">
                <!--固定表头 table 加table-layout: fixed;  th 加 position:sticky;top: 0;-->
                <table id="site-table" style="table-layout: fixed;">
                    <!-- 表头 -->
                    <thead>
                    <thead style="position:sticky;top: 0;">
                    <tr>
                        <th>站号</th>
                        <th>工作号</th>
@@ -72,6 +73,7 @@
                        <th>入库标记</th>
                        <th>空板信号</th>
                        <th>目标站</th>
                        <th>高低库位</th>
                    </tr>
                    </thead>
                    <!-- 表格内容 -->
@@ -118,12 +120,11 @@
    </div>
</div>
</body>
<script>
    // 初始化
    // 空白行数
    var stop = false
    var plcErrorTableBlankRows = 0;
    var siteTableBlankRows = 0;
    // 实际行数
@@ -139,12 +140,19 @@
    // 实时访问
    setInterval(function () {
        getPlcError();
        getSite();
        starGetSite();
    }, 1000);
    setInterval(function () {
        getSiteOutput();
    },500);
    function starGetSite() {
        if (stop) {
            getSite();
            // return
        } else {
            getSite();
        }
    }
    // plc异常信息表获取
    function getPlcError() {
        var tableEl = $('#plc-error-table');
@@ -180,6 +188,7 @@
            method: 'POST',
            success: function (res) {
                if (res.code === 200){
                    console.log(res)
                    var table = res.data;
                    if (table.length > siteTableBlankRows && table.length !== siteTableFullRows) {
                        initSiteTable(table.length-siteTableBlankRows);
@@ -196,6 +205,7 @@
                        setVal(tr.children("td").eq(6), table[i-1].pakMk);
                        setVal(tr.children("td").eq(7), table[i-1].emptyMk);
                        setVal(tr.children("td").eq(8), table[i-1].staNo);
                        setVal(tr.children("td").eq(9), table[i-1].locType1);
                    }
                } else if (res.code === 403){
                    window.location.href = baseUrl+"/login";
@@ -281,6 +291,7 @@
                "       <td></td>\n" +
                "       <td></td>\n" +
                "       <td></td>\n" +
                "       <td></td>\n" +
                "     </tr>\n";
        }
        $('#site-table tbody').after(html);
@@ -289,6 +300,7 @@
    // 详情操作 -------------------------------------------------------------------------
    var layerDetl;
    $(document).on('dblclick ','#site-table tr', function () {
        stop = true
        var siteId = $(this).children("td").eq(0).html();
        if (siteId !== null && siteId !== "") {
            layerDetl = layer.open({
@@ -314,9 +326,11 @@
                    $('#workNo').val("");
                    $('#staNo').val("");
                    $('#pakMk').val("");
                    stop = false
                }
            })
        }
    });
    $(document).on('click ','#save', function () {