ソースを参照

更新 首页

wzh 3 年 前
コミット
a8efc064f9
1 ファイル変更20 行追加3 行削除
  1. 20 3
      src/views/index/Index.vue

+ 20 - 3
src/views/index/Index.vue

@@ -183,7 +183,7 @@
           size="small"
           type="primary"
         >
-          重置
+          全部
         </el-button>
       </div>
     </div>
@@ -289,7 +289,8 @@ let echarts = inject("ec");
 
 function initMap() {
   map.value = new AMap.Map("map-container", {
-    zoom: 11, //级别
+    zoom: 9, //级别
+    zooms: [4, 9],
     center: [120.563757, 31.891174], //中心点坐标
     mapStyle: "amap://styles/f48d96805f5fa7f5aada657c5ee37017",
     zoomEnable: true,
@@ -304,7 +305,7 @@ function initMap() {
   let hawkEye = new AMap.HawkEye({
     opened: false,
   });
-  // map.value.addControl(toolBar);
+  map.value.addControl(toolBar);
   map.value.addControl(hawkEye);
   drawMarkers();
   drawPie();
@@ -387,6 +388,22 @@ async function getIndexData(type) {
       drawMarkers();
       drawPie();
     }
+  } else {
+    indexData.value = {
+      finshDiscTons: 0,
+      mapPoints: [],
+      totalLoadTons: 0,
+      totalVoyageNum: 0,
+      unfinshDiscTons: 0,
+    };
+    if (type == "init") {
+      initMap();
+      drawPie("init");
+    } else {
+      map.value.clearMap();
+      drawMarkers();
+      drawPie();
+    }
   }
 }
 let chartDom = ref({});