From 7ea7fa055306a766420d578f508a7dc358afebc1 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期四, 25 八月 2022 14:09:16 +0800
Subject: [PATCH] #

---
 src/main/webapp/views/ste.html |  159 +++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 124 insertions(+), 35 deletions(-)

diff --git a/src/main/webapp/views/ste.html b/src/main/webapp/views/ste.html
index 9734584..85a8c0b 100644
--- a/src/main/webapp/views/ste.html
+++ b/src/main/webapp/views/ste.html
@@ -96,9 +96,8 @@
                                 <th>鎺�</th>
                                 <th>鍒�</th>
                                 <th>灞�</th>
-                                <th>璐у弶瀹氫綅</th>
-                                <th>杞借揣鍙板畾浣�</th>
-                                <th>璧拌鍦ㄥ畾浣�</th>
+                                <th>绛夊緟WCS纭</th>
+                                <th>瀹氫綅</th>
                                 <th>鎶ヨ淇℃伅1</th>
                                 <th>鎶ヨ淇℃伅2</th>
                             </tr>
@@ -114,20 +113,14 @@
                     <thead>
                         <tr>
                             <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>
-                            <th>鐩樼偣鏁伴噺</th>
-                            <th>绌挎鏉垮氨缁�</th>
-                            <th>鍏呯數妗╁彿</th>
-                            <th>鍫嗗灈鏈鸿繍琛�</th>
-                            <th>鍫嗗灈鏈轰几鍙�</th>
-                            <th>鍫嗗灈鏈烘惉绉�</th>
                         </tr>
                     </thead>
                     <tbody>
@@ -159,24 +152,22 @@
                     <fieldset>
                         <legend>鎵嬪姩鎿嶄綔</legend>
                         <div class="button-group">
-                            <button class="item" onclick="leftTake()">宸﹀嚭搴�</button>
-                            <button class="item" onclick="rightTake()">鍙冲嚭搴�</button>
-                            <button class="item" onclick="leftPut()">宸﹀叆搴�</button>
-                            <button class="item" onclick="rightPut()">鍙冲叆搴�</button>
-                            <button class="item" onclick="leftStockMove()">宸︾Щ搴�</button>
-                            <button class="item" onclick="rightStockMove()">鍙崇Щ搴�</button>
-                            <button class="item" onclick="oOrigin()">鍘熺偣</button>
-                            <button class="item" onclick="farPoint()">杩滅偣</button>
-                            <button class="item" onclick="aPoint()">A 鐐�</button>
-                            <button class="item" onclick="bPoint()">B 鐐�</button>
-                            <button class="item" onclick="moveLift()">宸︽惉绉�</button>
-                            <button class="item" onclick="moveRight()">鍙虫惉绉�</button>
-                            <button class="item" onclick="charging()">鍏呯數</button>
-                            <button class="item" onclick="pause()">宸︾洏鐐�</button>
-                            <button class="item" onclick="boot()">鍙崇洏鐐�</button>
-                            <button class="item" onclick="boot()">浠诲姟瀹屾垚</button>
-                            <button class="item" onclick="clearCommand()">娓呴櫎鍛戒护</button>
-                            <button class="item" onclick="handleReset()">澶嶄綅</button>
+                            <button class="item" onclick="steOperator(1)">宸﹀嚭搴�</button>
+                            <button class="item" onclick="steOperator(2)">鍙冲嚭搴�</button>
+                            <button class="item" onclick="steOperator(3)">宸﹀叆搴�</button>
+                            <button class="item" onclick="steOperator(4)">鍙冲叆搴�</button>
+                            <button class="item" onclick="steOperator(5)">宸︾Щ搴�</button>
+                            <button class="item" onclick="steOperator(6)">鍙崇Щ搴�</button>
+                            <button class="item" onclick="steOperator(7)">鍘熺偣</button>
+                            <button class="item" onclick="steOperator(8)">杩滅偣</button>
+                            <button class="item" onclick="steOperator(9)">A 鐐�</button>
+                            <button class="item" onclick="steOperator(10)">B 鐐�</button>
+                            <button class="item" onclick="steOperator(11)">宸︽惉绉�</button>
+                            <button class="item" onclick="steOperator(12)">鍙虫惉绉�</button>
+                            <button class="item" onclick="steOperator(13)">鍏呯數</button>
+                            <button class="item" onclick="steOperator(14)">宸︾洏鐐�</button>
+                            <button class="item" onclick="steOperator(15)">鍙崇洏鐐�</button>
+                            <button class="item" onclick="steOperator(16)">浠诲姟瀹屾垚</button>
                         </div>
                     </fieldset>
                 </div>
