From 0892136d8ec6818dfee396d10258a9cd9e992f7d Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期四, 28 一月 2021 14:25:01 +0800
Subject: [PATCH] #
---
src/main/webapp/views/crn.html | 177 +++++++++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 135 insertions(+), 42 deletions(-)
diff --git a/src/main/webapp/views/crn.html b/src/main/webapp/views/crn.html
index bc1fd92..0a247fa 100644
--- a/src/main/webapp/views/crn.html
+++ b/src/main/webapp/views/crn.html
@@ -13,23 +13,51 @@
<script type="text/javascript" src="../static/js/common.js"></script>
<script type="text/javascript" src="../static/js/layer/layer.js"></script>
<style>
+ .demoBtn {
+ vertical-align: middle;
+ width: 20%;
+ height: 25px;
+ left: 0;
+ top: 0;
+ text-shadow: inherit;
+ font-size: 15px;
+ margin-left: 5px;
+ margin-right: 5px;
+ display: inline-block;
+ background-color: #FF5722;
+ border: none;
+ color: #FFF;
+ box-shadow: 1px 1px 5px #B6B6B6;
+ border-radius: 3px;
+ cursor: pointer;
+ }
+ .demoBtn:hover {
+ opacity: 0.8
+ }
+ .demoBtn:focus {
+ outline: 0;
+ }
</style>
</head>
<body>
<!-- 鏃ュ織鐩戞帶鏉� -->
<div class="log-board">
<!-- 鎵ц鍛戒护 -->
+
+ <!-- 鎵ц鍛戒护 -->
<div class="command-log">
<h2>鎵ц涓殑鍛戒护</h2>
<div class="crn-command-item">
<label>1#</label>
- <span> </span>
+ <button id="demoBtn-1" class="demoBtn" onclick="demoSwitch(this.id)"> - </button>
+ <!-- <span> </span>-->
<input id="crn1" disabled="disabled">
</div>
<div class="crn-command-item">
<label>2#</label>
- <span> </span>
+ <button id="demoBtn-2" class="demoBtn" onclick="demoSwitch(this.id)"> - </button>
+ <!-- <span> </span>-->
<input id="crn2" disabled="disabled">
</div>
</div>
@@ -44,13 +72,13 @@
<th>鏈夌墿</th>
<th>鍒�</th>
<th>灞�</th>
- <th>璧拌鍘熺偣</th>
- <th>鍗囬檷鍘熺偣</th>
+ <th>浼镐綅楂樹綆</th>
+ <th>绔欏彴楂樹綆</th>
<th>璐у弶浣嶇疆</th>
- <th>璧拌瀹氫綅</th>
- <th>鍗囬檷瀹氫綅</th>
- <th>鎬ュ仠</th>
- <th>寮傚父鐮�</th>
+ <th>鍨傜洿鏁呴殰</th>
+ <th>姘村钩鏁呴殰</th>
+ <th>鍙夌墮鏁呴殰</th>
+ <th>鐘舵�佹晠闅�</th>
</tr>
</thead>
<tbody>
@@ -70,14 +98,13 @@
<th>鐩爣绔�</th>
<th>婧愬簱浣�</th>
<th>鐩爣搴撲綅</th>
- <th>寮傚父</th>
<th>璧拌閫熷害锛坢/min)</th>
<th>鍗囬檷閫熷害锛坢/min)</th>
<th>鍙夌墮閫熷害锛坢/min)</th>
- <th>璧拌璺濈(Km)</th>
- <th>鍗囬檷璺濈(Km)</th>
- <th>璧拌鏃堕暱(H)</th>
- <th>鍗囬檷鏃堕暱(H)</th>
+ <th>璧拌璺濈(m)</th>
+ <th>鍗囬檷璺濈(m)</th>
+ <th>璧拌鏃堕暱(s)</th>
+ <th>鍗囬檷鏃堕暱(s)</th>
</tr>
</thead>
<tbody>
@@ -114,15 +141,15 @@
</div>
<div class="select-container-item">
<span>鎺�</span>
- <label><input id="sourceRow" type="number" name="points" min="0" style="background-color: #a9eeff" /></label>
+ <label><input id="sourceRow" type="number" name="points" min="1" style="background-color: #a9eeff" value="1" /></label>
</div>
<div class="select-container-item">
<span>鍒�</span>
- <label><input id="sourceBay" type="number" name="points" min="0" style="background-color: #a9eeff" /></label>
+ <label><input id="sourceBay" type="number" name="points" min="0" style="background-color: #a9eeff" value="0" /></label>
</div>
<div class="select-container-item">
<span>灞�</span>
- <label><input id="sourceLev" type="number" name="points" min="0" style="background-color: #a9eeff" /></label>
+ <label><input id="sourceLev" type="number" name="points" min="1" style="background-color: #a9eeff" value="1" /></label>
</div>
</div>
</div>
@@ -136,15 +163,15 @@
</div>
<div class="select-container-item">
<span>鎺�</span>
- <label><input id="row" type="number" name="points" min="0" style="background-color: #a9eeff" /></label>
+ <label><input id="row" type="number" name="points" min="1" style="background-color: #a9eeff" value="1" /></label>
</div>
<div class="select-container-item">
<span>鍒�</span>
- <label><input id="bay" type="number" name="points" min="0" style="background-color: #a9eeff" /></label>
+ <label><input id="bay" type="number" name="points" min="0" style="background-color: #a9eeff" value="0" /></label>
</div>
<div class="select-container-item">
<span>灞�</span>
- <label><input id="lev" type="number" name="points" min="0" style="background-color: #a9eeff" /></label>
+ <label><input id="lev" type="number" name="points" min="1" style="background-color: #a9eeff" value="1" /></label>
</div>
</div>
</div>
@@ -159,9 +186,9 @@
<button class="item" onclick="take()">鍑哄簱</button>
<button class="item" onclick="stockMove()">搴撲綅杞Щ</button>
<button class="item" onclick="siteMove()">绔欏埌绔�</button>
- <button class="item" onclick="bacOrigin()">鍥炲師鐐�</button>
- <button class="item" onclick="reverseOrigin()">鍙嶅師鐐�</button>
- <button class="item" onclick="coorMove()">鍧愭爣绉昏</button>
+<!-- <button class="item" onclick="bacOrigin()">鍥炲師鐐�</button>-->
+<!-- <button class="item" onclick="reverseOrigin()">鍙嶅師鐐�</button>-->
+<!-- <button class="item" onclick="coorMove()">鍧愭爣绉昏</button>-->
<button class="item" onclick="taskComplete()">浠诲姟瀹屾垚</button>
<!-- <button class="item" onclick="pause()">鏆傚仠</button>-->
<!-- <button class="item" onclick="boot()">鍚姩</button>-->
@@ -203,6 +230,7 @@
setInterval(function () {
getCrnOutput();
operatorBlockShow();
+ initDemo();
},500);
// 鍒ゆ柇鎵嬪姩鎿嶄綔妯″潡鏄惁鍙敤
@@ -233,7 +261,7 @@
} else if (res.code === 403) {
window.location.href = baseUrl + "/login";
} else {
- alert(res.msg);
+ console.log(res.msg);
}
}
})
@@ -261,18 +289,18 @@
setVal(tr.children("td").eq(3), table[i-1].loading);
setVal(tr.children("td").eq(4), table[i-1].bay);
setVal(tr.children("td").eq(5), table[i-1].lev);
- setVal(tr.children("td").eq(6), table[i-1].xorigin);
- setVal(tr.children("td").eq(7), table[i-1].yorigin);
+ setVal(tr.children("td").eq(6), table[i-1].liftPos);
+ setVal(tr.children("td").eq(7), table[i-1].sitePos);
setVal(tr.children("td").eq(8), table[i-1].forkOffset);
- setVal(tr.children("td").eq(9), table[i-1].xlocation);
- setVal(tr.children("td").eq(10), table[i-1].ylocation);
- setVal(tr.children("td").eq(11), table[i-1].stop);
- setVal(tr.children("td").eq(12), table[i-1].warnCode);
+ setVal(tr.children("td").eq(9), table[i-1].alarm1);
+ setVal(tr.children("td").eq(10), table[i-1].alarm2);
+ setVal(tr.children("td").eq(11), table[i-1].alarm3);
+ setVal(tr.children("td").eq(12), table[i-1].alarm4);
}
} else if (res.code === 403){
window.location.href = baseUrl+"/login";
} else {
- alert(res.msg);
+ console.log(res.msg);
}
}
});
@@ -301,19 +329,18 @@
setVal(tr.children("td").eq(4), table[i-1].staNo);
setVal(tr.children("td").eq(5), table[i-1].sourceLocNo);
setVal(tr.children("td").eq(6), table[i-1].locNo);
- setVal(tr.children("td").eq(7), table[i-1].error);
- setVal(tr.children("td").eq(8), table[i-1].xspeed);
- setVal(tr.children("td").eq(9), table[i-1].yspeed);
- setVal(tr.children("td").eq(10), table[i-1].zspeed);
- setVal(tr.children("td").eq(11), table[i-1].xdistance);
- setVal(tr.children("td").eq(12), table[i-1].ydistance);
- setVal(tr.children("td").eq(13), table[i-1].xduration);
- setVal(tr.children("td").eq(14), table[i-1].yduration);
+ setVal(tr.children("td").eq(7), table[i-1].xspeed);
+ setVal(tr.children("td").eq(8), table[i-1].yspeed);
+ setVal(tr.children("td").eq(9), table[i-1].zspeed);
+ setVal(tr.children("td").eq(10), table[i-1].xdistance);
+ setVal(tr.children("td").eq(11), table[i-1].ydistance);
+ setVal(tr.children("td").eq(12), table[i-1].xduration);
+ setVal(tr.children("td").eq(13), table[i-1].yduration);
}
} else if (res.code === 403){
window.location.href = baseUrl+"/login";
} else {
- alert(res.msg);
+ console.log(res.msg);
}
}
});
@@ -423,7 +450,7 @@
// 鎵嬪姩澶嶄綅
function handleReset() {
- http.post(baseUrl+"/crn/operator/clearCommand", getReqParam(), function (res) {
+ http.post(baseUrl+"/crn/operator/handleReset", getReqParam(), function (res) {
layer.msg(res.msg);
});
}
@@ -440,7 +467,7 @@
} else if (res.code === 403) {
window.location.href = baseUrl + "/login";
} else {
- alert(res.msg);
+ console.log(res.msg);
}
}
})
@@ -512,7 +539,6 @@
" <td></td>\n" +
" <td></td>\n" +
" <td></td>\n" +
- " <td></td>\n" +
" </tr>\n";
}
$('#crn-msg-table tbody').after(html);
@@ -524,5 +550,72 @@
crnOutputDom.scrollTop = crnOutputDom.scrollHeight;
}
+
+ var crnDemoData;
+ function initDemo() {
+ $.ajax({
+ url: baseUrl+"/crn/demo/status",
+ async: false,
+ method: 'GET',
+ success: function (res) {
+ if (res.code === 200) {
+ crnDemoData = res.data;
+ crnDemoData.forEach(function (e) {
+ $("#demoBtn-"+e.crnNo).html(e.demo?'鍋滄':'婕旂ず');
+ })
+ } else if (res.code === 403){
+ parent.location.href = baseUrl+"/login";
+ } else {
+ layer.msg(res.msg, {icon: 2});
+ }
+ }
+ })
+ }
+
+ function demoSwitch(el) {
+ var crnId = el.split("-")[1];
+ var opt;
+ if (crnDemoData == null) {
+ initDemo();
+ }
+ for (var i = 0; i<crnDemoData.length; i++) {
+ if (Number(crnDemoData[i].crnNo) === Number(crnId)) {
+ opt = !crnDemoData[i].demo;
+ }
+ }
+ layer.confirm(crnId + ' 鍙峰爢鍨涙満纭畾'+ (opt?'寮�濮�':'鍋滄') + '婕旂ず鍚楋紵', function(){
+ doDemo(crnId, 'root', opt); // 鍋滄wcs绯荤粺
+ });
+ }
+
+ function doDemo(crnId, password, opt) {
+ // 鍔犺浇tips
+ var index = layer.load(1, {
+ shade: [0.1,'#fff']
+ });
+ $.ajax({
+ url: baseUrl+ "/crn/demo/switch",
+ headers: {'token': localStorage.getItem('token')},
+ // async: false,
+ data: {
+ crnId: Number(crnId),
+ password: password,
+ opt: opt
+ },
+ method: 'POST',
+ success: function (res) {
+ layer.close(index);
+ if (res.code === 200){
+ layer.msg(res.msg, {icon: 1});
+ } else if (res.code === 403){
+ window.location.href = baseUrl+"/login";
+ } else {
+ layer.msg(res.msg, {icon: 2});
+ }
+ }
+ });
+
+ }
+
</script>
</html>
\ No newline at end of file
--
Gitblit v1.9.1