From 724f42c61e81de643ff94256b2ab3661533f5106 Mon Sep 17 00:00:00 2001
From: wankeda <Administrator@DESKTOP-HAU3ST3>
Date: 星期五, 25 四月 2025 10:47:56 +0800
Subject: [PATCH] 代码提交

---
 代码管理/成品库大屏/U01bigscreen/U01bigscreen/src/views/center.vue |  347 +++++++++++++++++++++++++++++++--------------------------
 1 files changed, 191 insertions(+), 156 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/\346\210\220\345\223\201\345\272\223\345\244\247\345\261\217/U01bigscreen/U01bigscreen/src/views/center.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/\346\210\220\345\223\201\345\272\223\345\244\247\345\261\217/U01bigscreen/U01bigscreen/src/views/center.vue"
index 0e146c3..4e20af5 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/\346\210\220\345\223\201\345\272\223\345\244\247\345\261\217/U01bigscreen/U01bigscreen/src/views/center.vue"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/\346\210\220\345\223\201\345\272\223\345\244\247\345\261\217/U01bigscreen/U01bigscreen/src/views/center.vue"
@@ -6,7 +6,9 @@
         v-for="item in titleItem"
         :key="item.title"
       >
-        <p class="ml-3 colorWhite fw-b fs-xl" style="font-size:18px">{{ item.title }}</p>
+        <p class="ml-3 colorWhite fw-b fs-xl" style="font-size: 18px">
+          {{ item.title }}
+        </p>
         <div>
           <dv-digital-flop
             class="dv-dig-flop ml-1 mt-2 pl-3"
@@ -29,39 +31,56 @@
           style="width:300px;height:400px;font-size:30px"
         />
       </div> -->
-      <div class="water" style="margin-left: 35px;">
-          <div class="ranking bg-color-black" style="width: 912px;">
-            <div style="margin-top: 8px;">
-              <span>
+      <div class="water" style="margin-left: 35px">
+        <div class="ranking bg-color-black" style="width: 912px">
+          <div style="margin-top: 8px">
+            <span>
               <icon name="chart-area" class="text-icon"></icon>
-              </span>
-              <span class="fs-xl text mx-2 mb-1 pl-3" style="font-size:20px">缂撳瓨鍖鸿揣浣嶇姸鎬�</span>
-            </div>
-            <div style="width: 880px;height:220px;margin: 20px auto;display: flex;flex-wrap: wrap; justify-content: space-around;">
-              <div v-for="item in locationData" :key="item.index" class="location" :class="item.state?'success':'error'">
-                <div style="height: 45px;line-height: 45px;">{{item.name}}</div>
-                <div style="height: 45px;line-height: 22.5px;">{{item.stateName}}</div>
+            </span>
+            <span class="fs-xl text mx-2 mb-1 pl-3" style="font-size: 20px"
+              >缂撳瓨鍖鸿揣浣嶇姸鎬�</span
+            >
+          </div>
+          <div
+            style="
+              width: 880px;
+              height: 220px;
+              margin: 20px auto;
+              display: flex;
+              flex-wrap: wrap;
+              justify-content: space-around;
+            "
+          >
+            <div
+              v-for="item in locationData"
+              :key="item.index"
+              class="location"
+              :class="getStateClass(item.state)"
+            >
+              <div style="height: 45px; line-height: 45px">{{ item.name }}</div>
+              <div style="height: 45px; line-height: 22.5px">
+                {{ item.stateName }}
               </div>
             </div>
-            <div style="margin-top: 8px;">
-              <span>
+          </div>
+          <div style="margin-top: 8px">
+            <span>
               <icon name="chart-area" class="text-icon"></icon>
-              </span>
-              <!-- <span class="fs-xl text mx-2 mb-1 pl-3" style="font-size:20px">W61婊氱瓛绾夸俊鍙风洃鎺�</span> -->
-            </div>
-            <!-- <div style="width: 850px;height:50px;line-height: 50px;margin: 20px auto;font-size: 20px;display: flex;">
+            </span>
+            <!-- <span class="fs-xl text mx-2 mb-1 pl-3" style="font-size:20px">W61婊氱瓛绾夸俊鍙风洃鎺�</span> -->
+          </div>
+          <!-- <div style="width: 850px;height:50px;line-height: 50px;margin: 20px auto;font-size: 20px;display: flex;">
               璇锋眰閾茶繍淇″彿:<div style="width: 60px;height: 30px;margin: 10px 18px;" :class="isShovel?'show':'noshow'"></div>
               鍏佽閾茶繍淇″彿:<div style="width: 60px;height: 30px;margin: 10px 18px;" :class="isAllow?'show':'noshow'"></div>
             </div> -->