@@ -218,7 +209,12 @@
 
     setInterval(function () {
         getSteStateInfo()
+        getSteMsgInfo();
     },1000)
+    setInterval(function () {
+        getSteOutput();
+        operatorBlockShow();
+    },500);
 
     // 鍒ゆ柇鎵嬪姩鎿嶄綔妯″潡鏄惁鍙敤
     function operatorBlockShow() {
@@ -240,14 +236,107 @@
 
     // 绌挎杞︿俊鎭〃鑾峰彇 ---- 琛ㄤ竴
     function getSteStateInfo() {
-        let tableEl = $('ste-state-table');
+        let tableEl = $('#ste-state-table');
+        $.ajax({
+            url: baseUrl+ "/ste/table/ste/state",
+            headers: {'token': localStorage.getItem('token')},
+            method: 'POST',
+            success: function (res) {
+                if (res.code === 200){
+                    let table = res.data;
+                    if (table.length > steStateTableBlankRows && table.length !== steStateTableFullRows) {
+                        initSteStateTable(table.length-steStateTableBlankRows);
+                        steStateTableFullRows = table.length;
+                    }
+                    for (let i=1;i<=table.length;i++){
+                        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);
+                        setVal(tr.children("td").eq(2), table[i-1].status);
+                        setVal(tr.children("td").eq(3), table[i-1].loading);
+                        setVal(tr.children("td").eq(4), table[i-1].track);
+                        setVal(tr.children("td").eq(5), table[i-1].charge);
+                        setVal(tr.children("td").eq(6), table[i-1].row);
+                        setVal(tr.children("td").eq(7), table[i-1].bay);
+                        setVal(tr.children("td").eq(8), table[i-1].lev);
+                        setVal(tr.children("td").eq(9), table[i-1].waiting);
+                        setVal(tr.children("td").eq(10), table[i-1].loca);
+                        setVal(tr.children("td").eq(11), table[i-1].alarm1);
+                        setVal(tr.children("td").eq(12), table[i-1].alarm2);
+                    }
+                } else if (res.code === 403){
+                    window.location.href = baseUrl+"/login";
+                }  else {
+                    console.log(res.msg);
+                }
+            }
+        });
     }
 
     // 绌挎杞︽暟鎹〃鑾峰彇 ---- 琛ㄤ簩
     function getSteMsgInfo() {
         let tableEl = $('#ste-msg-table');
+        $.ajax({
+            url: baseUrl+ "/ste/table/ste/msg",
+            headers: {'token': localStorage.getItem('token')},
+            method: 'POST',
+            success: function (res) {
+                if (res.code === 200){
+                    var table = res.data;
+                    if (table.length > steMsgTableBlankRows && table.length !== steMsgTableFullRows) {
+                        initSteMsgTable(table.length-steMsgTableBlankRows);
+                        steMsgTableFullRows = table.length;
+                    }
+                    for (var i=1;i<=table.length;i++){
+                        var 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].workNo);
+                        setVal(tr.children("td").eq(2), table[i-1].status);
+                        setVal(tr.children("td").eq(3), table[i-1].sourceStaNo);
+                        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].speed);
+                        setVal(tr.children("td").eq(8), table[i-1].closer);
+                    }
+                } else if (res.code === 403){
+                    window.location.href = baseUrl+"/login";
+                }  else {
+                    console.log(res.msg);
+                }
+            }
+        });
     }
 
+    // 绌挎杞︽棩蹇楄緭鍑� -----------------------------------------------------------------------
+    function getSteOutput() {
+        $.ajax({
+            url: baseUrl + "/ste/output/ste",
+            headers: {'token': localStorage.getItem('token')},
+            method: 'POST',
+            success: function (res) {
+                if (res.code === 200) {
+                    steOutput(res.data);
+                } else if (res.code === 403) {
+                    window.location.href = baseUrl + "/login";
+                } else {
+                    console.log(res.msg);
+                }
+            }
+        })
+    }
+
+    // 浠诲姟鎸囦护涓嬪彂
+    function steOperator(steTaskMode) {
+        http.post(baseUrl+"/ste/operator/ste", {
+            steNo: $('input[name="steSelect"]:checked').val(),
+            steTaskMode: steTaskMode
+        }, function (res) {
+            layer.msg(res.msg, {icon: 1});
+        });
+    }
+
+
     // ------------------------------------------------------------------------------------------------
 
     // 绌挎杞︿俊鎭〃鑾峰彇  ----- 琛ㄤ竴

--
Gitblit v1.9.1