Parcourir la source

物联看板地图

jiawuxian il y a 1 an
Parent
commit
724f5391a2
1 fichiers modifiés avec 11 ajouts et 2 suppressions
  1. 11 2
      src/views/iot/board/components/deviceMap.vue

+ 11 - 2
src/views/iot/board/components/deviceMap.vue

@@ -1,7 +1,8 @@
 <!--  -->
 <template>
   <div class="component_box">
-    <div id="iot_map_Chart" style="height: 100%"></div>
+    <h1 class="t_title">设备分布</h1>
+    <div ref="chart" style="height: 100%"></div>
   </div>
 </template>
 
@@ -97,7 +98,7 @@ export default {
       this.myChart && this.myChart.dispose();
 
       // 基于准备好的dom,初始化echarts实例
-      this.myChart = echarts.init(document.getElementById("iot_map_Chart"));
+      this.myChart = echarts.init(this.$refs["chart"]);
       let t = this;
 
       getMap(this.map).then((data) => {
@@ -273,4 +274,12 @@ export default {
     text-align: center;
   }
 }
+.t_title {
+  position: absolute;
+  font-size: 16px;
+  font-weight: 700;
+  color: #fff;
+  margin-left: 5%;
+  margin-top: calc(5% + 18px);
+}
 </style>