From 722231fc31750241c78a63ce7934905ca1892cd9 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期一, 25 九月 2023 16:28:57 +0800
Subject: [PATCH] 距离任务 倒计时  为0的时候筛选获取任务的接口

---
 src/views/visualization.vue |   22 +++++++++++++++++-----
 1 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/src/views/visualization.vue b/src/views/visualization.vue
index aab6145..5d2284a 100644
--- a/src/views/visualization.vue
+++ b/src/views/visualization.vue
@@ -665,6 +665,7 @@
       TaskCount:0,
       plcStatus:0,
       isTipShow:false,
+      isFinsh:0,
     };
   },
   mounted() {
@@ -680,6 +681,13 @@
       this.getDate2();
     }, 5000);
     this.getTaskInfo();
+  },
+  watch:{
+    isFinsh(){
+      if(this.isFinsh==this.Tasks.length){
+        this.getStartArr()
+      }
+    }
   },
   methods: {
     taskClick(){
@@ -712,6 +720,9 @@
           this.countDownMinute = res.data.CountDownMinute
             ? res.data.CountDownMinute
             : 0;
+            if(this.countDownHour==0&& this.countDownMinute==0){
+              this.getTaskInfo();
+            }
         }
       });
     },
@@ -881,29 +892,30 @@
               .procedure.workers
               ? this.Tasks[i].Procedure.procedure.workers
               : [];
+
             this.Tasks[i].procedureList.push([
               {
                 name: "宸ュ簭",
                 ...this.Tasks[i].Procedure.procedure,
               },
             ]);
-            
+           
             if (this.Tasks[i].Procedure.ID) {
               startTask({ id: this.Tasks[i].Procedure.ID }).then((res) => {
                 if (res.code == 200) {
                   // res.data.number
                   this.Tasks[i].procedureList[0].push({
                     number: res.data.Number,
-                    name: "宸ヨ壓",
-                    Arr:res.data.Params ? res.data.Params : [],
                   });
+                  this.Tasks[i].Arr=res.data.Params ? res.data.Params : []
+                  this.isFinsh=Number(i)+1
                 }
               });
             }
             this.setInterCard("inputMaterials", "cardBox1&" + i, i);
             this.setInterCard("outputMaterials", "cardBox3&" + i, i);
           }
-          this.getStartArr()
+        
           this.getProgressInfo();
               if (!this.procInfoTimer) {
                 this.procInfoTimer = setInterval(() => {
@@ -928,7 +940,7 @@
     getStartArr(){
       for (let i in this.Tasks) {
         if (this.Tasks[i].Procedure.Status==1) {
-            this.Arr = this.Tasks[i].procedureList[0].Arr ?this.Tasks[i].procedureList[0].Arr: [];
+            this.Arr = this.Tasks[i].Arr ?this.Tasks[i].Arr: [];
             this.taskData=this.Tasks[i];
             break;
         }

--
Gitblit v1.8.0