From aa89c9ff1ee7144f5632de8aa2e8a14dc978c85a Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期三, 27 九月 2023 14:13:29 +0800
Subject: [PATCH] 修改是否可以下发的按钮的参数

---
 src/views/visualization.vue |   77 +++++++++++++++++++++++++++-----------
 1 files changed, 54 insertions(+), 23 deletions(-)

diff --git a/src/views/visualization.vue b/src/views/visualization.vue
index 476ee6c..96bb49c 100644
--- a/src/views/visualization.vue
+++ b/src/views/visualization.vue
@@ -1,8 +1,8 @@
 
 <template>
   <div class="home">
-    <!--  -->
-    <template v-if="Tasks&&Tasks.length>0">
+    <!-- v-if="Tasks&&Tasks.length>0" -->
+    <template >
       <div class="left">
         <p class="title">
           <template v-if="Number(ChannelAmount)>1">
@@ -312,7 +312,7 @@
                       </div>
                       <div class="card_top-2">
                         <div style="line-height: 45px; text-align: center">
-                          鐢熶骇涓�
+                          {{ taskData.Procedure.Status==3?'鐢熶骇瀹屾垚':'鐢熶骇涓�' }}
                         </div>
                         <!-- <span class="card-top-r-t">瀹屾垚杩涘害锛�50%</span>
                           <span class="card-top-r-b">12鏈�28鏃� 08:24</span> -->
@@ -344,7 +344,9 @@
               ></p>
               <div class="right-small-btn bottom-box-btn">
                 <el-button type="primary"> 鎵撳嵃</el-button>
+                <el-button v-if="taskData.Procedure.Status==3" type="primary" class="huise"> 瀹屾垚</el-button>
                 <el-popover
+                 v-else
                   placement="top-end"
                   width="160"
                   class="button-finish"
@@ -447,12 +449,25 @@
         <div class="right-top-m">
           璁惧鐘舵��:
           <!-- 1鏂紑2鐢熶骇3寰呮満 -->
-          <span style="position: relative"
-           v-if="plcStatus" >
-            <img v-if="plcStatus == 1" src="../../public/duan.png" />
-            <img v-else src="../../public/lian.png" />
-            <!-- <span class="yuandian"></span> -->
-            {{ plcStatus==1?'鏂紑':(plcStatus==2?'鐢熶骇涓�':'寰呮満') }}
+          <span style="position: relative" v-if="plcStatus" >
+            <el-popover
+              v-if="plcStatus == 1&&plcNotConnected"
+              width="180"
+              :content="plcNotConnected"
+              placement="top-end"
+              trigger="click"
+            >
+              <span slot="reference">
+                <img  src="../../public/duan.png" />
+                鏂紑
+              </span>
+            </el-popover>
+            <span v-else>
+              <img  v-if="plcStatus == 1&&!plcNotConnected"  src="../../public/duan.png" />
+              <img  v-else src="../../public/lian.png" />
+              <!-- <span class="yuandian"></span> -->
+              {{ plcStatus==1?'鏂紑':(plcStatus==2?'鐢熶骇涓�':'寰呮満') }}
+            </span>
           </span>
         </div>
         <div class="right-top-m-btn">
@@ -512,7 +527,7 @@
       </div>
     </template>
     <!--  -->
-    <template v-else>
+    <!-- <template v-else>
       <div class="home-img-box">
         <div class="bg-title">
           <img src="../../public/bg-title.png" />
@@ -543,7 +558,7 @@
         </div>
       </div>
       
-    </template>
+    </template> -->
     <!-- 鎺у埗鐨勫脊妗� -->
     <AddControl ref="control" :Arr="Arr" />
     <!-- 鎺у埗鐨勫脊妗� -->
@@ -686,6 +701,8 @@
       isTipShow:false,
       // isFinsh:0,
       safeProduce:'',
+      // 璁惧鏂紑鐨勫師鍥�
+      plcNotConnected:'',
       ChannelAmount:0,
     };
   },
@@ -716,7 +733,11 @@
         this.getStartArr()
         this.$refs.control.islook=true
       }else{
-        this.$message.error('鐩墠娌℃湁浠诲姟锛�')
+        this.$message({
+          message:'鐩墠娌℃湁浠诲姟锛�',
+          type: 'error',
+          duration: 3 * 1000
+        })
       }
     },
     isTip(val){
@@ -891,7 +912,7 @@
       };
       this.Tasks = [];
       this.TasksCopy=[]
-      getTaskInfo({  }).then((res) => {
+      getTaskInfo({taskMode:2}).then((res) => {
         if (res.code == 200&&res.data) {
           let arr=[]
           if(res.data.Tasks){
@@ -902,6 +923,7 @@
           this.activeName=1;
           this.TasksCopy = res.data.Tasks ? res.data.Tasks : [];
           this.safeProduce=res.data.Prompt.safeProduce?res.data.Prompt.safeProduce:''
+          this.plcNotConnected=res.data.Prompt.plcNotConnected?res.data.Prompt.plcNotConnected:''
           this.ChannelAmount=res.data.ChannelAmount?res.data.ChannelAmount:1
           // if(this.ChannelAmount>1 &&this.TasksCopy.length<2){
           //   this.TasksCopy.push(object)
@@ -958,15 +980,15 @@
                 }, 3000);
           }
         }
-        if (res.code != 200 || this.TasksCopy.length == 0) {
-          this.getcountdown();
-          // 鎺у埗閲嶆柊璇锋眰getTaskInfo, 鍙紑鍚竴涓畾鏃跺櫒
-          if (!this.cutdownTimer) {
-            this.cutdownTimer = setInterval(() => {
-              this.getcountdown();
-            }, 60000);
-          }
-        }
+        // if (res.code != 200 || this.TasksCopy.length == 0) {
+        //   this.getcountdown();
+        //   // 鎺у埗閲嶆柊璇锋眰getTaskInfo, 鍙紑鍚竴涓畾鏃跺櫒
+        //   if (!this.cutdownTimer) {
+        //     this.cutdownTimer = setInterval(() => {
+        //       this.getcountdown();
+        //     }, 60000);
+        //   }
+        // }
         this.cutClick(1)
       });
       // this.TasksCopy.push(object)
@@ -980,7 +1002,7 @@
       //       break;
       //   }
       // }
-      getTaskUnStarted({page:1,pageSize:1}).then(res=>{
+      getTaskInfo({taskMode:1}).then(res=>{
         if(res.code==200){
           this.taskData=res.data.Tasks?res.data.Tasks[0]:{};
           if (this.taskData.Procedure.ID) {
@@ -1402,6 +1424,15 @@
       border: 0;
     }
   }
+  .huise{
+    width: 46%;
+    float: right;
+  }
+  .huise.el-button--primary {
+      background: #CCE8E8;
+      color: #AAAAAA;
+      border: 0;
+    }
 }
 .home {
   width: 100%;

--
Gitblit v1.8.0