-          </div>
-      </div>    
+        </div>
+      </div>
     </div>
   </div>
- 
 </template>
 
 <script>
-import axios from "@/api/ajax.js"
+import axios from "@/api/ajax.js";
 export default {
   data() {
     return {
@@ -88,178 +107,188 @@
       //   carousel: "single",
       //   unit: "鎵�",
       // },
-      isSetinterval:true,
-      locationData:[
+      isSetinterval: true,
+      locationData: [
         {
-          name:"1鍙风紦瀛�",
-          state:false,
-          stateName:"绌烘《鍏ュ簱宸插垎閰嶈揣浣嶅緟鎵ц"
+          name: "1鍙风紦瀛�",
+          state: true,
+          stateName: "",
         },
         {
-          name:"2鍙风紦瀛�",
-          state:true,
-          stateName:""
+          name: "2鍙风紦瀛�",
+          state: true,
+          stateName: "",
         },
         {
-          name:"3鍙风紦瀛�",
-          state:true,
-          stateName:""
-        },{
-          name:"4鍙风紦瀛�",
-          state:true,
-          stateName:""
+          name: "3鍙风紦瀛�",
+          state: true,
+          stateName: "",
         },
         {
-          name:"5鍙风紦瀛�",
-          state:true,
-          stateName:""
+          name: "4鍙风紦瀛�",
+          state: true,
+          stateName: "",
         },
         {
-          name:"6鍙风紦瀛�",
-          state:true,
-          stateName:""
+          name: "5鍙风紦瀛�",
+          state: true,
+          stateName: "",
         },
         {
-          name:"7鍙风紦瀛�",
-          state:true,
-          stateName:""
+          name: "6鍙风紦瀛�",
+          state: true,
+          stateName: "",
         },
         {
-          name:"8鍙风紦瀛�",
-          state:true,
-          stateName:""
+          name: "7鍙风紦瀛�",
+          state: true,
+          stateName: "",
         },
         {
-          name:"9鍙风紦瀛�",
-          state:true,
-          stateName:""
+          name: "8鍙风紦瀛�",
+          state: true,
+          stateName: "",
         },
         {
-          name:"10鍙风紦瀛�",
-          state:true,
-          stateName:""
+          name: "9鍙风紦瀛�",
+          state: true,
+          stateName: "",
         },
         {
-          name:"11鍙风紦瀛�",
-          state:true,
-          stateName:""
+          name: "10鍙风紦瀛�",
+          state: true,
+          stateName: "",
         },
         {
-          name:"12鍙风紦瀛�",
-          state:true,
-          stateName:""
+          name: "11鍙风紦瀛�",
+          state: true,
+          stateName: "",
         },
         {
-          name:"13鍙风紦瀛�",
-          state:true,
-          stateName:""
+          name: "12鍙风紦瀛�",
+          state: true,
+          stateName: "",
         },
-               {
-          name:"14鍙风紦瀛�",
-          state:true,
-          stateName:""
+        {
+          name: "13鍙风紦瀛�",
+          state: true,
+          stateName: "",
         },
-               {
-          name:"15鍙风紦瀛�",
-          state:true,
-          stateName:""
+        {
+          name: "14鍙风紦瀛�",
+          state: true,
+          stateName: "",
         },
-               {
-          name:"16鍙风紦瀛�",
-          state:true,
-          stateName:""
+        {
+          name: "15鍙风紦瀛�",
+          state: true,
+          stateName: "",
         },
-               {
-          name:"17鍙风紦瀛�",
-          state:true,
-          stateName:""
+        {
+          name: "16鍙风紦瀛�",
+          state: true,
+          stateName: "",
         },
-               {
-          name:"18鍙风紦瀛�",
-          state:true,
-          stateName:""
+        {
+          name: "17鍙风紦瀛�",
+          state: true,
+          stateName: "",
         },
-               {
-          name:"19鍙风紦瀛�",
-          state:true,
-          stateName:""
+        {
+          name: "18鍙风紦瀛�",
+          state: true,
+          stateName: "",
         },
-               {
-          name:"20鍙风紦瀛�",
-          state:true,
-          stateName:""
+        {
+          name: "19鍙风紦瀛�",
+          state: true,
+          stateName: "",
+        },
+        {
+          name: "20鍙风紦瀛�",
+          state: true,
+          stateName: "",
         },
       ],
-      isAllow:true,
-      isShovel:false,
-      isCache:true
+      isAllow: true,
+      isShovel: false,
+      isCache: true,
     };
   },
-  mounted(){
-      // this.getTaskinfoList();
-      this.getCacheStatus();
+  mounted() {
+    // this.getTaskinfoList();
+    this.getCacheStatus();
+  },
+  methods: {
+    getStateClass(state) {
+      switch (state) {
+        case 0:
+          return "state-0";
+        case 1:
+          return "state-1";
+        case 2:
+          return "state-2";
+        default:
+          return "state-default";
+      }
     },
-    methods: {
-      getTaskinfoList(){
-        axios.post("/api/LED/TaskinfoList", null, "").then((res)=>{
-          if(res.data.status){
-            var data=res.data.data;
-            var arrTasks=[];
-            data.list.forEach(x=> {
-              arrTasks.push(
-                {
-                  name: "<span style='font-size:16px'>"+ x.name +"</span>",
-                  value: x.count,
-                }
-              )
+    getTaskinfoList() {
+      axios.post("/api/LED/TaskinfoList", null, "").then((res) => {
+        if (res.data.status) {
+          var data = res.data.data;
+          var arrTasks = [];
+          data.list.forEach((x) => {
+            arrTasks.push({
+              name: "<span style='font-size:16px'>" + x.name + "</span>",
+              value: x.count,
             });
-            this.ranking={
-              data: arrTasks,
-              carousel: "single",
-              unit: "鎵�",
-            }
-            if(this.isSetinterval){
-              setInterval(() => {
-                this.getTaskinfoList();
-                this.isSetinterval=false;
-              }, 5000);
-            }
+          });
+          this.ranking = {
+            data: arrTasks,
+            carousel: "single",
+            unit: "鎵�",
+          };
+          if (this.isSetinterval) {
+            setInterval(() => {
+              this.getTaskinfoList();
+              this.isSetinterval = false;
+            }, 5000);
           }
-        })
-      },
-      getCacheStatus(){
-                // axios.post("http://192.168.2.51:9290/api/Task/CacheStatus", {
-                  axios.post("http://127.0.0.1:9290/api/Task/CacheStatus", {
-        MainData: {
-          AGVName: "505"
         }
-      }).then((res)=>{
-          if(res.data.status){
-            
-            var data=res.data.data;
+      });
+    },
+    getCacheStatus() {
+      // axios.post("http://192.168.2.51:9290/api/Task/CacheStatus", {
+      axios
+        .post("http://127.0.0.1:9290/api/Task/CacheStatus", {
+          MainData: {
+            AGVName: "505",
+          },
+        })
+        .then((res) => {
+          if (res.data.status) {
+            var data = res.data.data;
             console.log(data);
-            this.locationData=[];
-            data.list.forEach(x=> {
-              this.locationData.push(
-                {
-                  name:x.name+ "鍙风紦瀛樹綅",
-                  state:x.state,
-                  stateName:x.statename
-                }
-              )
+            this.locationData = [];
+            data.list.forEach((x) => {
+              this.locationData.push({
+                name: x.name + "鍙风紦瀛樹綅",
+                state: x.state,
+                stateName: x.statename,
+              });
             });
-            this.isAllow=data.isAllow;
-            this.isShovel=data.isShovel;
-            if(this.isCache){
+            this.isAllow = data.isAllow;
+            this.isShovel = data.isShovel;
+            if (this.isCache) {
               setInterval(() => {
                 this.getCacheStatus();
-                this.isCache=false;
+                this.isCache = false;
               }, 5000);
             }
           }
-        })
-      }
-    }
+        });
+    },
+  },
 };
 </script>
 
@@ -267,7 +296,7 @@
 #center {
   display: flex;
   flex-direction: column;
-  .location{
+  .location {
     font-size: 18px;
     font-weight: bold;
     height: 90px;
@@ -275,20 +304,26 @@
     flex: 0 0 13%;
     text-align: center;
   }
-  .success{
+  .state-0 {
     background-color: #609c41;
   }
-  .error{
+  .state-1 {
     background-color: red;
   }
-  .show{
+  .state-2 {
+    background-color: orange;
+  }
+  &.state-default {
+    background-color: gray; // Default color if state is unexpected
+  }
+  .show {
     background-color: aqua;
   }
-  .noshow{
+  .noshow {
     background-color: gray;
   }
   .up {
-    width: 1280PX;
+    width: 1280px;
     display: flex;
     flex-wrap: wrap;
     justify-content: space-around;
@@ -339,7 +374,7 @@
         }
       }
       .dv-wa-le-po {
-  margin-left: 1000px;
+        margin-left: 1000px;
         .dv-wa-le-po {
           height: 120px;
         }

--
Gitblit v1.9.3