zhulizhen1111 4 лет назад
Родитель
Сommit
c48202aa9e
2 измененных файлов с 16 добавлено и 13 удалено
  1. 6 11
      src/views/strategy/animationBox.vue
  2. 10 2
      src/views/strategy/index.vue

+ 6 - 11
src/views/strategy/animationBox.vue

@@ -62,7 +62,7 @@ import strategyLine from '@/components/strategyLine'
 export default {
     data() {
         return {
-            // showDraw: false,
+            showDraw: false,
             dataX: [],
             dataY1: [],
             dataY2: [],
@@ -76,20 +76,15 @@ export default {
         }
     },
     components: { bomBox, strategyLine },
-    mounted(){
-    },
-    computed:{
-        showDraw(){
-             if(Object.keys(this.chillerCommandQ).length>0 && this.chillerCommandQ.isNew){
-                console.log('111111111')
-                return true
+    methods:{
+        isShowDraw(){
+            if(Object.keys(this.chillerCommandQ).length>0 && this.chillerCommandQ.isNew){
+                this.showDraw = true
             }else{
-               return false
+                this.showDraw = false
             }
         }
     },
-    methods:{
-    },
     props: ['data', 'chillerHourList', 'chillerCommandQ']
 }
 </script>

+ 10 - 2
src/views/strategy/index.vue

@@ -28,7 +28,7 @@
             <div class='starte-right'>
                 <p class='strate-right-title'>当前状态</p>
                 <water-unit :data='chillerOrg ' :type='1'></water-unit>
-                <animation-box
+                <animation-box ref="box"
                     v-if='Object.keys(chillerCommand).length>=0||chillerHourList.length>=0'
                     :data='chillerOrg'
                     :chillerHourList='chillerHourList'
@@ -97,6 +97,12 @@ export default {
                 this.chillerOrg = res.chillerOrg || {}
                 this.chillerCommand = res.chillerCommand || {}
                 this.chillerHourList = res.chillerHourList || []
+                 if(Object.keys(this.chillerCommand).length>=0||this.chillerHourList.length>=0){
+                    let vm =this
+                    setTimeout(function(){
+                         vm.$refs.box.isShowDraw()
+                    },100) 
+                }
             })
         },
         getData() {
@@ -127,11 +133,13 @@ export default {
         let vm = this
         this.clearId = setInterval(function(){
            vm.getChiller()
+           vm.$refs.box.isShowDraw()
         },10000*60)
         this.getChiller()
+       
     },
     destroyed(){
-        window.clearInterval(thius.clearId)
+        window.clearInterval(this.clearId)
     }
 }
 </script>