From cefff061f4508fc2942c5a8fe199e13b15454c9f Mon Sep 17 00:00:00 2001
From: vincent <1341870251@qq.com>
Date: 星期二, 02 六月 2020 17:09:52 +0800
Subject: [PATCH] #

---
 src/main/webapp/views/console.html |   73 ++++++++++++++++++++++++++----------
 1 files changed, 52 insertions(+), 21 deletions(-)

diff --git a/src/main/webapp/views/console.html b/src/main/webapp/views/console.html
index 41d6737..46d3740 100644
--- a/src/main/webapp/views/console.html
+++ b/src/main/webapp/views/console.html
@@ -21,8 +21,8 @@
 <header>
     <!-- 绯荤粺杩愯鐘舵�� -->
     <div class="system-state">
-        <div class="system-icon"></div>
-        <span>绯荤粺杩愯涓�...</span>
+        <div id="system-icon" class="system-icon-open" onclick="systemSwitch()"></div>
+        <span id="system-run-desc">绯荤粺杩愯涓�...</span>
     </div>
 
     <!-- 淇℃伅灞曠ず -->
@@ -399,14 +399,10 @@
             <span class="row-no">1#</span>
         </div>
     </div>
-
-    <!-- 鍙宠緭閫佺嚎 -->
-    <!--<input id="val" type="text">-->
-    <!--<button id="animate">animate</button>-->
 </main>
 </body>
 <script>
-
+    var systemRunning = true;
     var crn1Position = 0;
     var crn2Position = 0;
     // 鍒濆鍖�
@@ -414,9 +410,57 @@
     getCrnInfo();
     // 瀹炴椂璁块棶
     setInterval(function () {
-        getSitesInfo();
         getCrnInfo();
     }, 500);
+    setInterval(function () {
+        getSitesInfo();
+    }, 3000);
+
+    // 绯荤粺杩愯寮�鍏�
+    function systemSwitch() {
+        if (systemRunning){
+            var confirm = layer.confirm('纭畾鍏抽棴 WCS 绯荤粺锛�!', {
+                btn: ['纭畾','鍙栨秷']
+            }, function(){
+                layer.close(confirm);
+                var index = null;
+                index = layer.load(1, {
+                    shade: [0.1,'#fff']
+                });
+                setTimeout(function () {
+                    if (systemRunning){
+                        $('#system-icon').attr("class", "system-icon-close");
+                        $('#system-run-desc').html("绯荤粺宸插仠姝�!");
+                        systemRunning = false;
+                    } else {
+                        $('#system-icon').attr("class", "system-icon-open");
+                        $('#system-run-desc').html("绯荤粺杩愯涓�...");
+                        systemRunning = true;
+                    }
+                    layer.close(index);
+                }, 2000);
+            }, function(){
+
+            });
+        } else {
+            var index = null;
+            index = layer.load(1, {
+                shade: [0.1,'#fff']
+            });
+            setTimeout(function () {
+                if (systemRunning){
+                    $('#system-icon').attr("class", "system-icon-close");
+                    $('#system-run-desc').html("绯荤粺宸插仠姝�!");
+                    systemRunning = false;
+                } else {
+                    $('#system-icon').attr("class", "system-icon-open");
+                    $('#system-run-desc').html("绯荤粺杩愯涓�...");
+                    systemRunning = true;
+                }
+                layer.close(index);
+            }, 2000);
+        }
+    }
 
     // 杈撻�佽澶囧疄鏃舵暟鎹幏鍙�
     function getSitesInfo(){
@@ -448,7 +492,6 @@
             success: function (res) {
                 if (res.code === 200){
                     var crns = res.data;
-                    console.log(crns);
                     for (var i = 0; i < crns.length; i++){
                         crnAnimate(crns[i].crnId, crns[i].offset);
                     }
@@ -494,18 +537,6 @@
                 break
         }
     }
-
-
-    $('.item').on('click', function () {
-        layer.open({
-            type: 1,
-            shadeClose: true, //鐐瑰嚮閬僵鍏抽棴灞�
-            content: 'text'
-        });
-    });
-    $('#animate').click(function () {
-        crnAnimate(1, $('#val').val());
-    });
 
 </script>
 </html>
\ No newline at end of file

--
Gitblit v1.9.1