From f4c155cd69fd0048bb0b1a06b578eb050aedd25b Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期五, 17 二月 2023 15:37:11 +0800
Subject: [PATCH] #
---
src/main/webapp/views/ste.html | 77 +++++++++++++++++++++++++-------------
1 files changed, 51 insertions(+), 26 deletions(-)
diff --git a/src/main/webapp/views/ste.html b/src/main/webapp/views/ste.html
index 47ae428..14a025d 100644
--- a/src/main/webapp/views/ste.html
+++ b/src/main/webapp/views/ste.html
@@ -24,7 +24,7 @@
<div data-steNo="1" class="ste-command-item">
<label>1#</label>
<button class="demoBtn pos-btn">鏁版嵁缁存姢</button>
- <button id="mode-1" class="demoBtn mode-btn" > - </button>
+ <button id="mode-1" class="demoBtn mode-btn" >璁惧淇℃伅</button>
</div>
</div>
<!-- 鍫嗗灈鏈虹姸鎬佷綅淇℃伅 -->
@@ -257,33 +257,58 @@
})
})
+ var layerIdx0;
$(document).on('click ','.mode-btn', function () {
let steNo = Number($(this).parent().attr("data-steNo"));
- layer.confirm("鏀瑰彉" + steNo + ' 鍙风┛姊溅鍦ㄧ嚎鐘舵�佸悧锛�', function(){
- var index = layer.load(1, {
- shade: [0.1,'#fff']
- });
- $.ajax({
- url: baseUrl+ "/ste/mode/switch",
- headers: {'token': localStorage.getItem('token')},
- data: {
- steNo: Number(steNo),
- password: 'root'
- },
- 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});
- }
- }
- });
- });
+ layerIdx0 = layer.open({
+ type: 1,
+ title: false,
+ shadeClose: true,
+ offset: [$(this).offset().top + 30 + 'px', $(this).offset().left + 'px'],
+ anim: 5,
+ shade: [0],
+ area: ['310px', '370px'],
+ closeBtn: 0,
+ content: $("#ste-detl"),
+ success: function(layero, index){
+ http.get(baseUrl+ "/ste/sensor/detl/"+steNo, null, function (res) {
+ $('#steNo').val(steNo);
+
+ })
+ },
+ end: function () {
+ $('#steNo').val("");
+ }
+ })
})
+
+ // $(document).on('click ','.mode-btn', function () {
+ // let steNo = Number($(this).parent().attr("data-steNo"));
+ // layer.confirm("鏀瑰彉" + steNo + ' 鍙风┛姊溅鍦ㄧ嚎鐘舵�佸悧锛�', function(){
+ // var index = layer.load(1, {
+ // shade: [0.1,'#fff']
+ // });
+ // $.ajax({
+ // url: baseUrl+ "/ste/mode/switch",
+ // headers: {'token': localStorage.getItem('token')},
+ // data: {
+ // steNo: Number(steNo),
+ // password: 'root'
+ // },
+ // 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});
+ // }
+ // }
+ // });
+ // });
+ // })
@@ -321,7 +346,7 @@
steStateTableFullRows = table.length;
}
for (let i=1;i<=table.length;i++){
- $("#mode-"+table[i-1].steNo).html(table[i-1].statusVal===0?'鑱旀満':'鑴辨満');
+ // $("#mode-"+table[i-1].steNo).html(table[i-1].statusVal===0?'鑱旀満':'鑴辨満');
let tr = tableEl.find("tr").eq(i);
setVal(tr.children("td").eq(0), table[i-1].steNo);
setVal(tr.children("td").eq(1), table[i-1].statusType);
--
Gitblit v1.9.1