From b5d61b944f4822e59bcaf3f825fac1b6683f29e9 Mon Sep 17 00:00:00 2001
From: vincent <1341870251@qq.com>
Date: 星期二, 02 六月 2020 09:23:17 +0800
Subject: [PATCH] #

---
 src/main/webapp/views/pipeline.html |   31 ++++++++++++++++++++++---------
 1 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/src/main/webapp/views/pipeline.html b/src/main/webapp/views/pipeline.html
index 8320cd8..03b337a 100644
--- a/src/main/webapp/views/pipeline.html
+++ b/src/main/webapp/views/pipeline.html
@@ -11,7 +11,7 @@
     <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/layer/layer.js"></script>
+    <script type="text/javascript" src="../static/js/handlebars/handlebars-v4.5.3.js"></script>
     <style>
 
     </style>
@@ -43,6 +43,7 @@
                     </tr>
                 </thead>
                 <tbody>
+
                 </tbody>
             </table>
         </div>
@@ -413,8 +414,22 @@
     <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 outputDom = document.getElementById("output");
+    // 瀹炴椂璁块棶
+    setInterval(function () {
+        getPlcError();
+    }, 500);
 
     // 绌虹櫧琛ㄦ牸娓叉煋
     $(document).ready(function() {
@@ -431,9 +446,10 @@
                 "     </tr>\n";
         }
         $('#plc-error-table tbody').after(html);
+
+        getPlcError();
     });
 
-    getPlcError();
     // plc寮傚父淇℃伅琛ㄨ幏鍙�
     function getPlcError() {
         $.ajax({
@@ -442,8 +458,10 @@
             method: 'POST',
             success: function (res) {
                 if (res.code === 200){
-                    console.log(res.data);
-                    addPlcError(res.data);
+                    var tpl = $("#plcErrorTable").html();
+                    var template = Handlebars.compile(tpl);
+                    var html = template(res);
+                    $('#plc-error-table').append(html);
                 } else if (res.code === 403){
                     top.location.href = baseUrl+"/login";
                 }  else {
@@ -451,11 +469,6 @@
                 }
             }
         });
-    }
-
-    // plc寮傚父杈撳叆
-    function addPlcError(val) {
-
     }
 
     // 鏃ュ織杈撳嚭妗�

--
Gitblit v1.9.1