From cb0ee1254500db12525f1288c47d7499677d4eb7 Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期三, 23 十月 2024 16:05:23 +0800
Subject: [PATCH] *

---
 src/main/java/com/zy/asrs/controller/ConsoleController.java   |    4 +-
 src/main/webapp/views/index.html                              |   58 ++++++++++++++++++++++++++++
 src/main/java/com/zy/asrs/domain/param/SystemSwitchParam.java |    2 
 3 files changed, 60 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/zy/asrs/controller/ConsoleController.java b/src/main/java/com/zy/asrs/controller/ConsoleController.java
index 193a110..ef02c5b 100644
--- a/src/main/java/com/zy/asrs/controller/ConsoleController.java
+++ b/src/main/java/com/zy/asrs/controller/ConsoleController.java
@@ -49,13 +49,13 @@
     private BasDevpService basDevpService;
 
     @PostMapping("/system/running/status")
-    @ManagerAuth(memo = "绯荤粺杩愯鐘舵��")
+//    @ManagerAuth(memo = "绯荤粺杩愯鐘舵��")
     public R systemRunningStatus(){
         return R.ok().add(Cools.add("status", SystemProperties.WCS_RUNNING_STATUS.get()));
     }
 
     @PostMapping("/system/switch")
-    @ManagerAuth(memo = "绯荤粺杩愯寮�鍏虫搷浣�")
+//    @ManagerAuth(memo = "绯荤粺杩愯寮�鍏虫搷浣�")
     public R systemSwitch(SystemSwitchParam param) throws InterruptedException {
         if (Cools.isEmpty(param.getOperatorType())){
             return R.error();
diff --git a/src/main/java/com/zy/asrs/domain/param/SystemSwitchParam.java b/src/main/java/com/zy/asrs/domain/param/SystemSwitchParam.java
index 02bec5a..6539b27 100644
--- a/src/main/java/com/zy/asrs/domain/param/SystemSwitchParam.java
+++ b/src/main/java/com/zy/asrs/domain/param/SystemSwitchParam.java
@@ -10,7 +10,7 @@
     private Integer operatorType;
 
     // 瀵嗙爜鍙d护
-    private String password;
+    private String password = "root";
 
     public Integer getOperatorType() {
         return operatorType;
diff --git a/src/main/webapp/views/index.html b/src/main/webapp/views/index.html
index e58f38b..a055afc 100644
--- a/src/main/webapp/views/index.html
+++ b/src/main/webapp/views/index.html
@@ -148,7 +148,17 @@
 
             <!-- Stations on outer ring -->
             <div v-for="station in tableDataDev" class="station" :style="{ top: station.valueX + '%', left: station.valueY + '%' }">{{ station.index }}</div>
-
+            <div>
+                <el-switch
+                        style="display: block"
+                        v-model="valueSystem"
+                        active-color="#13ce66"
+                        inactive-color="#ff4949"
+                        active-text="绯荤粺杩愯涓�..."
+                        inactive-text="绯荤粺宸插仠姝�!"
+                        @change='upDateValueSystem'>
+                </el-switch>
+            </div>
             <!-- Buses -->
             <div v-for="bus in tableDataRgv" class="bus" :style="{ top: bus.valueX + '%', left: bus.valueY + '%' , borderColor: bus.modeColor, backgroundColor: bus.statusColor}">{{ bus.index }}</div>
         </div>
@@ -264,6 +274,7 @@
                 activeNames: ['1'],
                 valueLeft: '0',
                 valueRight: '0',
+                valueSystem: false,
                 tableDataRgv: [],
                 tableDataDev: [],
                 energyGatheringRing: [],
@@ -283,6 +294,7 @@
                     this.getTableDataTrack()
                     this.getTableDataLeft()
                     this.getTableDataRight()
+                    this.getValueSystem()
 
                     setInterval(() => {
                         this.getTableDataRgv()
@@ -290,6 +302,8 @@
                         this.getTableDataTrack()
                         this.getTableDataLeft()
                         this.getTableDataRight()
+                        this.getValueSystem()
+
                     }, 1000)
                 },
                 handleChange(val) {
@@ -328,6 +342,48 @@
                     }
                     return '';
                 },
+                getValueSystem() {
+                    let that = this;
+                    $.ajax({
+                        url: baseUrl + "/console/system/running/status",
+                        headers: {
+                            'token': localStorage.getItem('token')
+                        },
+                        data: {},
+                        dataType: 'json',
+                        contentType: 'application/json;charset=UTF-8',
+                        method: 'post',
+                        success: function (res) {
+                            that.valueSystem = res.data.status
+                        }
+                    });
+                },
+                upDateValueSystem: function (){
+                    let that = this;
+                    let operatorTypeI = 0;
+                    if (that.valueSystem){
+                        operatorTypeI = 1;
+                    }
+                    $.ajax({
+                        url: baseUrl + "/console/system/switch",
+                        headers: {
+                            'token': localStorage.getItem('token')
+                        },
+                        data: {
+                            operatorType : operatorTypeI
+                        },
+                        method: 'POST',
+                        success: function (res) {
+                            if (res.code === 200) {
+                                if (res.data.status) {
+                                    that.valueSystem = true;
+                                } else {
+                                    that.valueSystem = false;
+                                }
+                            }
+                        }
+                    });
+                },
                 getTableDataLeft() {
                     let that = this;
                     $.ajax({

--
Gitblit v1.9.1