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

---
 src/main/webapp/views/pipeline.html |   99 ++++++++++++++++++++-----------------------------
 1 files changed, 40 insertions(+), 59 deletions(-)

diff --git a/src/main/webapp/views/pipeline.html b/src/main/webapp/views/pipeline.html
index 5353db0..cac6746 100644
--- a/src/main/webapp/views/pipeline.html
+++ b/src/main/webapp/views/pipeline.html
@@ -10,65 +10,9 @@
     <link rel="stylesheet" type="text/css" href="../static/css/common.css">
     <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/layer/layer.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>
-        .plc-log-header {
-            height: 15%;
-        }
-        .plc-log-body {
-            height: 85%;
-            overflow: auto;
-        }
-
-
-        /* 绔欑偣琛ㄦ牸 */
-        #site-table {
-            font-size: 12px;
-            border-collapse: collapse;
-            margin: 0 auto;
-            text-align: center;
-        }
-        #site-table td, #site-table th {
-            border: 1px solid #cad9ea;
-            color: #666;
-            height: 25px;
-        }
-        #site-table thead th {
-            background-color: #CCE8EB;
-            width: 100px;
-        }
-        #site-table tr:nth-child(odd) {
-            background: #fff;
-        }
-        #site-table tr:nth-child(even) {
-            background: #F5FAFA;
-        }
-
-
-
-        /* plc寮傚父琛ㄦ牸 */
-        #plc-error-table {
-            font-size: 12px;
-            border-collapse: collapse;
-            margin: 0 auto;
-        }
-        #plc-error-table td, #plc-error-table th {
-            border: 1px solid #cad9ea;
-            color: #666;
-            height: 25px;
-            text-align: left;
-            padding-left: 5px;
-        }
-        #plc-error-table thead th {
-            background-color: #CCE8EB;
-            width: 100px;
-        }
-        #plc-error-table tr:nth-child(odd) {
-            background: #fff;
-        }
-        #plc-error-table tr:nth-child(even) {
-            background: #F5FAFA;
-        }
 
     </style>
 </head>
@@ -99,6 +43,7 @@
                     </tr>
                 </thead>
                 <tbody>
+
                 </tbody>
             </table>
         </div>
@@ -469,7 +414,19 @@
     <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");
+
     // 绌虹櫧琛ㄦ牸娓叉煋
     $(document).ready(function() {
         var one = $('#plc-error-table thead').height();
@@ -485,10 +442,34 @@
                 "     </tr>\n";
         }
         $('#plc-error-table tbody').after(html);
+
+        getPlcError();
     });
 
+    // plc寮傚父淇℃伅琛ㄨ幏鍙�
+    function getPlcError() {
+        $.ajax({
+            url: baseUrl+ "/site/table/plc/errors",
+            headers: {'token': localStorage.getItem('token')},
+            method: 'POST',
+            success: function (res) {
+                if (res.code === 200){
+                    console.log(res.data);
+                    var tpl = $("#plcErrorTable").html();
+                    var template = Handlebars.compile(tpl);
+                    var html = template(res);
+                    console.log(html);
+                    $('#plc-error-table').append(html);
+                } else if (res.code === 403){
+                    top.location.href = baseUrl+"/login";
+                }  else {
+                    alert(res.msg);
+                }
+            }
+        });
+    }
+
     // 鏃ュ織杈撳嚭妗�
-    var outputDom = document.getElementById("output");
     function output(content){
         outputDom.value += content;
         outputDom.scrollTop = outputDom.scrollHeight;

--
Gitblit v1.9.1