From 6b8225e9d81cb6bfa0efeed2f0a02428eb3a86d1 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期四, 22 九月 2022 10:43:37 +0800
Subject: [PATCH] #

---
 src/main/webapp/views/ste.html |   38 ++++++++++++++++++++++++++++++++++++--
 1 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/src/main/webapp/views/ste.html b/src/main/webapp/views/ste.html
index 41feab5..7c60c8d 100644
--- a/src/main/webapp/views/ste.html
+++ b/src/main/webapp/views/ste.html
@@ -24,14 +24,17 @@
                     <div data-steNo="1" class="ste-command-item" style="margin-top: 30px">
                         <label>1#</label>
                         <button class="demoBtn pos-btn">鏁版嵁缁存姢</button>
+                        <button id="mode-1" class="demoBtn mode-btn" > - </button>
                     </div>
                     <div data-steNo="2" class="ste-command-item" style="margin-top: 30px">
                         <label>2#</label>
                         <button class="demoBtn pos-btn">鏁版嵁缁存姢</button>
+                        <button id="mode-2" class="demoBtn mode-btn" > - </button>
                     </div>
                     <div data-steNo="3" class="ste-command-item" style="margin-top: 30px">
                         <label>3#</label>
                         <button class="demoBtn pos-btn">鏁版嵁缁存姢</button>
+                        <button id="mode-3" class="demoBtn mode-btn" > - </button>
                     </div>
                 </div>
                 <!-- 鍫嗗灈鏈虹姸鎬佷綅淇℃伅 -->
@@ -106,8 +109,8 @@
                     <fieldset>
                         <legend>鎵嬪姩鎿嶄綔</legend>
                         <div class="button-group">
-                            <button class="item" onclick="steOperator(17)">鑱旀満</button>
-                            <button class="item" onclick="steOperator(18)">鑴辨満</button>
+                            <button class="item" onclick="steOperator(99)">鑱旀満</button>
+                            <button class="item" onclick="steOperator(100)">鑴辨満</button>
                             <button class="item" onclick="steOperator(1)">鍚戝乏鍑哄簱</button>
                             <button class="item" onclick="steOperator(2)">鍚戝彸鍑哄簱</button>
                             <button class="item" onclick="steOperator(3)">浠庡乏鍏ュ簱</button>
@@ -265,6 +268,36 @@
         })
     })
 
+    $(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});
+                    }
+                }
+            });
+        });
+    })
+
+
+
     $(document).on('click ','#save', function () {
         http.post(baseUrl+ "/ste/detl/update", {
             steNo: $('#steNo').val(),
@@ -299,6 +332,7 @@
                         steStateTableFullRows = table.length;
                     }
                     for (let i=1;i<=table.length;i++){
+                        $("#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