From 2f9bdedfecd2b71ff6062563d716eaa81b010739 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期三, 27 九月 2023 17:48:22 +0800
Subject: [PATCH] 因为目前数据是循环动态的,输入 输出资源的动画问题修改

---
 src/views/visualization.vue |   63 +++++++++++++++++++++++--------
 1 files changed, 47 insertions(+), 16 deletions(-)

diff --git a/src/views/visualization.vue b/src/views/visualization.vue
index aa8ee94..bb3fe69 100644
--- a/src/views/visualization.vue
+++ b/src/views/visualization.vue
@@ -1,6 +1,6 @@
 
 <template>
-  <div class="home">
+  <div class="home" ref="homeRef">
     <!-- v-if="Tasks&&Tasks.length>0" -->
     <template >
       <div class="left">
@@ -25,9 +25,9 @@
               style="float: left;"
               @click="cutClick(3)"
             >
-              <img style="width:32px;" v-if="activeName == 3" src="../../public/one-blue.png" />
+              <img style="width:32px;" v-if="activeName == 3" src="../../public/right-blue.png" />
               <span  v-else>
-                <img style="width:32px;" src="../../public/one.png" />
+                <img style="width:32px;" src="../../public/right.png" />
               </span>
             </span>
          </template>
@@ -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"
@@ -359,7 +361,6 @@
                     <el-button
                       type="primary"
                       size="mini"
-                      :disabled="taskData.Procedure.Status==3?true:false"
                       class="color_f70f83"
                       @click="finishClick(index, taskData)"
                     >
@@ -448,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">
@@ -687,6 +701,8 @@
       isTipShow:false,
       // isFinsh:0,
       safeProduce:'',
+      // 璁惧鏂紑鐨勫師鍥�
+      plcNotConnected:'',
       ChannelAmount:0,
     };
   },
@@ -837,11 +853,16 @@
     setInterCard(value, name, i) {
       if (this.TasksCopy[i].Procedure.procedure[value]!=null) {
         let height = 200;
-        let num = 1;
-        if (this.$refs[name]) {
-          height = this.$refs[name].$el?this.$refs[name].$el.offsetHeight:200;
-          num = Math.floor(height / 80);
+        let num = 3;
+        // if (this.$refs[name]) {
+        //   height = this.$refs[name].$el?this.$refs[name].$el.offsetHeight:200;
+        //   num = Math.floor(height / 80);
+        // }
+        height = this.$refs['homeRef']?(this.$refs['homeRef'].offsetHeight-470-90-20):200;
+        if(this.activeName==2){
+          height=height-610-90-20
         }
+        num = Math.floor(height / 80);
         let inputMaterials = JSON.parse(
           JSON.stringify(this.TasksCopy[i].Procedure.procedure[value])
         );
@@ -896,7 +917,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){
@@ -907,6 +928,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)
@@ -985,7 +1007,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) {
@@ -1407,6 +1429,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