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/webapp/views/index.html |   58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 57 insertions(+), 1 deletions(-)

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