dedsudiyu 2 年之前
父節點
當前提交
20e8a6079b
共有 1 個文件被更改,包括 31 次插入6 次删除
  1. 31 6
      src/views/newEvacuationBigData.vue

+ 31 - 6
src/views/newEvacuationBigData.vue

@@ -58,6 +58,7 @@
             <p>危险源</p>
           </div>
           <div id="eCharts"></div>
+          <p v-if="!eChartsData.nameList[0]" class="eCharts-null-p">暂无数据</p>
         </div>
       </div>
       <!--中间 楼栋/楼层/当前位置/疏散开关-->
@@ -556,7 +557,13 @@
         //优先显示的提示
         checkPlanId:null,
         //结束预案时使用的预案ID
-        checkRiskPlanId:null
+        checkRiskPlanId:null,
+        //eCharts
+        eChartsData:{
+          nameList: [],
+          numList: [],
+          maxNumList: [],
+        },
       }
     },
     created() {
@@ -771,7 +778,7 @@
       //楼栋选择
       buildingChange(val){
         this.$set(this,'buildingId',val);
-        this.getBuildOrFloorList();
+        this.getBuildOrFloorList('automatic');
       },
       //楼层选择
       floorChange(val){
@@ -1134,9 +1141,17 @@
               obj.numList.push(response.data[i].percentage)
               obj.maxNumList.push(100)
             }
-            this.eChartsFunction(obj);
+            this.$set(this,'eChartsData',obj);
+            this.eChartsFunction(this.eChartsData);
           }else{
-            document.getElementById('eCharts').innerHTML = '<p style="line-height:200px;font-size:16px;color:#fff;text-align: center">暂无数据</p>'
+            let obj = {
+              nameList: [],
+              numList: [],
+              maxNumList: [],
+            }
+            this.$set(this,'eChartsData',obj);
+            this.eChartsFunction(this.eChartsData);
+            // document.getElementById('eCharts').innerHTML = '<p style="line-height:200px;font-size:16px;color:#fff;text-align: center">暂无数据</p>'
           }
         });
       },
@@ -1149,8 +1164,8 @@
           grid: {
             left: '6%',
             right: '4%',
-            bottom: '0%',
-            top: '20%',
+            bottom: '5%',
+            top: '10%',
             containLabel: true,
           },
           legend: [{
@@ -1696,6 +1711,9 @@
                     index = i;
                   }
                 }
+                console.log('floorId',this.floorId)
+                console.log('index',index)
+                console.log('response.data',response.data)
                 this.$set(this,'floorId',response.data[index].id);
               }
             }
@@ -2385,9 +2403,16 @@
       .left-big-box-three{
         margin-left:30px;
         height:322px;
+        position: relative;
         #eCharts{
           height:233px;
         }
+        .eCharts-null-p{
+          color:#fff;
+          position: absolute;
+          top:170px;
+          left:168px;
+        }
       }
     }
     .center-max-big-box{