From 92e25bfb1a5bb7212984ce0d08e94c9f6ecad666 Mon Sep 17 00:00:00 2001
From: vincent <1341870251@qq.com>
Date: 星期二, 02 六月 2020 10:41:18 +0800
Subject: [PATCH] #
---
src/main/webapp/views/pipeline.html | 96 +++++++++++++++++------------------------------
1 files changed, 35 insertions(+), 61 deletions(-)
diff --git a/src/main/webapp/views/pipeline.html b/src/main/webapp/views/pipeline.html
index de76ec4..8c90b9e 100644
--- a/src/main/webapp/views/pipeline.html
+++ b/src/main/webapp/views/pipeline.html
@@ -10,65 +10,8 @@
<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>
<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 +42,7 @@
</tr>
</thead>
<tbody>
+
</tbody>
</table>
</div>
@@ -470,7 +414,13 @@
</footer>
</body>
<script>
+ // 鍒濆鍖�
+ var plcErrorTableFieldCount = 0;
var outputDom = document.getElementById("output");
+ // 瀹炴椂璁块棶
+ setInterval(function () {
+ getPlcError();
+ }, 1000);
// 绌虹櫧琛ㄦ牸娓叉煋
$(document).ready(function() {
@@ -478,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" +
@@ -487,11 +438,34 @@
" </tr>\n";
}
$('#plc-error-table tbody').after(html);
+
+ getPlcError();
});
- // plc寮傚父杈撳叆
- function addPlcError(val) {
-
+ // 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 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 {
+ alert(res.msg);
+ }
+ }
+ });
}
// 鏃ュ織杈撳嚭妗�
--
Gitblit v1.9.1