From 4702274720a7c87605f9f7c286ea092448ad3a5a Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期二, 20 九月 2022 14:18:07 +0800
Subject: [PATCH] #
---
src/main/webapp/static/css/pipeline.css | 29 ++++++++++++--
src/main/webapp/views/pipeline.html | 71 +++++++++++++++++++++++++++++++----
2 files changed, 87 insertions(+), 13 deletions(-)
diff --git a/src/main/webapp/static/css/pipeline.css b/src/main/webapp/static/css/pipeline.css
index 0a846ef..86a7f4d 100644
--- a/src/main/webapp/static/css/pipeline.css
+++ b/src/main/webapp/static/css/pipeline.css
@@ -30,13 +30,34 @@
}
/* 琛ㄦ牸 */
+/* 琛ㄦ牸 */
.plc-log-header {
- height: 05%;
+ height: 15%;
}
.plc-log-body {
- height: 95%;
- overflow: auto;
+ height: 85%;
+ overflow: hidden;
}
+
+/* 鍏ュ嚭搴撴ā寮� */
+.io-mode-oper {
+ height: 100%;
+ /*overflow: hidden;*/
+ padding: 10px 20px;
+}
+.io-mode-oper fieldset {
+ padding: 15px 0 10px 0;
+ border-width: 1px;
+ border-style: solid;
+ height: 100%;
+}
+.io-mode-oper legend {
+ text-align: center;
+ padding: 0 10px;
+ font-size: 16px;
+ font-weight: 300;
+}
+
/* 绔欑偣琛ㄦ牸 */
@@ -162,4 +183,4 @@
}
.form-button:hover {
opacity: 0.7;
-}
\ No newline at end of file
+}
diff --git a/src/main/webapp/views/pipeline.html b/src/main/webapp/views/pipeline.html
index d8500fc..8361771 100644
--- a/src/main/webapp/views/pipeline.html
+++ b/src/main/webapp/views/pipeline.html
@@ -58,26 +58,21 @@
<!-- 璁惧浠诲姟鎿嶄綔 -->
<div class="io-mode-oper">
<fieldset>
- <legend>鍏ュ嚭搴撴ā寮忥紙IO-Mode锛�</legend>
+ <legend>鍏呯數鎺у埗锛圕harge-Mode锛�</legend>
<div class="io-mode-box">
- <label>1F</label>
+ <label>1#</label>
<button id="io-mode-1" class="ioModeBtn" onclick="ioModeSwitch(this.id)"> - </button>
</div>
<div class="io-mode-box">
- <label>3F</label>
+ <label>2#</label>
<button id="io-mode-2" class="ioModeBtn" onclick="ioModeSwitch(this.id)"> - </button>
</div>
<div class="io-mode-box">
- <label>4F</label>
+ <label>3#</label>
<button id="io-mode-3" class="ioModeBtn" onclick="ioModeSwitch(this.id)"> - </button>
- </div>
- <div class="io-mode-box">
- <label>5F</label>
- <button id="io-mode-4" class="ioModeBtn" onclick="ioModeSwitch(this.id)"> - </button>
</div>
</fieldset>
</div>
-
<div>
<span style="color: #1E9FFF">PLC寮傚父淇℃伅琛�:</span>
@@ -175,6 +170,7 @@
var siteTableFullRows = 0;
var outputDom = document.getElementById("output");
$(document).ready(function() {
+ getIoModeInfo();
initPlcErrorTable();
getPlcError();
initSiteTable();
@@ -184,11 +180,68 @@
setInterval(function () {
getPlcError();
getSite();
+ getIoModeInfo();
}, 1000);
setInterval(function () {
getSiteOutput();
},500);
+ var ioModeData;
+ function getIoModeInfo() {
+ $.ajax({
+ url: baseUrl+ "/site/io/mode/info/site",
+ headers: {'token': localStorage.getItem('token')},
+ method: 'GET',
+ success: function (res) {
+ if (res.code === 200){
+ ioModeData = res.data;
+ ioModeData.forEach(function (e) {
+ $("#io-mode-"+e.floor).html(e.modeDesc);
+ })
+ } else if (res.code === 403){
+ window.location.href = baseUrl+"/login";
+ } else {
+ console.log(res.msg);
+ }
+ }
+ });
+ }
+
+ /**
+ * 寮哄埗鍒囨崲鍏ュ嚭搴撴ā寮�
+ */
+ function ioModeSwitch(el) {
+ var floor = el.split("-")[2];
+ if (ioModeData != null && ioModeData.length > 1) {
+ ioModeData.forEach(function(e) {
+ if (e.floor === Number(floor)) {
+ if (e.modeVal === 3 || e.modeVal === 4) {
+ layer.confirm('纭畾鍒囨崲涓哄叆搴撴ā寮忓悧锛�',function () {
+ $.ajax({
+ url: baseUrl+ "/site/io/mode/action/site",
+ headers: {'token': localStorage.getItem('token')},
+ data: {floor: e.floor},
+ method: 'POST',
+ success: function (res) {
+ if (res.code === 200){
+ layer.msg("鏆傛椂涓嶈兘鍒囨崲锛�", {icon: 1})
+ } else if (res.code === 403){
+ window.location.href = baseUrl+"/login";
+ } else {
+ console.log(res.msg);
+ }
+ }
+ });
+ layer.closeAll();
+ })
+ }
+ }
+ });
+ }
+
+
+ }
+
// plc寮傚父淇℃伅琛ㄨ幏鍙�
function getPlcError() {
var tableEl = $('#plc-error-table');
--
Gitblit v1.9.1