Ver código fonte

地图注释行政区划分 ,路由截取,+配电图

ming 3 anos atrás
pai
commit
8d9a81b08a
4 arquivos alterados com 40 adições e 37 exclusões
  1. 2 0
      public/static/config.js
  2. 10 9
      src/router/index.js
  3. 27 27
      src/views/home/index.vue
  4. 1 1
      src/views/index.vue

+ 2 - 0
public/static/config.js

@@ -4,6 +4,8 @@ var PLATFROM_CONFIG = {};
 // PLATFROM_CONFIG.baseUrl = "http://172.16.1.196:8010/"  //超博本地
 
 // console.log(window.location)
+
+
 if (window.location.host.indexOf("localhost") != -1 || window.location.host.indexOf("pcdev.ewoogi.com") != -1) {
     PLATFROM_CONFIG.baseUrl = "https://qhome.usky.cn/fivapi/" //线上
     PLATFROM_CONFIG.fileUrl = "https://qhome.usky.cn/file/" //xlsx文件访问路径

+ 10 - 9
src/router/index.js

@@ -12,7 +12,7 @@ let routes = [
         name: 'login',
         meta: { title: '登录', name: "登录 ", type: "" },
         component: () =>
-            import('../views/login.vue'),
+            import ('../views/login.vue'),
         hidden: true,
     },
     {
@@ -20,7 +20,7 @@ let routes = [
         name: 'home',
         meta: { title: '首页', name: "智慧用电监控平台", type: "index" },
         component: () =>
-            import('../views/home/index.vue'),
+            import ('../views/home/index.vue'),
     },
 
     // ming router end
@@ -55,7 +55,7 @@ let routes = [
         name: 'overview',
         meta: { title: '概览', name: "测试站点一", type: "menu" },
         component: () =>
-            import('../views/site/Overview.vue'),
+            import ('../views/site/Overview.vue'),
     },
     //配电系统图页面
     {
@@ -63,7 +63,7 @@ let routes = [
         name: 'power_diagram',
         meta: { title: '配电系统图', name: "测试站点一", type: "menu" },
         component: () =>
-            import('../views/site/Power_diagram.vue'),
+            import ('../views/site/Power_diagram.vue'),
         // import ('../views/site/CircuitEdit.vue'),
     },
     //配电系统图页面
@@ -72,7 +72,8 @@ let routes = [
         name: 'CircuitEdit',
         meta: { title: '配电系统图', name: "测试站点一", type: "menu" },
         component: () =>
-            import('../views/site/CircuitEdit.vue'),
+            import ('../views/site/CircuitEdit.vue'),
+
     },
 
     //设备监控页面
@@ -81,7 +82,7 @@ let routes = [
         name: 'device_motore',
         meta: { title: '设备监控', name: "测试站点一", type: "menu" },
         component: () =>
-            import('../views/site/Device_motore.vue'),
+            import ('../views/site/Device_motore.vue'),
     },
     //事件告警页面
     {
@@ -89,7 +90,7 @@ let routes = [
         name: 'event_alarm',
         meta: { title: '事件告警', name: "测试站点一", type: "menu" },
         component: () =>
-            import('../views/site/Event_alarm.vue'),
+            import ('../views/site/Event_alarm.vue'),
     },
 
 
@@ -100,7 +101,7 @@ let routes = [
         name: 'CircuitEdit1',
         meta: { title: '编辑器', name: "测试站点一", type: "" },
         component: () =>
-            import('../views/CircuitEdit1.vue'),
+            import ('../views/CircuitEdit1.vue'),
     },
     // 预览页页面
     {
@@ -109,7 +110,7 @@ let routes = [
         meta: { title: '预览', name: "测试站点一", type: "" },
         component: () =>
             // import('../views/CircuitPreview.vue'),
-            import('../views/CircuitPreview.vue'),
+            import ('../views/CircuitPreview.vue'),
         // import('../views/site/Power_diagram.vue'),
     },
 

+ 27 - 27
src/views/home/index.vue

@@ -375,7 +375,7 @@ export default {
 
       this.addMarker(dataList, "water");
 
-      this.drawBounds();
+      // this.drawBounds();
     },
 
     addMarker(lnglats) {
@@ -438,32 +438,32 @@ export default {
       this.map.add(new AMap.OverlayGroup(markers));
       this.map.setFitView(); // 根据所有点自适应
 
-      this.mapPolList = mapData.map((val, ind) => {
-        // console.log(val)
-        let color =
-          this.colorList[
-            this.colorIndList.findIndex(
-              (value, index) =>
-                value <= ind && ind < this.colorIndList[index + 1]
-            )
-          ];
-        return [
-          new AMap.Polygon({
-            map: this.map,
-            fillOpacity: 0.5,
-            path: val[3],
-            fillColor: color[0],
-            strokeColor: color[1],
-          }),
-          new AMap.Polygon({
-            map: this.map,
-            fillOpacity: 0.5,
-            path: val[3],
-            fillColor: color[1],
-            strokeColor: color[0],
-          }),
-        ];
-      });
+      // this.mapPolList = mapData.map((val, ind) => {
+      //   // console.log(val)
+      //   let color =
+      //     this.colorList[
+      //       this.colorIndList.findIndex(
+      //         (value, index) =>
+      //           value <= ind && ind < this.colorIndList[index + 1]
+      //       )
+      //     ];
+      //   return [
+      //     new AMap.Polygon({
+      //       map: this.map,
+      //       fillOpacity: 0.5,
+      //       path: val[3],
+      //       fillColor: color[0],
+      //       strokeColor: color[1],
+      //     }),
+      //     new AMap.Polygon({
+      //       map: this.map,
+      //       fillOpacity: 0.5,
+      //       path: val[3],
+      //       fillColor: color[1],
+      //       strokeColor: color[0],
+      //     }),
+      //   ];
+      // });
       this.map.on("mousemove", (e) => {
         var point = [e.lnglat.getLng(), e.lnglat.getLat()];
         var pointList = mapData.map((val) => {

+ 1 - 1
src/views/index.vue

@@ -67,7 +67,7 @@
             :class="
               title == route.meta.title ? 'router_rigth2' : 'router_rigth1'
             "
-            v-for="route in router.slice(4, 6)"
+            v-for="route in router.slice(5, 7)"
             :key="route"
             :to="route.path"
             v-show="route.meta.type === 'menu'"