Ver Fonte

页面整改

hxf há 2 anos atrás
pai
commit
2b5e391eec

+ 8 - 5
neim-ui/src/views/largeScreenPage/Subpage/preProjectResources.vue

@@ -63,13 +63,13 @@
       </div>
     </div>
     <div v-if="mapMark === 'mapBtuOne'">
-      <bige-map :mapValue="mapValue"/>
+      <bige-map  ref="childMethod" :mapValue="mapValue"/>
     </div>
     <div v-if="mapMark === 'mapBtuThree'">
-      <bige-heat-map :mapValue="mapValue"/>
+      <bige-heat-map  ref="childMethod" :mapValue="mapValue"/>
     </div>
     <div v-if="mapMark === 'mapBtuFive'">
-      <bige-heat-sun-map :mapValue="mapValue"/>
+      <bige-heat-sun-map  ref="childMethod" :mapValue="mapValue"/>
     </div>
     <div class="bottomPushBtu" @click="pushStationResource()">
       <span>在运风光场站资源管理</span>
@@ -239,10 +239,13 @@ export default {
       this.$router.push({path: "/homepage/stationResources"})
     },
     clickBtu(id) {
+      console.log(this.$refs.childMethod)
+      let center = this.$refs.childMethod.center
+      let level = this.$refs.childMethod.level
       this.mapValue = {
         params: new Date(),
-        level: null,//地图层级
-        center: [],//中心坐标
+        level: level === ''?null:level,//地图层级
+        center: center.length === 0?[]:[center.lat,center.lng],//中心坐标
         allStationInfo: null,//场站坐标
         projectInfo: this.projectSeat
       }

+ 7 - 5
neim-ui/src/views/largeScreenPage/Subpage/projectInfo.vue

@@ -71,13 +71,13 @@
       </div>
     </div>
     <div v-if="mapMark === 'mapBtuOne'">
-      <bige-map :mapValue="mapValue"/>
+      <bige-map  ref="childMethod" :mapValue="mapValue"/>
     </div>
     <div v-if="mapMark === 'mapBtuThree'">
-      <bige-heat-map :mapValue="mapValue"/>
+      <bige-heat-map  ref="childMethod" :mapValue="mapValue"/>
     </div>
     <div v-if="mapMark === 'mapBtuFive'">
-      <bige-heat-sun-map :mapValue="mapValue"/>
+      <bige-heat-sun-map  ref="childMethod" :mapValue="mapValue"/>
     </div>
     <div class="bottomPushBtu" @click="pushPreProjectResource()">
       <span>前期项目资源信息</span>
@@ -199,10 +199,12 @@ export default {
       this.$router.push({path: "/homepage/preProjectResources"})
     },
     clickBtu(id) {
+      let center = this.$refs.childMethod.center
+      let level = this.$refs.childMethod.level
       this.mapValue ={
         params: new Date(),
-        level: 12,//地图层级
-        center: this.coordinates,//中心坐标
+        level: level === ''?null:level,//地图层级
+        center: center.length === 0?[]:[center.lat,center.lng],//中心坐标
         allStationInfo: null,//场站坐标
         projectInfo: null,//项目坐标
         allPointInfo:this.allPointInfo,//所有点位信息

+ 7 - 5
neim-ui/src/views/largeScreenPage/Subpage/provincialEnergyStations.vue

@@ -92,13 +92,13 @@
           </div>
         </div>
         <div v-if="mapMark === 'mapBtuOne'">
-          <bige-map :mapValue="mapValue"/>
+          <bige-map ref="childMethod" :mapValue="mapValue"/>
         </div>
         <div v-if="mapMark === 'mapBtuThree'">
-          <bige-heat-map :mapValue="mapValue"/>
+          <bige-heat-map  ref="childMethod" :mapValue="mapValue"/>
         </div>
         <div v-if="mapMark === 'mapBtuFive'">
-          <bige-heat-sun-map :mapValue="mapValue"/>
+          <bige-heat-sun-map  ref="childMethod" :mapValue="mapValue"/>
         </div>
 
 
@@ -190,10 +190,12 @@ export default {
       this.$router.push({path: "/homepage/stationResources"})
     },
     clickBtu(id) {
+      let center = this.$refs.childMethod.center
+      let level = this.$refs.childMethod.level
       this.mapValue = {
         params:new Date(),
-        level: null,//地图层级
-        center: [],//中心坐标
+        level: level === ''?null:level,//地图层级
+        center: center.length === 0?[]:[center.lat,center.lng],//中心坐标
         allStationInfo: this.allStationSeat,//场站坐标
       }
       this.mapMark = id

+ 7 - 5
neim-ui/src/views/largeScreenPage/Subpage/stationInfo.vue

@@ -68,13 +68,13 @@
       </div>
     </div>
     <div v-if="mapMark === 'mapBtuOne'">
-      <bige-map :mapValue="mapValue"/>
+      <bige-map ref="childMethod" :mapValue="mapValue"/>
     </div>
     <div v-if="mapMark === 'mapBtuThree'">
-      <bige-heat-map :mapValue="mapValue"/>
+      <bige-heat-map ref="childMethod" :mapValue="mapValue"/>
     </div>
     <div v-if="mapMark === 'mapBtuFive'">
-      <bige-heat-sun-map :mapValue="mapValue"/>
+      <bige-heat-sun-map ref="childMethod" :mapValue="mapValue"/>
     </div>
     <div class="bottomPushBtu" @click="pushStationResource()">
       <span>在运风光场站资源管理</span>
@@ -179,10 +179,12 @@ export default {
       this.$router.push({path: "/homepage/stationResources"})
     },
     clickBtu(id) {
+      let center = this.$refs.childMethod.center
+      let level = this.$refs.childMethod.level
       this.mapValue ={
         params: new Date(),
-        level: 12,//地图层级
-        center: this.coordinates,//中心坐标
+        level: level === ''?null:level,//地图层级
+        center: center.length === 0?[]:[center.lat,center.lng],//中心坐标
         allStationInfo: null,//场站坐标
         projectInfo: null,//项目坐标
         allPointInfo:this.allPointInfo,//所有点位信息

+ 7 - 5
neim-ui/src/views/largeScreenPage/Subpage/stationResources.vue

@@ -96,13 +96,13 @@
       </div>
     </div>
     <div v-if="mapMark === 'mapBtuOne'">
-      <bige-map :mapValue="mapValue"/>
+      <bige-map ref="childMethod" :mapValue="mapValue"/>
     </div>
     <div v-if="mapMark === 'mapBtuThree'">
-      <bige-heat-map :mapValue="mapValue"/>
+      <bige-heat-map ref="childMethod" :mapValue="mapValue"/>
     </div>
     <div v-if="mapMark === 'mapBtuFive'">
-      <bige-heat-sun-map :mapValue="mapValue"/>
+      <bige-heat-sun-map ref="childMethod" :mapValue="mapValue"/>
     </div>
     <div class="bottomPushBtu" @click="pushPreProjectResource()">
       <span>前期项目资源信息</span>
@@ -232,10 +232,12 @@ export default {
       this.$router.push({path: "/homepage/preProjectResources"})
     },
     clickBtu(id) {
+      let center = this.$refs.childMethod.center
+      let level = this.$refs.childMethod.level
       this.mapValue = {
         params: new Date(),
-        level: null,//地图层级
-        center: [],//中心坐标
+        level: level === ''?null:level,//地图层级
+        center: center.length === 0?[]:[center.lat,center.lng],//中心坐标
         allStationInfo: null,//场站坐标
         projectInfo: null,
         staionInfo:this.stationOptions

+ 9 - 25
neim-ui/src/views/largeScreenPage/components/bigeHeatMap.vue

@@ -50,7 +50,7 @@ export default {
       code: 230000,
       mapData: {},// 传过来的值
       href: window.location.href,
-      level: '',
+      level: 6,
       center: [],
     }
   },
@@ -66,15 +66,6 @@ export default {
         // arcgis-satellite
         // amap-satellite
         // zhongkexingtu
-        // let map = window.BM.map('map', 'bigemap.arcgis-satellite', {
-        // let map = window.BM.map('map', 'bigemap.6914xxtx', {
-        //   center: [30, 104],
-        //   minZoom: 6,
-        //   zoom: 11,
-        //   zoomControl: true,
-        //   attributionControl: false,
-        //   preferCanvas: true, //适用于数据量大时 地图反应速度加快
-        // });
         let map = window.BM.map('map', null, {
           center: [30, 104],
           minZoom: 6,
@@ -85,18 +76,21 @@ export default {
         });
         window.Bmap = map;
         var layer1=window.BM.tileLayer('bigemap.6914xxtx')
-        var layer2=window.BM.tileLayer('bigemap.0utmz6qt');
+        var layer2=window.BM.tileLayer('bigemap.0utmz6qt',{opacity:0.7});
         map.setMaxZoom(12);
         layer1.addTo(map);
         setTimeout(()=>{
-          Object.assign(layer1.options,{
+          Object.assign(layer2.options,{
             maxNativeZoom:8,
             maxZoom:12
           })
-          map.zoomOut();
-          map.zoomIn();
+          if (this.mapData.center.length !== 0) {
+            _self.level = this.mapData.level
+            _self.center = this.mapData.center
+            this.bMap.setView(this.mapData.center, this.mapData.level)
+          }
         },500)
-        layer2.addTo(map)
+        layer2.addTo(map);
         // 热力图是有8级需合并两个图层
         // var layer = window.BM.tileLayer('bigemap.0utmz6qt', {opacity: 0.7}).addTo(map).on('load', function () {
         //   layer.options.maxNativeZoom = 8;
@@ -160,17 +154,7 @@ export default {
           // this.setHeatMap(this.bMap);
           //绑定事件
           this.bindEvents(this.bMap);
-          if (this.mapData.level !== null) {
-            // if (this.mapData.level > 8) {
-            //   this.bMap.setView(this.mapData.center, 8)
-            // }
-            _self.level = this.mapData.level
-            _self.center = this.mapData.center
-            this.bMap.setView(this.mapData.center, this.mapData.level)
 
-            // this.bMap.setZoom(this.mapData.level)
-            // this.bMap.panTo(this.mapData.center)
-          }
         })
         let sIconurl = 'http://' + _self.href.split("//")[1].split("/")[0] + '/largeScreenImg/station.png'
         let hfSIconurl = 'http://' + _self.href.split("//")[1].split("/")[0] + '/largeScreenImg/huafuStation.png'

+ 25 - 17
neim-ui/src/views/largeScreenPage/components/bigeHeatSunMap.vue

@@ -49,7 +49,9 @@ export default {
       mTime: null,
       code: 230000,
       mapData: {},// 传过来的值
-      href: window.location.href
+      href: window.location.href,
+      level:6,
+      center:[],
     }
   },
   mounted() {
@@ -60,12 +62,12 @@ export default {
       let _self = this
       bigemap.then(() => {
         // window.BM.Config.HTTP_URL = 'http://www.bigemap.com:9000';
-        window.BM.Config.HTTP_URL = 'http://localhost:9000';
+        window.BM.Config.HTTP_URL = 'http://192.168.1.181:9000';
         // arcgis-satellite
         // amap-satellite
         // zhongkexingtu
         // let map = window.BM.map('map', 'bigemap.arcgis-satellite', {
-        let map = window.BM.map('map', 'bigemap.6914xxtx', {
+        let map = window.BM.map('map', null, {
           center: [30, 104],
           minZoom: 6,
           zoom: 11,
@@ -74,16 +76,23 @@ export default {
           preferCanvas: true, //适用于数据量大时 地图反应速度加快
         });
         window.Bmap = map;
-
-
-        // 没透明
-        // var offline=window.BM.tileLayer('bigemap.a58a3rnz');
-        // 透明
-        var layer=window.BM.tileLayer('bigemap.ct4z5ch5',{opacity:0.7}).addTo(map).on('load',function (){
-          layer.options.maxNativeZoom=8;
-          layer.options.maxZoom=12;
-          map.setMaxZoom(12);
-        });
+        var layer1=window.BM.tileLayer('bigemap.6914xxtx')
+        var layer2=window.BM.tileLayer('bigemap.ct4z5ch5',{opacity:0.7});
+        map.setMaxZoom(12);
+        layer1.addTo(map);
+        setTimeout(()=>{
+          Object.assign(layer2.options,{
+            opacity:0.7,
+            maxNativeZoom:8,
+            maxZoom:12
+          })
+          if (this.mapData.center.length !== 0) {
+            _self.level = this.mapData.level
+            _self.center = this.mapData.center
+            this.bMap.setView(this.mapData.center, this.mapData.level)
+          }
+        },500)
+        layer2.addTo(map);
         this.bMap = map;
         //首尾需要一致
         let mask = window.BMturf.polygon([[[-180, -90], [180, -90], [180, 90], [-180, 90], [-180, -90]]]);
@@ -141,10 +150,6 @@ export default {
           // this.setHeatMap(this.bMap);
           //绑定事件
           this.bindEvents(this.bMap);
-          if(this.mapData.level !== null){
-            this.bMap.setZoom(this.mapData.level)
-            this.bMap.panTo(this.mapData.center)
-          }
         })
         let sIconurl = 'http://'+_self.href.split("//")[1].split("/")[0]+'/largeScreenImg/station.png'
         let hfSIconurl = 'http://'+_self.href.split("//")[1].split("/")[0]+'/largeScreenImg/huafuStation.png'
@@ -377,12 +382,15 @@ export default {
     },
     //绑定事件-监听地图级别和拖动
     bindEvents(map) {
+      let _self = this
       map.on('moveend', function (e) {
         const c = this.getCenter();
+        _self.center = this.getCenter()
         document.getElementById('move').innerHTML = '当前中心点: 纬度:' + c.lat.toFixed(5) + ',经度:' + c.lng.toFixed(5);
       });
       //添加一个缩放事件
       map.on('zoomend', function (e) {
+        _self.level = this.getZoom()
         document.getElementById('zoom').innerHTML = '当前级别 : ' + this.getZoom();
       });
     },

+ 9 - 5
neim-ui/src/views/largeScreenPage/components/bigeMap.vue

@@ -50,7 +50,7 @@ export default {
       code: 230000,
       mapData:{},// 传过来的值
       href: window.location.href,
-      level:'',
+      level:6,
       center:[],
     }
   },
@@ -135,8 +135,11 @@ export default {
           //绑定事件
           this.bindEvents(this.bMap);
           if(this.mapData.level !== null){
-            this.bMap.setZoom(this.mapData.level)
-            this.bMap.panTo(this.mapData.center)
+            _self.level = this.mapData.level
+            _self.center = this.mapData.center
+            this.bMap.setView(this.mapData.center,this.mapData.level)
+            // this.bMap.setZoom(this.mapData.level)
+            // this.bMap.panTo(this.mapData.center)
           }
 
 
@@ -372,14 +375,15 @@ export default {
     },
     //绑定事件-监听地图级别和拖动
     bindEvents(map){
+      let _self = this
       map.on('moveend', function (e) {
         const c = this.getCenter();
-        this.center = this.getCenter()
+        _self.center = this.getCenter()
         document.getElementById('move').innerHTML = '当前中心点: 纬度:' + c.lat.toFixed(5) + ',经度:' + c.lng.toFixed(5);
       });
       //添加一个缩放事件
       map.on('zoomend', function (e) {
-        this.level = this.getZoom
+        _self.level = this.getZoom()
         document.getElementById('zoom').innerHTML = '当前级别 : ' + this.getZoom();
       });
     },

+ 6 - 4
neim-ui/src/views/largeScreenPage/index.vue

@@ -116,7 +116,7 @@ export default {
     getInfo() {
       this.mapValue = {
         params: new Date(),
-        level: null,//地图层级
+        level: 6,//地图层级
         center: [],//中心坐标
         allStationInfo: null,//场站坐标
       }
@@ -133,11 +133,13 @@ export default {
       this.$router.push({path: "/homepage/provincialEnergyStations"})
     },
     clickBtu(id) {
-      this.$refs.childMethod.haizi()
+      console.log(this.$refs.childMethod)
+      let center = this.$refs.childMethod.center
+      let level = this.$refs.childMethod.level
       this.mapValue = {
         params: new Date(),
-        level: null,//地图层级
-        center: [],//中心坐标
+        level: level === ''?null:level,//地图层级
+        center: center.length === 0?[]:[center.lat,center.lng],//中心坐标
         allStationInfo: null,//场站坐标
       }
       this.mapMark = id