Browse Source

首页事件分类bug

彭宇 2 years ago
parent
commit
d4d6967059
1 changed files with 4 additions and 1 deletions
  1. 4 1
      src/views/forest.vue

+ 4 - 1
src/views/forest.vue

@@ -337,7 +337,7 @@
                 <dv-decoration-3 style="width:150px;height:15px;margin-right: 1rem;"/>
               </div>
               <div class="i-list-con small-bottom-margin h-19">
-                <dv-capsule-chart :config="eventKind" style="width: 90%;height: 18vh; padding:.5rem 1rem"/>
+                <dv-capsule-chart v-if="showEventKind" :config="eventKind" style="width: 90%;height: 18vh; padding:.5rem 1rem"/>
               </div>
             </dv-border-box-13>
           </div>
@@ -480,6 +480,7 @@ export default {
       listCurrentIndex1: '',
       // ----------------------------------事件分类柱状----------------------------------------
       eventKind: {},
+      showEventKind: false,
       // ----------------------------------上报排行----------------------------------------
       reportList: {
         data: []
@@ -978,11 +979,13 @@ export default {
       //右侧获取事件分类
       getEventByEventType({ day: day }).then(res => {
         if (res.data != null && res.data.length > 0) {
+          this.showEventKind=true
           this.eventKind.data = res.data
           this.eventKind.colors = ['#1ce0a9', '#d6333b', '#e68d3f', '#32c5e9', '#2abc65']
           this.eventKind.showValue = true
           this.eventKind = { ...this.eventKind }
         } else {
+          this.showEventKind=false
           this.eventKind = {}
           this.eventKind = { ...this.eventKind }
         }